RE: Why does ltconfig unset CC?

I just updated my CVS libtool to get your patch,
and it seems to be working just fine. I fixed
my configuration so that it uses CC_FOR_BUILD
and -no-undefined and things seem to work now.

% 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 CC_FOR_BUILD so that libtool
dnl     uses the compiler found by ./configure and we can cross.

export CC
if test "x$cross_compiling" = "xyes" ; then
  AC_CHECK_PROG(CC_FOR_BUILD, gcc, gcc, cc)
  export CC_FOR_BUILD
fi

AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL

AC_OUTPUT([Makefile])

% cat Makefile.am
lib_LTLIBRARIES = libfoo.la

libfoo_la_SOURCES = foo.c

libfoo_la_LDFLAGS = -no-undefined

% ../configure --host=i386-mingw32msvc
...
checking dependency style of i386-mingw32msvc-gcc... gcc
checking for gcc... gcc
checking build system type... i686-pc-linux-gnu
checking host system type... i386-pc-mingw32msvc
...
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
creating ./config.status
creating Makefile

% make install

% find /tmp/install/foo/
/tmp/install/foo/
/tmp/install/foo/lib
/tmp/install/foo/lib/libfoo.la
/tmp/install/foo/lib/libfoo.a
/tmp/install/foo/lib/libfoo-0-0-0.dll


Now I just need to figure out how to
make libtool name it "foo.dll" instead
of libfoo-0-0-0.dll.

thanks!
Mo DeJong
Red Hat Inc

Reply via email to