如何在交叉编译时跟踪 ./configure 失败

how to trace ./configure failure on cross compile

我不是autotool/autoconf专家

如标​​题所示,我正在为 ARM 进行交叉编译 platform.then try

 CC=arm-openwrt-linux-gcc LD=arm-openwrt-linux-ld AR=arm-openwrt-linux-ar ./configure --host=arm --build=i386 --target=arm 

然后我收到以下消息,它似乎不支持 共享库

checking whether the arm-openwrt-linux-gcc linker (arm-openwrt-linux-ld) supports shared libraries... yes
...
checking if libtool supports shared libraries... no
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... arm-openwrt-linux-ld
checking if the linker (arm-openwrt-linux-ld) is GNU ld... yes
checking whether the g++ linker (arm-openwrt-linux-ld) supports shared libraries... no
checking for g++ option to produce PIC... -fPIC -DPIC
...
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (arm-openwrt-linux-ld) supports shared libraries... no

我知道编译支持共享库。我想修复 configure

trace/debug 在 配置 中出现此类问题的最佳方法是什么?

what is the best way to trace/debug such problem at configure?

如果基于 Autoconf 的 configure 脚本的输出没有为您提供足够的信息来识别问题,那么您可以从 configure 写入的日志文件中获取更多信息,configure.log.它提供了有关 configure 所做的大量详细信息,包括它为每个测试运行的特定命令、输入(如果相关)及其输出/stderr / return 代码。

有时查看 configure 脚本本身也会有所帮助,但您应该准备好使用编辑器的搜索功能来查找相关代码,因为该脚本通常有数千行长。

但在开始深入研究之前,尝试specifying the host system via an appropriate full triplet。如果这样做,那么您可能不需要通过环境变量指定特定的工具,并且您可能会发现它完全解决了问题。您还可以指定 build 三元组,但这通常不是必需的。 target 三元组完全 un 是必需的,除非您正在构建编译器,因为 target 描述(仅)此类编译器生成输出的系统类型.

例如,看起来这可能适合您的情况:

./configure --host=arm-openwrt-linux