[Top][All Lists]

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

dynamic selection of linker

From: Daily, Jeff A
Subject: dynamic selection of linker
Date: Wed, 27 Jan 2010 09:53:05 -0800

I am familiar with the automake documentation section How the Linker is Chosen 
as well as the nodist_EXTRA_..._SOURCES trick described in the Libtool 
Convenience Libraries section.  I'm using the bleeding edge releases of 
autoconf, automake, and libtool (2.65, 1.11.1, 2.2.6b).

We have a mixed Fortran77/C/C++ library.  The Fortran code within our library 
is compiled by default, but we would like to make this optional.  Our strategy 
has been to use the Fortran linker almost exclusively (forced by the 
nodist_EXTRA_SOURCES trick) since we have some convenience libraries that are 
pure C (and tested by C and/or C/Fortran mixed binaries) while other 
convenience libraries are mixed from the start.  All convenience libraries get 
rolled up into our final single library.

The  documented automake behavior states that automake chooses the linker based 
on a static list of source files.  This is not sufficient.  I'm hoping I've 
missed a detail somewhere, but my experience backs up the documented claims.  
I've tried using AM_CONDITIONALs like so:

MAYBE_DUMMY_F_LINK = dummy.f # does not exist

libtest_la_SOURCES = # no sources, all convenience libraries
nodist_EXTRA_libtest_la_SOURCES = $(MAYBE_DUMMY_F_LINK)
libtest_la_LIBADD = mixed/ pure_c/

But regardless of whether NOFORT is true, the Fortran linker is always chosen.  
What should I be doing?  Thanks.

Jeff Daily
Pacific Northwest National Laboratory

reply via email to

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