I am trying to understand how libtool configures itself and
I just can not figure out why ltconfig unsets CC. It seems
the checks get run twice. The first time with CC that was
set when ltconfig was invoked and the second time with
plain old cc. This does not work when there is no cc
program (Cygwin) or if you are cross compiling.
Here is some output from the ./configure of a program
I am trying to cross compile with libtool. It compiles
for the native ok (I think this is just pure luck),
but it will not cross compile correctly. I am using
the CVS version of autoconf, the CVS version of
automake, and the CVS (ML branch) verison of libtool.
% ./configure --host=i386-mingw32msvc
...
checking for i386-mingw32msvc-gcc... i386-mingw32msvc-gcc
checking whether the C compiler works... yes
checking whether we are cross compiling... yes
checking whether we are using GNU C... yes
...
checking for Cygwin environment... no
checking for mingw32 environment... yes
...
checking build system type... i686-pc-linux-gnu
checking host system type... i386-pc-mingw32msvc
checking for ld used by GCC...
/usr/local/project/install/Xmingwin/i386-mingw32msvc/bin/ld
checking if the linker
(/usr/local/project/install/Xmingwin/i386-mingw32msvc/bin/ld) is GNU ld... yes
...
checking for i386-mingw32msvc-ranlib... i386-mingw32msvc-ranlib
checking for i386-mingw32msvc-strip... i386-mingw32msvc-strip
loading cache /dev/null within ltconfig
(!! NOTE, I added the LTCHECK and LTCC echo statements !!)
LTCHECK 636 CC is "i386-mingw32msvc-gcc"
checking for objdir... .libs
LTCC "i386-mingw32msvc-gcc"
checking for i386-mingw32msvc-gcc option to produce PIC... -DDLL_EXPORT -DPIC
checking if i386-mingw32msvc-gcc PIC flag -DDLL_EXPORT -DPIC works... yes
...
checking if libtool supports shared libraries... yes
checking if package supports dlls... no
checking whether to build shared libraries... no
checking whether to build static libraries... yes
creating libtool
updating cache /dev/null
loading cache /dev/null within ltconfig
checking host system type... i386-pc-mingw32msvc
checking build system type... i686-pc-linux-gnu
LTCHECK 636 CC is ""
checking for objdir... .libs
LTCC "i386-mingw32msvc-gcc"
checking for cc option to produce PIC... -DDLL_EXPORT
checking if cc PIC flag -DDLL_EXPORT works... no
checking if cc static flag -static works... no
checking if cc supports -c -o file.o... no
...
Does anyone know what is going on here? Why does
libtool run this stuff twice? Why does it unset
CC and why does it not use LTCC (which seems to
have the value I passed in for CC for both runs).
thanks
Mo DeJong
Red Hat Inc