libtool
[Top][All Lists]
Advanced

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

Re: Several questions about libtool


From: Russ Allbery
Subject: Re: Several questions about libtool
Date: Sat, 07 Jan 2012 16:35:33 -0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux)

Bob Friesenhahn <address@hidden> writes:
> On Sat, 7 Jan 2012, Russ Allbery wrote:

>> pkg-config is an excellent example of an alternative way of handling
>> this that does not have this problem, and it includes Autoconf support.

> What do you mean by "it includes Autoconf support".  Do you mean that it
> provides an Autoconf macro which makes pkg-config easier to use?

Yes.

> Regardless, Autoconf's configure will still make subsequent decisions
> based on trial and error (by running the compiler and linker).

Do you mean for detecting other libraries?  Only for libraries without
pkg-config support.  You of course can't solve the whole problem
overnight, but there's quite a bit of movement towards pkg-config support
already, including in a bunch of low-level libraries that lots of things
use.

Subsequent probes that need to link with the library can use the shell
variables set by pkg-config.

> They may seem like they do the same thing but perhaps they do 20-30% of
> the same thing (e.g. dependency info).  The .la files used in the build
> tree are very much needed since it is unlikely that builds will work at
> all without them (and libtool needs them).

I didn't say that pkg-config and Libtool did the same thing.  I said that
pkg-config configuration files and Libtool *.la files do largely the same
thing, namely store metadata about libraries.  pkg-config configuration
files are simple key-value structures, and the additional information that
Libtool needs to do the correct thing inside the build tree would not be
difficult to represent in that format so far as I can tell.  In fact, I
think pkg-config would benefit from tracking some of the additional
information that Libtool *.la files track.

Or one can of course just add the same separation of dependency
information to the Libtool *.la file format.  It just seems unnecessary to
have two file formats for doing the same thing, and the pkg-config file
format is somewhat nicer.  But this is all implementation details; I don't
really care which way the information is represented.

> Pkg-config is optional software which only really works when it is
> properly cared for and fed correctly.

The same is true of Libtool.  :)

> The obvious "solution" is that there should be a mode in which libtool
> does not apply any ".la" dependency libraries from an installed .la file
> unless they are known to be static libraries, or static libraries are
> otherwise involved.

I don't think you can just drop all dependencies for shared libraries,
because some shared libraries do want the client to link with a dependent
library for various complicated reasons.  GTK+ and GDK are the most
frequently cited example.

My impression is that you don't want to try to do this with magic, because
the magic will occasionally be wrong.  That's the advantage of the
pkg-config method.  It lets the library maintainer, who actually knows
what's going on, specify the desired behavior.

-- 
Russ Allbery (address@hidden)             <http://www.eyrie.org/~eagle/>



reply via email to

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