Skip to content

Commit c10b5ef

Browse files
committed
better build arch detection
1 parent 4fcaad6 commit c10b5ef

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

recipes/python/recipe.sh

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ function build_python() {
7878
try cp $BUILD_hostpython/hostpython .
7979
try cp $BUILD_hostpython/hostpgen .
8080

81+
export BUILDARCH=$(gcc -dumpmachine)
82+
export HOSTARCH=arm-eabi
83+
8184
push_arm
8285

8386
# openssl activated ?
@@ -96,16 +99,6 @@ function build_python() {
9699

97100
# CFLAGS for python ctypes library
98101
#export CFLAGS="$CFLAGS -DNO_MALLINFO"
99-
machine=$(uname -m)
100-
system=$(uname -s)
101-
system=${system,,} # convert to lowercase
102-
103-
if [ "$machine" == "i386" ]; then
104-
machine=x86
105-
fi
106-
107-
export BUILDARCH=${machine}-${system}-gnu
108-
export HOSTARCH=arm-eabi
109102

110103
try ./configure --host=$HOSTARCH --build=$BUILDARCH OPT=$OFLAG --prefix="$BUILD_PATH/python-install" --enable-shared --disable-toolbox-glue --disable-framework
111104
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() {
125118
$MAKE install HOSTPYTHON=$BUILD_python/hostpython HOSTPGEN=$BUILD_python/hostpgen CROSS_COMPILE_TARGET=yes INSTSONAME=libpython2.7.so
126119
pop_arm
127120

128-
if [ "X$system" == "Xdarwin" ]; then
121+
system=$(uname -s)
122+
if [ "X$system" == "XDarwin" ]; then
129123
try cp $RECIPE_python/patches/_scproxy.py $BUILD_python/Lib/
130124
try cp $RECIPE_python/patches/_scproxy.py $BUILD_PATH/python-install/lib/python2.7/
131125
fi
132126
try cp $BUILD_hostpython/hostpython $HOSTPYTHON
133127
try cp libpython2.7.so $LIBS_PATH/
134-
try cp -a build/lib.*-${machine}-2.7/_ctypes*.so $LIBS_PATH
128+
try cp -a build/lib.*-2.7/_ctypes*.so $LIBS_PATH
135129

136130
# reduce python
137131
rm -rf "$BUILD_PATH/python-install/lib/python2.7/test"

0 commit comments

Comments
 (0)