@@ -23,6 +23,7 @@ function prebuild_python() {
2323 try patch -p1 < $RECIPE_python /patches/fix-locale.patch
2424 try patch -p1 < $RECIPE_python /patches/fix-gethostbyaddr.patch
2525 try patch -p1 < $RECIPE_python /patches/custom-loader.patch
26+ try patch -p1 < $RECIPE_python /patches/verbose-compilation.patch
2627
2728 # everything done, touch the marker !
2829 touch .patched
@@ -34,20 +35,37 @@ function build_python() {
3435
3536 # if the last step have been done, avoid all
3637 if [ -f $BUILD_PATH /python-install/bin/python.host ]; then
37- # return
38- true
38+ return
39+ # true
3940 fi
4041
4142 # copy same module from host python
4243 try cp $RECIPE_hostpython /Setup Modules
44+ try cp $BUILD_hostpython /hostpython .
45+ try cp $BUILD_hostpython /hostpgen .
4346
4447 push_arm
4548 try ./configure --host=arm-eabi --prefix=" $BUILD_PATH /python-install" --enable-shared
46- try $MAKE HOSTPYTHON=$BUILD_hostpython /hostpython HOSTPGEN=$BUILD_hostpython /hostpgen CROSS_COMPILE=arm-eabi- CROSS_COMPILE_TARGET=yes INSTSONAME=libpython2.7.so
47- try $MAKE install HOSTPYTHON=$BUILD_hostpython /hostpython HOSTPGEN=$BUILD_hostpython /hostpgen CROSS_COMPILE=arm-eabi- CROSS_COMPILE_TARGET=yes INSTSONAME=libpython2.7.so
49+ try $MAKE HOSTPYTHON=$BUILD_python /hostpython HOSTPGEN=$BUILD_python /hostpgen CROSS_COMPILE_TARGET=yes INSTSONAME=libpython2.7.so
50+ cp HOSTPYTHON=$BUILD_python /hostpython python
51+
52+ # Try to compile module by ourself
53+ # debug 'Try to compile module by ourself'
54+ # $BUILD_python/hostpython -E setup.py build -v -f
55+
56+ # FIXME, the first time, we got a error at:
57+ # python$EXE ../../Tools/scripts/h2py.py -i '(u_long)' /usr/include/netinet/in.h
58+ # /home/tito/code/python-for-android/build/python/Python-2.7.2/python: 1: Syntax error: word unexpected (expecting ")")
59+ # because at this time, python is arm, not x86. even that, why /usr/include/netinet/in.h is used ?
60+ # check if we can avoid this part.
61+
62+ debug ' First install (failing..)'
63+ $MAKE install HOSTPYTHON=$BUILD_python /hostpython HOSTPGEN=$BUILD_python /hostpgen CROSS_COMPILE_TARGET=yes INSTSONAME=libpython2.7.so
64+ debug ' Second install.'
65+ try $MAKE install HOSTPYTHON=$BUILD_python /hostpython HOSTPGEN=$BUILD_python /hostpgen CROSS_COMPILE_TARGET=yes INSTSONAME=libpython2.7.so
4866 pop_arm
4967
50- try cp $BUILD_hostpython /hostpython $BUILD_PATH /python-install/bin/python.host
68+ try cp $BUILD_python /hostpython $BUILD_PATH /python-install/bin/python.host
5169 try cp libpython2.7.so $LIBS_PATH /
5270}
5371
0 commit comments