———————————————————————————————————————————— ######################################################################################## ———————————————————————————————————————————— Python 移植教程 准备文件: Python-2.7.13.tgz sqlite-autoconf-3200100.tar.gz Python-2.7.13-xcompile.patch.tar.gz 步骤1、———————————— tar xvf Python-2.7.13.tgz tar xvf sqlite-autoconf-3200100.tar.gz mkdir python2_7_13_for_x86_64 mkdir python2_7_13_for_arm mkdir INSTALL mkdir sqlite3 ———————————————— 步骤2、———————————— cd sqlite-autoconf-3200100 configure --host=arm-cortex_a9-linux-gnueabi --prefix=$PWD/../sqlite3 make make install ———————————————— 步骤3、———————————— cd ../python2_7_13_for_x86_64/ sed -i 's/self.extensions.remove(ext)/print(ext.name)/g' ../Python-2.7.13/setup.py ../Python-2.7.13/configure --prefix=`pwd` make make install ———————————————— 步骤4、———————————— cd .. tar xvf Python-2.7.13-xcompile.patch.tar.gz -C Python-2.7.13 cd Python-2.7.13/ patch -p1 < Python-2.7.13-xcompile.patch ———————————————— 步骤5、———————————— cd ../python2_7_13_for_arm/ ../Python-2.7.13/configure --prefix=`pwd` --host=arm-cortex_a9-linux-gnueabi --build=x86_64-linux-gnu --enable-ipv6 --enable-static ac_cv_file__dev_ptmx="yes" ac_cv_file__dev_ptc="no" LDFLAGS="-L$PWD/../sqlite3/lib" CPPFLAGS="-I$PWD/../sqlite3/include" ———————————————— 步骤6、———————————— make HOSTPYTHON=../python2_7_13_for_x86_64/python HOSTPGEN=../python2_7_13_for_x86_64/Parser/pgen BLDSHARED="arm-cortex_a9-linux-gnueabi-gcc -shared" CROSS_COMPILE=arm-cortex_a9-linux-gnueabi- CROSS_COMPILE_TARGET=yes HOSTARCH=arm-cortex_a9-linux-gnueabi BUILDARCH=x86_64-linux-gnu ———————————————— 步骤7、———————————— make install HOSTPYTHON=../python2_7_13_for_x86_64/python BLDSHARED="arm-cortex_a9-linux-gnueabi-gcc -shared" CROSS_COMPILE=arm-cortex_a9-linux-gnueabi- CROSS_COMPILE_TARGET=yes prefix=$PWD/../INSTALL 然后在INSTALL目录下面就是Python的应用程序了,将它打包到开发板上就可以使用了 |
更多回帖