[Top][All Lists]

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

Automake 1.5 linker selection

From: Christian Cornelssen
Subject: Automake 1.5 linker selection
Date: Mon, 26 Nov 2001 01:56:04 +0100 (CET)

Dear Automake maintainers,

consider my setup: A libtool library shall be built with stuff from
several subdirectories wherein the actual compilation takes place.
To simplify the dependency relations that cross directory boundaries,
every subdir gets its own "libtool convenience archive", and all those
archives are finally linked together to form the desired library.

The library sources are written in C++, but Automake does not see
that because the main library's `Makefile.am' contains no ..._SOURCES
entries for the library, just a ..._LIBADD variable listing the
convenience archives.

Consequently, Automake 1.5 defines

    LINK = $(LIBTOOL) --mode=link $(CCLD) ...
    CCLD = $(CC)

instead of using $(CXXLD) (or so) in the $(LIBTOOL) command, which
would be more appropriate.  Since I am using gcc/g++, this does not
matter much; gcc still does the right things (collecting construction
and destruction stuff for global variables etc).  However in general,
this can make a difference for truly distinct C and C++
compiler/linker drivers.

I suggest scanning `configure.ac' for "AC_LANG(language)" and to
respect the result when determining the linker settings.  Since
Automake favors the C++ linker if it encounters any C++ sources,
detecting "AC_LANG(C++)" in `configure.ac' should have a similar

[Sorry, no patch worked out yet.]


Christian Cornelssen

reply via email to

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