This is the mail archive of the automake@gnu.org mailing list for the automake project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: automake and shared libraries


On 2003-07-29 17:52:32 +0000, Andrew Suffield wrote:
> On Tue, Jul 29, 2003 at 02:34:14PM +0200, Mattias Br?ndstr?m wrote:
> >    librkcone_LDADD = common/libcommon.a
> > 
> > is for some reason not a portable thing to do?
> 
> A static or convenience library is usually built without -fPIC, so
> it can't be included in a shared library.

I generally feel that if it's worth making it a separate entity you may
as well install it as a separate entity -- in this case I would do:

pkglib_LTLIBRARIES=common/libcommon.la
librkcone_LDADD=common/libcommon.la

Which will work everywhere (ish).  The problem with this approach is
that if someone not using libtool links against $(libdir)/librkcone.so
they will get undefined references to the symbols in
$(pkglibdir)/libcommon.so.  A solution to this is to force everyone to
use libtool/automake/autoconf, which I personally don't have a problem
with.

Note that some architectures allow the library dependency information to
be embedded in the shared library so this won't be a problem on these
systems provided libtool is smart enough to do it.

Regards,

Philip Willoughby

Systems Programmer, Department of Computing, Imperial College, London, UK
-- 
echo bzidd@nfo.ho.co.se | tr "bizndfohces" "pwgd9ociaku"
Why reinvent the wheel?                 Because we can make it rounder...



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]