我正在尝试交叉编译Python 3.7.3以在Android上运行。在更新NDK以删除gcc之前,我一直在构建Python3.5.1,在这个git项目中没有任何问题。https://github.com/GRRedWings/python3-android/tree/clang
Python构建方法可以在这里找到https://github.com/GRRedWings/python3-android/blob/clang/mk/python/3.7.3/build.sh,其中许多导出已经设置在根目录的env和mk目录中的build_single.sh中。
尝试将更新到最新的NDK,但遇到问题时,我无法获得对旧版本Python的任何支持。我希望理解交叉编译和配置脚本的人能够为我指明正确的方向。
下面是我调用configure时的输出
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force
autoreconf: configure.ac: tracing
autoreconf: configure.ac: not using Libtool
autoreconf: running: /usr/bin/autoconf --force
autoreconf: running: /usr/bin/autoheader --force
autoreconf: configure.ac: not using Automake
autoreconf: Leaving directory `.'
OUR TARGET IS aarch64-linux-android
configure: loading site script ./config.site
checking build system type... x86_64-pc-linux-gnu
checking host system type... aarch64-unknown-linux-android
checking for python3.7... no
checking for python3... python3
checking for python interpreter for cross build... configure: error: python3.7 interpreter not found
Makefile:34: recipe for target 'python-3.7.3' failed
make: *** [python-3.7.3] Error 1所以我的问题是,我应该把重点放在什么地方。我是否应该查看配置错误,指出python3.7解释器未找到?我应该在config.log中查找吗?我在那里看到的唯一错误是关于解释器的。
发布于 2021-09-11 15:31:24
虽然这是一个老问题,但我已经解决了。如果要进行交叉编译,则需要安装具有相同次要版本的python的本地版本,这似乎很奇怪。这就是说,如果你想构建Python 3.7.x,你需要在你的构建机器上安装Python 3.7.x的本地版本。我是通过使用pyenv来实现的。
https://stackoverflow.com/questions/56178633
复制相似问题