Bob Friesenhahn <bfrie...@simple.dallas.tx.us> writes:

> I think that it is wrong to solely blame libtool for this state of
> affairs.  In order for a project to work properly on non-ELF systems, or
> where installed shared libraries have abbreviated/truncated ELF implicit
> dependencies, or where static libraries are involved, the project needs
> to add all dependencies to LIBS during the configure run.

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

One interesting possible solution to this problem would be to eliminate
Libtool *.la files in favor of pkg-config or something similar, rather
than continuing to maintain two different mechanisms for doing largely the
same thing.

> I do agree that a tool can help solve these issues.  The linker itself
> is in the best position to know which library dependencies are really
> needed and to skip those which are not.

It turns out that this is harder than it looks.  --as-needed causes
obscure failures in places where the dependency really is needed although
the linker can't figure that out.

The pkg-config solution allows the maintainer of the library to declare
the necessary behavior for both cases: working transitive dependency
resolution, and situations where this cannot be relied upon.  The build
system then chooses based on the situation.

-- 
Russ Allbery (r...@stanford.edu)             <http://www.eyrie.org/~eagle/>

_______________________________________________
https://lists.gnu.org/mailman/listinfo/libtool

Reply via email to