Permalink
Browse files

add new patch emulate linux from darwin system in python ./configure

  • Loading branch information...
1 parent 7ac9606 commit a11ed0820d0b080a0dbf50ce3ef786e720df0626 @tito tito committed Jul 9, 2012
Showing with 49 additions and 4 deletions.
  1. +0 −1 recipes/hostpython/recipe.sh
  2. +40 −0 recipes/python/patches/fix-configure-darwin.patch
  3. +9 −3 recipes/python/recipe.sh
@@ -24,7 +24,6 @@ function build_hostpython() {
try ./configure
try make -j5
- bash
try mv python.exe hostpython
try mv Parser/pgen hostpgen
#try mkdir -p ../prebuilt/Python-$PYVERSION/lib
@@ -0,0 +1,40 @@
+--- Python-2.7.2.orig/configure 2012-07-09 23:48:02.000000000 +0200
++++ Python-2.7.2/configure 2012-07-09 23:47:34.000000000 +0200
+@@ -4927,7 +4927,7 @@
+ RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
+ INSTSONAME="$LDLIBRARY".$SOVERSION
+ ;;
+- Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*)
++ Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|Darwin*)
+ LDLIBRARY='libpython$(VERSION).so'
+ BLDLIBRARY='-L. -lpython$(VERSION)'
+ RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
+@@ -4960,7 +4960,7 @@
+ BLDLIBRARY='-L. -lpython$(VERSION)'
+ RUNSHARED=DLL_PATH=`pwd`:${DLL_PATH:-/atheos/sys/libs:/atheos/autolnk/lib}
+ ;;
+- Darwin*)
++ DDarwin*)
+ LDLIBRARY='libpython$(VERSION).dylib'
+ BLDLIBRARY='-L. -lpython$(VERSION)'
+ RUNSHARED='DYLD_LIBRARY_PATH=`pwd`:${DYLD_LIBRARY_PATH}'
+@@ -7625,6 +7625,9 @@
+ LDSHARED='ld -b'
+ fi ;;
+ OSF*) LDSHARED="ld -shared -expect_unresolved \"*\"";;
++ Darwin*|Linux*|GNU*|QNX*)
++ LDSHARED='$(CC) -shared'
++ LDCXXSHARED='$(CXX) -shared';;
+ Darwin/1.3*)
+ LDSHARED='$(CC) -bundle'
+ LDCXXSHARED='$(CXX) -bundle'
+@@ -7680,9 +7683,6 @@
+ fi
+ fi
+ ;;
+- Linux*|GNU*|QNX*)
+- LDSHARED='$(CC) -shared'
+- LDCXXSHARED='$(CXX) -shared';;
+ BSD/OS*/4*)
+ LDSHARED="gcc -shared"
+ LDCXXSHARED="g++ -shared";;
View
@@ -30,6 +30,11 @@ function prebuild_python() {
try patch -p1 < $RECIPE_python/patches/fix-remove-corefoundation.patch
try patch -p1 < $RECIPE_python/patches/fix-dynamic-lookup.patch
+ system=$(uname -s)
+ if [ "X$system" == "XDarwin" ]; then
+ try patch -p1 < $RECIPE_python/patches/fix-configure-darwin.patch
+ fi
+
# everything done, touch the marker !
touch .patched
}
@@ -58,8 +63,8 @@ function build_python() {
fi
try ./configure --host=arm-eabi --prefix="$BUILD_PATH/python-install" --enable-shared --disable-toolbox-glue --disable-framework
+ echo ./configure --host=arm-eabi --prefix="$BUILD_PATH/python-install" --enable-shared --disable-toolbox-glue --disable-framework
echo $MAKE HOSTPYTHON=$BUILD_python/hostpython HOSTPGEN=$BUILD_python/hostpgen CROSS_COMPILE_TARGET=yes INSTSONAME=libpython2.7.so
- bash
cp HOSTPYTHON=$BUILD_python/hostpython python
# FIXME, the first time, we got a error at:
@@ -71,10 +76,11 @@ function build_python() {
debug 'First install (failing..)'
$MAKE install HOSTPYTHON=$BUILD_python/hostpython HOSTPGEN=$BUILD_python/hostpgen CROSS_COMPILE_TARGET=yes INSTSONAME=libpython2.7.so
debug 'Second install.'
- try $MAKE install HOSTPYTHON=$BUILD_python/hostpython HOSTPGEN=$BUILD_python/hostpgen CROSS_COMPILE_TARGET=yes INSTSONAME=libpython2.7.so
+ touch python.exe python
+ $MAKE install HOSTPYTHON=$BUILD_python/hostpython HOSTPGEN=$BUILD_python/hostpgen CROSS_COMPILE_TARGET=yes INSTSONAME=libpython2.7.so
pop_arm
- try cp $BUILD_python/hostpython $BUILD_PATH/python-install/bin/python.host
+ try cp $BUILD_hostpython/hostpython $BUILD_PATH/python-install/bin/python.host
try cp libpython2.7.so $LIBS_PATH/
}

1 comment on commit a11ed08

a-w-e-s-o-m-e ✌️

Please sign in to comment.