automake
[Top][All Lists]
Advanced

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

Re: Automatic dependecy based compilation targets


From: Ralf Wildenhues
Subject: Re: Automatic dependecy based compilation targets
Date: Thu, 1 Feb 2007 18:40:28 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

Hello Mihai,

* Dizzy wrote on Thu, Feb 01, 2007 at 03:22:44PM CET:
> 
> I get multiple definitions errors at link time for libfinal.la and symbols in 
> libbar.la. Now I can workarround this by "knowing" that libbar.la "provides" 
> libfoo.la (as LIBADD) and I shouldn't list libfoo.la too in libfinal LIBADD. 
> But I don't want this because it assumes one has to go through all the 
> dependency tree (imagine many libfoo/libbar with a complex dependency tree) 
> to resolve the dependencies. One should just know that libfinal directly 
> needs libfoo and directly needs libbar (and if libbar also needs libfoo 
> that's a detail that should be taken care of transparently somehow).

Learn the conceptual differences of convenience archives vs. installable
libraries (static or shared), described in the Libtool manual.
Quote <http://www.gnu.org/software/libtool/manual.html#Static-libraries>:

|    As a rule of thumb, link a libtool convenience library into at most
| one libtool library, and never into a program, and link libtool static
| convenience libraries only into programs, and only if you need to carry
| library dependency information to the user of the static convenience
| library.

But be sure to read more than just that.  Get into the habit that
convenience archives are just a shorthand for "this set of object files"
whereas libraries are treated as entities whose contents nor whose name
as dependency are not to be duplicated (in the common case).

If you want your libfoo and libbar to not be convenience archives, but
installable libraries, then for the EXTRA* stuff I think you need to put
"-rpath $(libdir)" yourself in libfoo_la_LDFLAGS etc.

Hope that helps.

Cheers,
Ralf




reply via email to

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