Skip to content

Commit c9bf64d

Browse files
committed
fix i386, try to add system detection
1 parent c67e2c1 commit c9bf64d

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

recipes/python/recipe.sh

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,15 @@ function build_python() {
9696

9797
# CFLAGS for python ctypes library
9898
#export CFLAGS="$CFLAGS -DNO_MALLINFO"
99-
machine=`uname -m`
100-
export BUILDARCH=${machine}-linux-gnu
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
101108
export HOSTARCH=arm-eabi
102109

103110
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() {
118125
$MAKE install HOSTPYTHON=$BUILD_python/hostpython HOSTPGEN=$BUILD_python/hostpgen CROSS_COMPILE_TARGET=yes INSTSONAME=libpython2.7.so
119126
pop_arm
120127

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

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

0 commit comments

Comments
 (0)