[Top][All Lists]

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

Building libs from convenience archives

From: Christian Cornelssen
Subject: Building libs from convenience archives
Date: Sat, 22 Mar 2003 01:49:37 +0100 (CET)


I have a real-world libtool problem with an already-released library.
To demonstrate the essence only, I have abstracted the problem to the

Consider the following Makefile.am fragment:

SUBDIRS = bar baz
lib_LTLIBRARIES = libfoo.la
libfoo_la_SOURCES = ...
libfoo_la_LIBADD = bar/libbar.la baz/libbaz.la
libfoo_la_LDFLAGS = -version-info ...

That is, libfoo.la contains bar/libbar.la and baz/libbaz.la,
each made in a separate subdir with about the following Makefile.am:

# libtool convenience library
noinst_LTLIBRARIES = libbar.la
libbar_la_SOURCES = ...

The problem: When building both static and dynamic versions, libtool
stores only the PIC objects into the convenience archives and then
uses these to build both the static and the dynamic variant of
libfoo.la.  Hence, subdir builds create non-PIC object files which
won't be used, and the static libfoo.a gets PIC objects, which should
not be.

Unfortunately, I do not see an easy workaround within the Automake
framework.  Moreover, I think that libtool should behave magically
here as it uses to do elsewhere.  That is, libtool should prepare and
use two archives for each convenience library, one for PICs and one
for non-PICs.



Christian Cornelssen

reply via email to

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