Python交叉编译为ARM时出错

2024-05-15 02:56:45 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试为ARM编译Python(3.1.3版),遵循this guide

以下是我在Ubuntu 12上发出的命令:

CC=arm-linux-gnueabi-gcc CXX=arm-linux-gnueabi-g++ AR=arm-linux-gnueabi-ar RANLIB=arm-linux-gnueabi-ranlib ./configure --host --build=x86_64-linux-gnu --prefix=/python

make HOSTPYTHON=./hostpython HOSTPGEN=./Parser/hostpgen BLDSHARED="arm-linux-gnueabi-gcc -shared" CROSS_COMPILE=arm-linux-gnueabi- CROSS_COMPILE_TARGET=yes HOSTARCH=x86_64-linux-gnu BUILDARCH=x86_64-linux-gnu

make install HOSTPYTHON=./hostpython BLDSHARED="arm-linux-gnueabi-gcc -shared" CROSS_COMPILE=arm-linux-gnueabi- CROSS_COMPILE_TARGET=yes prefix=~/Python-2.7.2/_install

有几件事要注意。

  1. 在执行第一个命令时,如果--host设置为arm linux,则不会执行该命令,这告诉我应该使用'--host'进行交叉编译。这就是为什么我什么都没做。
  2. 当运行第二条线路时,我得到

configure: WARNING: Cache variable ac_cv_host contains a newline. Failed to configure _ctypes module

Python build finished, but the necessary bits to build these modules were not found: _curses _curses_panel _dbm
_gdbm _hashlib _sqlite3
_ssl bz2 ossaudiodev readline zlib To find the necessary bits, look in setup.py in detect_modules() for the module's name.

Failed to build these modules: _tkinter

我在运行第三行时也遇到了类似的错误,但我想这是因为上面的命令不起作用。

我想看看有没有人能帮我修好它。


Tags: thetognu命令buildmoduleshostconfigure

热门问题