I just ran into an error when using the --host=XTRIPLE argument.
I am trying to cross compile with libtool, and it is really
broken to say the least. I tried to work around it by
setting CC to my cross compiler before running ./configure.
setenv CC i386-mingw32msvc-gcc
./configure --host=i386-mingw32msvc
configure: WARNING: If you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used.
checking for a BSD compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for mawk... no
checking for gawk... gawk
checking whether make sets ${MAKE}... yes
checking build system type... /home/mo/project/tkgs/config.guess:
./dummy-4106:
cannot execute binary file
configure: error: cannot guess build type; you must specify one
So config.guess is getting messed up because it is trying
to use my cross compiler to figure out the build system
type.
I took a peek at the config.guess and found this.
# Use $HOST_CC if defined. $CC may point to a cross-compiler
if test x"$CC_FOR_BUILD" = x; then
if test x"$HOST_CC" != x; then
CC_FOR_BUILD="$HOST_CC"
else
if test x"$CC" != x; then
CC_FOR_BUILD="$CC"
else
CC_FOR_BUILD=cc
fi
fi
fi
I think this variable should be changed to BUILD_CC not HOST_CC,
that would match the --build --host changes we made to autoconf.
At any rate, I set that variable and it seemed to work ok. We
could always leave an extra check for HOST_CC in for backwards
compatibilty.
setenv HOST_CC gcc
./configure --host=i386-mingw32msvc
configure: WARNING: If you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used.
checking for a BSD compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for mawk... no
checking for gawk... gawk
checking whether make sets ${MAKE}... yes
checking build system type... i686-pc-linux-gnu
checking host system type... i386-pc-mingw32msvc
checking how to run the C preprocessor... i386-mingw32msvc-gcc -E
checking for i386-mingw32msvc-gcc... i386-mingw32msvc-gcc
checking whether the C compiler works... yes
...
My real question is, why do I need to do this? If autoconf
knows that it is cross compiling then it should know to
set the HOST_CC (or BUILD_CC) to gcc or cc.
Mo DeJong
Red Hat Inc