On 9 Jul 2000, Alexandre Oliva wrote:
> On Jul 9, 2000, Mo DeJong <[EMAIL PROTECTED]> wrote:
>
> > On 9 Jul 2000, Alexandre Oliva wrote:
> >> On Jul 9, 2000, Mo DeJong <[EMAIL PROTECTED]> wrote:
> >>
> >> > I am trying to understand how libtool configures itself and
> >> > I just can not figure out why ltconfig unsets CC.
> >>
> >> This may happen in the second step, when it's looking for a C++ or GCJ
> >> compiler, in case your configure.in mentions CXX or GCJ.
>
> > If it is looking for g++ or gcj, then why does it end up with cc?
>
> No idea. Never happened to me. Can you post a simple configure.in
> file that triggers the problem?
Here is the most trimmed down example I could come up with.
A single .la library is created from a foo.c file. I have
also attached a .tar file with all the needed files.
% cat configure.in
AC_INIT(foo.c)
AM_INIT_AUTOMAKE(foo, 0.1)
AM_MAINTAINER_MODE
AC_LANG_C
AC_PROG_CC
dnl This is a hack to work around a bug in autoconf/libtool
dnl We need to export CC and HOST_CC so that libtool
dnl uses the compiler found by ./configure and we can cross.
export CC
if test "x$cross_compiling" = "xyes" ; then
if test "$GCC" = yes ; then
HOST_CC=gcc
else
HOST_CC=cc
fi
export HOST_CC
fi
AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL
AC_OUTPUT([Makefile])
% cat Makefile.am
lib_LTLIBRARIES = libfoo.la
libfoo_la_SOURCES = foo.c
% ./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 whether to enable maintainer-specific portions of Makefiles... no
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 whether i386-mingw32msvc-gcc accepts -g... yes
checking for Cygwin environment... no
checking for mingw32 environment... yes
checking for EMX OS/2 environment... no
checking for executable suffix... .exe
checking for object suffix... o
checking how to run the C preprocessor... i386-mingw32msvc-gcc -E
checking dependency style of i386-mingw32msvc-gcc... gcc
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 /usr/local/project/install/Xmingwin/i386-mingw32msvc/bin/ld
option to reload object files... -r
checking for BSD-compatible nm...
/usr/local/project/install/Xmingwin/bin/i386-mingw32msvc-nm -B
checking whether ln -s works... yes
checking how to recognise dependant libraries... file_magic file format
pei*-i386(.*architecture: i386)?
checking for i386-mingw32msvc-ranlib... i386-mingw32msvc-ranlib
checking for i386-mingw32msvc-strip... i386-mingw32msvc-strip
checking for i386-mingw32msvc-dlltool... i386-mingw32msvc-dlltool
checking for i386-mingw32msvc-as... i386-mingw32msvc-as
checking for i386-mingw32msvc-objdump... i386-mingw32msvc-objdump
checking if libtool should supply DllMain function... no
checking how to link DLLs... -mdll
loading cache /dev/null within ltconfig
checking for objdir... .libs
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 i386-mingw32msvc-gcc static flag -static works... yes
checking if i386-mingw32msvc-gcc supports -c -o file.o... yes
checking if i386-mingw32msvc-gcc supports -fno-rtti -fno-exceptions ... yes
checking whether the linker
(/usr/local/project/install/Xmingwin/i386-mingw32msvc/bin/ld) supports
shared libraries... yes
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking dynamic linker characteristics... Win32 ld.exe
checking command to parse
/usr/local/project/install/Xmingwin/bin/i386-mingw32msvc-nm -B output... ok
checking if libtool supports shared libraries... yes
checking if package supports dlls... yes
checking whether to build shared libraries... yes
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
checking for objdir... .libs
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
checking if we can lock with hard links... yes
checking if cc supports -fno-rtti -fno-exceptions ... no
checking whether the linker (ld) supports shared libraries... yes
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking dynamic linker characteristics... Win32 ld.exe
checking command to parse
/usr/local/project/install/Xmingwin/bin/i386-mingw32msvc-nm -B output...
failed
checking if libtool supports shared libraries... no
checking whether to build shared libraries... no
checking whether to build static libraries... yes
appending configuration tag "GCJ" to libtool
creating ./config.status
creating Makefile
( Note how the first tests passed, so dlls were
going to get built, but because the second set
of tests failed, only static gets built )
% make
source='foo.c' object='foo.lo' libtool=yes \
depfile='.deps/foo.Plo' tmpdepfile='.deps/foo.TPlo' \
depmode=gcc /bin/sh ./depcomp \
/bin/sh ./libtool --mode=compile i386-mingw32msvc-gcc -DPACKAGE=\"foo\"
-DVERSION=\"0.1\" -I. -I. -g -O2 -c -o foo.lo `test -f foo.c || echo
'./'`foo.c
mkdir .libs
i386-mingw32msvc-gcc -DPACKAGE=\"foo\" -DVERSION=\"0.1\" -I. -I. -g -O2
-c foo.c -Wp,-MD,.deps/foo.TPlo -DDLL_EXPORT -DPIC -o .libs/foo.o
i386-mingw32msvc-gcc -DPACKAGE=\"foo\" -DVERSION=\"0.1\" -I. -I. -g -O2
-c foo.c -Wp,-MD,.deps/foo.TPlo -o foo.o >/dev/null 2>&1
/bin/sh ./libtool --mode=link i386-mingw32msvc-gcc -g -O2 -o libfoo.la
-rpath /usr/local/lib foo.lo
libtool: link: warning: undefined symbols not allowed in
i386-pc-mingw32msvc shared libraries
ar cru .libs/libfoo.a foo.o
creating libfoo.la
(cd .libs && rm -f libfoo.la && ln -s ../libfoo.la libfoo.la)
( This is what actually gets installed )
/tmp/foo/lib/libfoo.la
/tmp/foo/lib/libfoo.a
Mo DeJong
Red Hat Inc
cross_libtool.tgz