Refer to this article

http://randomsplat.com/id5-cross-compiling-python-for-embedded-linux.html

http://www.ailis.de/~k/archives/19-ARM-cross-compiling-howto.html

  1. Download the source
  2. ./configure
  3. make python Parser/pgen
  4. mv python hostpython
  5. mv Parser/pgen Parser/hostpgen
  6. make distclean
  7. patch -p1 < ~/Downloads/Python-2.7.3-xcompile.patch
  8. ./configure CC=arm-linux-gnueabi-gcc CXX=arm-linux-gnurabi-g++ –host=arm-linux –build=i686-linux –prefix=/home/kclin/workspace/cross_result/pkg_config/ RANLIB=arm-linux-gnue|
    abi-ranlib LD=arm-linux-gnueabi-ld –cache-file=arm-linux.cache LIBS=”-L/home/kclin/workspace/cross_result/pkg_config/lib -lffi” CFLAGS=”-I/home/kclin/workspace/cross_result/pkg_config/lib/libffi-3.0.13/include -I/home/kclin/worksp|
    ace/cross_result/pkg_config/include” NM=arm-linux-gnueabi-nm –disable-ipv6
  9. make HOSTPYTHON=./hostpython HOSTPGEN=./Parser/hostpgen CROSS_COMPILE=arm-linux-gnueabi- CROSS_COMPILE_TARGET=yes HOSTARCH=i686-linux BUILDARCH=i386-linux-gnu
  10. make install HOSTPYTHON=./hostpython HOSTPGEN=./Parser/hostpgen CROSS_COMPILE=arm-linux-gnueabi- CROSS_COMPILE_TARGET=yes HOSTARCH=i686-linux BUILDARCH=i386-linux-gnu

Leave a Reply