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

时间:2019-09-02 04:16:16

标签: autotools autoconf

我不是autotool / autoconf专家

作为标题,我正在为ARM平台进行交叉编译。然后尝试

 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

我知道编译是支持共享库。并且我想获得修复配置

配置上跟踪/调试此类问题的最佳方法是什么?

1 个答案:

答案 0 :(得分:0)

  

在配置中跟踪/调试此类问题的最佳方法是什么?

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

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

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

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

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