[Top][All Lists]

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

Re: Forcing the linking language

From: Ralf Wildenhues
Subject: Re: Forcing the linking language
Date: Mon, 18 Oct 2004 14:17:20 +0200
User-agent: Mutt/1.4.1i

* Norman Gray wrote on Fri, Oct 15, 2004 at 11:19:21PM CEST:
> 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?

Well.  Imagine the following: Your is not built by
you, it's rather the implementation of a published interface, so in
general you cannot know which language it actually consists of.
Neither can Automake.  Libtool, however, could (and should, IMHO)
store such information in the installed .la file.  But it does not
do that right now, AFAICS.  And it's not as simple as it seems in
the first place:  The compiler set you use could be different from
the one with which the dso was compiled. 

Obviously, this argument does not hold for convenience libraries.
But then again, I'd suggest you drop your convenience library and
use subdir-objects (with a recent Automake).  Problem solved (apart
from any subdir-object related Libtool bugs).

> 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.

I think that is by far the easiest way to achieve what you want.


reply via email to

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