From c67e2c1e159db10b75cc19726246f2cb16f86661 Mon Sep 17 00:00:00 2001 From: Ryan Pessa Date: Fri, 15 May 2015 09:52:43 -0500 Subject: [PATCH 1/4] don't assume x86_64 --- recipes/python/recipe.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/recipes/python/recipe.sh b/recipes/python/recipe.sh index 69e1b6c26a..fdd18ee86a 100644 --- a/recipes/python/recipe.sh +++ b/recipes/python/recipe.sh @@ -96,7 +96,8 @@ function build_python() { # CFLAGS for python ctypes library #export CFLAGS="$CFLAGS -DNO_MALLINFO" - export BUILDARCH=x86_64-linux-gnu + machine=`uname -m` + export BUILDARCH=${machine}-linux-gnu export HOSTARCH=arm-eabi try ./configure --host=$HOSTARCH --build=$BUILDARCH OPT=$OFLAG --prefix="$BUILD_PATH/python-install" --enable-shared --disable-toolbox-glue --disable-framework @@ -124,7 +125,7 @@ function build_python() { fi try cp $BUILD_hostpython/hostpython $HOSTPYTHON try cp libpython2.7.so $LIBS_PATH/ - try cp -a build/lib.linux-x86_64-2.7/_ctypes*.so $LIBS_PATH + try cp -a build/lib.linux-${machine}-2.7/_ctypes*.so $LIBS_PATH # reduce python rm -rf "$BUILD_PATH/python-install/lib/python2.7/test" From c9bf64d6b27e843292f24066daa8b951873f8d23 Mon Sep 17 00:00:00 2001 From: Ryan Pessa Date: Fri, 15 May 2015 10:00:45 -0500 Subject: [PATCH 2/4] fix i386, try to add system detection --- recipes/python/recipe.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/recipes/python/recipe.sh b/recipes/python/recipe.sh index fdd18ee86a..eb33ed0218 100644 --- a/recipes/python/recipe.sh +++ b/recipes/python/recipe.sh @@ -96,8 +96,15 @@ function build_python() { # CFLAGS for python ctypes library #export CFLAGS="$CFLAGS -DNO_MALLINFO" - machine=`uname -m` - export BUILDARCH=${machine}-linux-gnu + machine=$(uname -m) + system=$(uname -s) + system=${system,,} # convert to lowercase + + if [ "$machine" == "i386" ]; then + machine=x86 + fi + + export BUILDARCH=${machine}-${system}-gnu export HOSTARCH=arm-eabi try ./configure --host=$HOSTARCH --build=$BUILDARCH OPT=$OFLAG --prefix="$BUILD_PATH/python-install" --enable-shared --disable-toolbox-glue --disable-framework @@ -118,14 +125,13 @@ function build_python() { $MAKE install HOSTPYTHON=$BUILD_python/hostpython HOSTPGEN=$BUILD_python/hostpgen CROSS_COMPILE_TARGET=yes INSTSONAME=libpython2.7.so pop_arm - system=$(uname -s) - if [ "X$system" == "XDarwin" ]; then + if [ "X$system" == "Xdarwin" ]; then try cp $RECIPE_python/patches/_scproxy.py $BUILD_python/Lib/ try cp $RECIPE_python/patches/_scproxy.py $BUILD_PATH/python-install/lib/python2.7/ fi try cp $BUILD_hostpython/hostpython $HOSTPYTHON try cp libpython2.7.so $LIBS_PATH/ - try cp -a build/lib.linux-${machine}-2.7/_ctypes*.so $LIBS_PATH + try cp -a build/lib.${system}-${machine}-2.7/_ctypes*.so $LIBS_PATH # reduce python rm -rf "$BUILD_PATH/python-install/lib/python2.7/test" From 4fcaad654e300082dc2729a708dbbce4175c1941 Mon Sep 17 00:00:00 2001 From: Ryan Pessa Date: Fri, 15 May 2015 10:02:47 -0500 Subject: [PATCH 3/4] add wildcard for system --- recipes/python/recipe.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/python/recipe.sh b/recipes/python/recipe.sh index eb33ed0218..974937db0d 100644 --- a/recipes/python/recipe.sh +++ b/recipes/python/recipe.sh @@ -131,7 +131,7 @@ function build_python() { fi try cp $BUILD_hostpython/hostpython $HOSTPYTHON try cp libpython2.7.so $LIBS_PATH/ - try cp -a build/lib.${system}-${machine}-2.7/_ctypes*.so $LIBS_PATH + try cp -a build/lib.*-${machine}-2.7/_ctypes*.so $LIBS_PATH # reduce python rm -rf "$BUILD_PATH/python-install/lib/python2.7/test" From c10b5ef2fee41b4bd1fa1d090ad22dd17d60f633 Mon Sep 17 00:00:00 2001 From: Ryan Pessa Date: Fri, 15 May 2015 10:13:29 -0500 Subject: [PATCH 4/4] better build arch detection --- recipes/python/recipe.sh | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/recipes/python/recipe.sh b/recipes/python/recipe.sh index 974937db0d..4516e9fb63 100644 --- a/recipes/python/recipe.sh +++ b/recipes/python/recipe.sh @@ -78,6 +78,9 @@ function build_python() { try cp $BUILD_hostpython/hostpython . try cp $BUILD_hostpython/hostpgen . + export BUILDARCH=$(gcc -dumpmachine) + export HOSTARCH=arm-eabi + push_arm # openssl activated ? @@ -96,16 +99,6 @@ function build_python() { # CFLAGS for python ctypes library #export CFLAGS="$CFLAGS -DNO_MALLINFO" - machine=$(uname -m) - system=$(uname -s) - system=${system,,} # convert to lowercase - - if [ "$machine" == "i386" ]; then - machine=x86 - fi - - export BUILDARCH=${machine}-${system}-gnu - export HOSTARCH=arm-eabi try ./configure --host=$HOSTARCH --build=$BUILDARCH OPT=$OFLAG --prefix="$BUILD_PATH/python-install" --enable-shared --disable-toolbox-glue --disable-framework echo ./configure --host=$HOSTARCH --build=$BUILDARCH OPT=$OFLAG --prefix="$BUILD_PATH/python-install" --enable-shared --disable-toolbox-glue --disable-framework @@ -125,13 +118,14 @@ function build_python() { $MAKE install HOSTPYTHON=$BUILD_python/hostpython HOSTPGEN=$BUILD_python/hostpgen CROSS_COMPILE_TARGET=yes INSTSONAME=libpython2.7.so pop_arm - if [ "X$system" == "Xdarwin" ]; then + system=$(uname -s) + if [ "X$system" == "XDarwin" ]; then try cp $RECIPE_python/patches/_scproxy.py $BUILD_python/Lib/ try cp $RECIPE_python/patches/_scproxy.py $BUILD_PATH/python-install/lib/python2.7/ fi try cp $BUILD_hostpython/hostpython $HOSTPYTHON try cp libpython2.7.so $LIBS_PATH/ - try cp -a build/lib.*-${machine}-2.7/_ctypes*.so $LIBS_PATH + try cp -a build/lib.*-2.7/_ctypes*.so $LIBS_PATH # reduce python rm -rf "$BUILD_PATH/python-install/lib/python2.7/test"