嵌入式爱好者

4418与6818平台的Python 移植教程

2017-9-29 11:44| 发布者: 冰斩Resona| 查看: 2730| 评论: 0|来自: 自创

类目: S5P4418/6818系列产品  >  Linux     文档编号: 140

————————————————————————————————————————————
########################################################################################
————————————————————————————————————————————
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的应用程序了,将它打包到开发板上就可以使用了

已解决

未解决
1

只是看看

刚表态过的朋友 (1 人)

最新评论

QQ|小黑屋| 飞凌嵌入式 ( 冀ICP备12004394号-1 )

GMT+8, 2024-11-22 04:44

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

返回顶部