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: if NOFORT else MAYBE_DUMMY_F_LINK = dummy.f # does not exist endif lib_LTLIBRARIES = libtest.la libtest_la_SOURCES = # no sources, all convenience libraries nodist_EXTRA_libtest_la_SOURCES = $(MAYBE_DUMMY_F_LINK) libtest_la_LIBADD = mixed/libmixed.la pure_c/libpurec.la But regardless of whether NOFORT is true, the Fortran linker is always chosen. What should I be doing? Thanks. __________________________________________________ Jeff Daily Scientist Pacific Northwest National Laboratory
