移植Python2到TQ2440
生活随笔
收集整理的這篇文章主要介紹了
移植Python2到TQ2440
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
環境
Python:2.7.13
開發板: TQ2440
工具鏈: arm-none-linux-gnueabi-gcc 4.8.3
?
概述
前面已經把Python3移植到TQ2440上面的,現在我們移植Python2,基本跟Python3移植步驟類似。
?
正文
一、工具鏈
參考?http://www.cnblogs.com/pengdonglin137/p/6740164.html#_lab2_2_0
?
二、配置
下面是配置腳本mk1_conf.sh:
1 #!/bin/bash 2 3 /home/pengdonglin/disk_ext/Python/Python2/Python-2.7.13/configure --prefix=`pwd` \ 4 --host=arm-linux \ 5 --build=x86_64-linux-gnu \ 6 --enable-ipv6 \ 7 --enable-shared \ 8 ac_cv_file__dev_ptmx="yes" \ 9 ac_cv_file__dev_ptc="no" \ 10 LDFLAGS="-L/home/pengdonglin/disk_ext/TQ2440/rootfs/SQlite3/lib \ 11 -L/home/pengdonglin/disk_ext/TQ2440/rootfs/Readline/lib \ 12 -L/home/pengdonglin/disk_ext/TQ2440/rootfs/Termcap/lib \ 13 -L/home/pengdonglin/disk_ext/TQ2440/rootfs/Zlib/lib"\ 14 CPPFLAGS="-I/home/pengdonglin/disk_ext/TQ2440/rootfs/SQlite3/include \ 15 -I/home/pengdonglin/disk_ext/TQ2440/rootfs/Readline/include \ 16 -I/home/pengdonglin/disk_ext/TQ2440/rootfs/Termcap/include \ 17 -I/home/pengdonglin/disk_ext/TQ2440/rootfs/Zlib/include"\ 18 LDLAST="-L/home/pengdonglin/disk_ext/TQ2440/rootfs/SQlite3/lib \ 19 -L/home/pengdonglin/disk_ext/TQ2440/rootfs/Readline/lib \ 20 -L/home/pengdonglin/disk_ext/TQ2440/rootfs/Termcap/lib \ 21 -L/home/pengdonglin/disk_ext/TQ2440/rootfs/Zlib/lib"配置完成之后,修改Modules/Setup,打開readline,將下面這行取消注釋:
readline readline.c -lreadline -ltermcap 修改Makefile,將: SVNVERSION=>---svnversion $(srcdir) 修改為: SVNVERSION=三、編譯
下面是編譯腳本mk2_mk.sh 1 #!/bin/bash 2 3 make HOSTPYTHON=/home/pengdonglin/disk_ext/Python/Python2/x86_64/python \ 4 HOSTPGEN=/home/pengdonglin/disk_ext/Python/Python2/x86_64/Parser/pgen \ 5 BLDSHARED="arm-linux-gcc -shared" \ 6 CROSS_COMPILE=arm-linux- \ 7 CROSS_COMPILE_TARGET=yes \ 8 HOSTARCH=arm-linux \ 9 BUILDARCH=x86_64-linux-gnu \ 10 -j4四、安裝
下面是安裝腳本mk3_install.sh 1 #!/bin/bash 2 3 make install HOSTPYTHON=/home/pengdonglin/disk_ext/Python/Python2/x86_64/python \ 4 BLDSHARED="arm-linux-gcc -shared" \ 5 CROSS_COMPILE=arm-linux- \ 6 CROSS_COMPILE_TARGET=yes \ 7 prefix=`pwd`?五、測試
[root@tq2440 ~]# python2 /usr/lib/python2.7/test/test___all__.py test_all (__main__.AllTest) ... BaseHTTPServer Bastion CGIHTTPServer ConfigParser Cookie DocXMLRPCServer HTMLParser MimeWriter ... ... ok ---------------------------------------------------------------------- Ran 1 test in 38.408s OK?
完。總結
以上是生活随笔為你收集整理的移植Python2到TQ2440的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Tomcat虚拟主机配置
- 下一篇: 使用angular2 自带的指令,快捷创