bug-libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Libtool's autoconf macros with languages other than C


From: Christian Cornelssen
Subject: Libtool's autoconf macros with languages other than C
Date: Sun, 4 Nov 2001 08:24:06 +0100 (CET)

Dear Libtool maintainers,

thanks for libtool.  I am using v1.4.2 for making a shared version
of a C++ library, and I wondered why libtools configure routines
detected that g++ would not support "-c -o".

I have tracked the bug down to the fact that most of libtool's
autoconf macros use $ac_compile with modified $CFLAGS. But I have
AC_LANG(C++), so $ac_compile contains `$CXXFLAGS' instead of
`$CFLAGS'.

As a workaround, I have produced a wrapper macro in my `acinclude.m4'
that tests if $ac_compile contains `$CLAGS '. If not, it adds
`$CFLAGS ' behind the last `FLAGS ' occurence to $ac_compile, and
resets CFLAGS to the empty string.  Once the libtool macros have done
their work, ac_compile and CFLAGS are restored.

I suggest using a similar wrapper in AC_LIBTOOL_SETUP that adds
something like `$lt_FLAGS ' to ac_compile and does its testing by
varying values of that lt_CFLAGS variable.  This can even simplify
the libtool macros, because saving and restoring CFLAGS is no longer
necessary.  Of course, at the end of AC_LIBTOOL_SETUP, ac_compile
must get restored.

I have not worked out a decent patch, but I have attached the relevant
fragment of my `acinclude.m4', so that you can see how I have modified
ac_compile.

Sincerely,

Christian Cornelssen

Attachment: libtool-bug-workaround.m4
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]