交叉编译python arm

时间:2016-05-11 08:50:39

标签: python-2.7 arm cross-compiling

我想为ARM交叉编译python 2.7.3。 我跟着这个例子: https://gist.github.com/bmount/6929380

但在使用make install的最后一步中,我收到错误:

running install
running install_lib
creating /_install
error: could not create '/_install': Permission denied
make: *** [sharedinstall] Erreur 1

这就是我完成交叉编译的方式:

./configure
make python Parser/pgen
mv python hostpython
mv Parser/pgen Parser/hostpgen
make distclean
patch -p1 < ../Python-2.7.3-xcompile.patch 
CC=arm-unknown-linux-gnueabihf-gcc CXX=arm-unknown-linux-gnueabihf-g++ AR=arm-unknown-linux-gnueabihf-ar RANLIB=arm-unknown-linux-gnueabihf-ranlib ./configure --host=arm-unknown-linux --build=x86_64-linux-gnu --prefix=/python
make HOSTPYTHON=./hostpython HOSTPGEN=./Parser/hostpgen BLDSHARED="arm-unknown-linux-gnueabihf-gcc -shared" CROSS_COMPILE=arm-unknown-linux-gnueabihf- CROSS_COMPILE_TARGET=yes HOSTARCH=arm-unknown-linux BUILDARCH=x86_64-linux-gnu
make install HOSTPYTHON=./hostpython BLDSHARED="arm-unknown-linux-gnueabihf-gcc -shared" CROSS_COMPILE=arm-unknown-linux-gnueabihf- CROSS_COMPILE_TARGET=yes prefix=../Python-2.7.3/_install

如果我用&#34; sudo&#34;运行此命令,我会收到其他错误:

 Creating directory ../Python-2.7.3/_install/lib/python2.7/config
Creating directory ../Python-2.7.3/_install/lib/pkgconfig
/bin/sh: 7: arm-unknown-linux-gnueabihf-ranlib: not found

1 个答案:

答案 0 :(得分:0)

当你使用&#34; sudo&#34;时,找不到&#34; arm-unknown-linux - &#34;,也许你应该添加&#34; arm-unknow-linux的路径 - &#34;到了根本的环境。