[Top][All Lists]

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

Re: dependency_libs?

From: Russ Allbery
Subject: Re: dependency_libs?
Date: Sun, 30 Apr 2006 11:52:16 -0700
User-agent: Gnus/5.110004 (No Gnus v0.4) XEmacs/21.4.18 (linux)

Andreas Volz <address@hidden> writes:

> I build my library with GNU autotools and link to it with the pkg-config
> --uninstalled option without installing it. In this case a la-file
> ( is created. I've some problems to understand how libtool
> generated the dependency_libs field. In my package is a
> --with-x/--without-x option from AC_PATH_X.  But the la-file has the X
> libraries in its dependency_libs field. So how does libtool generate
> this field?

Well, you say that the correct field is:

> # Libraries that this one depends upon.
> dependency_libs=' /home/andreas/src/MakeHuman/cvs/animorph/src/
> -l glut -lGLU -lGL -lpng 

I expect that one of glut, GLU, and GL depend on the X libraries, and
hence when libtool resolves transitive dependencies through the .la files,
it pulls in the other libraries.

This is one of the problems with .la files currently.  It doesn't have the
correct semantics to distinguish between static builds (and builds on
platforms with deficient shared library handling) where all transitive
dependencies have to be pulled into the link line and shared builds on
modern platforms where transitive dependencies do not have to be pulled in
and in fact generally *shouldn't* since they make library migrations

pkg-config does have this logic and some packages have started not
installing libtool .la files and recommending that people just use
pkg-config to get the right link lines to avoid this.  That being said,
the addition of extra dependencies is generally only a problem if you're
building OS packages and have to be careful about adding too many
dependencies.  If you're just building software for local use, it doesn't
really matter.

Russ Allbery (address@hidden)             <>

reply via email to

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