How should I get host compiler (e.g. gcc
, but it could be different) when I cross compile:
./configure --host aarch64-suse-linux CROSS_COMPILE="aarch64-suse-linux-"
I get variables in config.log
:
build='x86_64-pc-linux-gnu'
build_cpu='x86_64'
But I have no way to get something like $HOSTCC
from it.
I know that when I omit --build
the default is --build=$(config.guess)
. But regardless specifying it or use the default it does not help me to find the compiler.
Also it looks like there is no support in 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?
FYI I need it to add some compile-time helper tools in LTP, which uses automake and autoconf, but otherwise have somehow custom build system, which does not use Makefile.am
. Thus something like CC=$(CC_FOR_BUILD)
is not available :(.
Maybe there is no way to detect it from $build
variable (using some script) and I have to ask users to define it:
HOSTCC=${HOSTCC-cc}