[Top][All Lists]

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

Forcing the linking language

From: Norman Gray
Subject: Forcing the linking language
Date: Fri, 15 Oct 2004 22:19:21 +0100


Is there any way of indicating to automake which language to use when linking a library?

I'm assembling a (shared) library using convenience libraries:

libfoo_la_SOURCES =
libfoo_la_LIBADD = stuff/

Now, is a convenience library of objects built from _Fortran_ sources. This means that the libfoo shared library should be assembled using the F77 or FC languages (this matters on OSX: this situation requires libtool's Fortran magic, since the OSX linker has a big downer on common blocks, and needs to be told to chill out a bit).

However automake doesn't know this, so it tries to use gcc to link the library, which fails. Is there any way of giving it a hint, here?

Using libfoo_la_LINK isn't the solution, since that would require me to copy the long LIBTOOL definition that automake generates (which I oughtn't to have to know about); manually adding --tag=F77 to the libtool line works, but there's no way of inserting that from within without redefining LIBTOOL (again using internals). There's no mechanism that seems obvious from, though I confess I have only a fairly sketchy idea of how it is that handle_single_transform_list (yes?) determines the language to use for the link.

I've managed to get this to work by setting

libfoo_la_SOURCES = dummy.f

where dummy.f is a trivial Fortran routine. That tells automake that Fortran is involved somewhere, and it consequently does The Right Thing. But this seems like a bit of a hack.

There's nothing leaps out from the list archives. Does anyone have any advice?

Best wishes,


Norman Gray  :  Physics & Astronomy, Glasgow University, UK  :

Norman Gray  :  Physics & Astronomy, Glasgow University, UK  :

reply via email to

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