【发布时间】:2020-12-21 22:54:12
【问题描述】:
当我交叉编译时,我应该如何获得主机编译器(例如gcc,但它可能会有所不同):
./configure --host aarch64-suse-linux CROSS_COMPILE="aarch64-suse-linux-"
我在config.log 中获取变量:
build='x86_64-pc-linux-gnu'
build_cpu='x86_64'
但我无法从中获得类似$HOSTCC 的信息。
我知道当我省略 --build the default is --build=$(config.guess) 时。但无论是指定它还是使用默认值,它都无法帮助我找到编译器。
另外,autotools 中似乎没有支持:
- https://lists.gnu.org/archive/html/automake/2011-04/msg00017.html
- What is the sense of the word "host" in 'HOSTCC' and ./configure --host?
仅供参考,我需要它在LTP 中添加一些编译时帮助工具,它使用automake and autoconf,but otherwise have somehow custom build system,它不使用Makefile.am。因此像CC=$(CC_FOR_BUILD) 这样的东西不可用:(。
也许没有办法从$build 变量中检测到它(使用一些脚本),我必须要求用户定义它:
HOSTCC=${HOSTCC-cc}
【问题讨论】:
标签: cross-compiling autoconf automake toolchain