automake
[Top][All Lists]
Advanced

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

building a shared library that depends on a static library


From: Jason Kraftcheck
Subject: building a shared library that depends on a static library
Date: Mon, 27 Feb 2006 19:42:34 -0600
User-agent: Debian Thunderbird 1.0.7 (X11/20051017)

Automake includes the contents of the $LIBS variable in all link commands,
including linking libraries.  This results in the following behavior:

1) If libtool is creating a static library, this seems to work fine.  The
libraries in $LIBS are listed as dependencies in the resulting .la file.

2) If libtool is creating a shared library, and all the libraries listed in
$LIBS are shared libraries, everything works correctly.  The libraries in $LIBS
are listed as dependencies in the resulting .la and .so files.

3) If libtool is creating a shared library, and one or more of the libraries in
$LIBS is static, behavior is *incorrect*.  libtool links the objects in the
static archives into the resulting shared library.  As static archives are
typically compiled w/out PIC, the result is a broken shared library.

How do I keep the behavior in 1) and 2), while changing the behavior for 3) such
that the static libraries in $LIBS are listed as dependencies in the .la file,
but not linked into the shared library?




reply via email to

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