libtool
[Top][All Lists]
Advanced

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

Re: Convenience Libraries


From: Robert Boehne
Subject: Re: Convenience Libraries
Date: Tue, 04 Mar 2003 00:17:20 -0600

Bill Northcott wrote:
> 
> >> In general, Libtool won't prevent you from doing anything
> > that the linker can.  This works by passing flags through
> > Libtool with these flags:
> 
> Not really.  As has been discussed here before it will not let you produce
> a dynamic by linking static libraries, although this can be done with
> direct invocation of gcc or ld on MacOS X.

Bill,

I don't think you're correct about this.  I think if you were to
change this:
libtool --mode=link -rpath /usr/local -o libfoo.la foo.lo
/usr/local/lib/libstatic.a
to:
libtool --mode=link -rpath /usr/local -o libfoo.la foo.lo
-Wl,/usr/local/lib/libstatic.a
then Libtool would totally ignore "libstatic.a" and pass it on to the
linker.

> 
> > And another spot where convenience libraries are discussed:
> 
> Unfortunately that is the one and only spot where they are discussed and
> it does not say much.
> 
> Perhaps it would help, if I clarify what we are trying to do.
> 
> The Swarm project has a hierarchy of three levels of libraries:
> Basics like BLT, and libobjc
> Swarm modules which are subsets of the API.  These reference symbols in
> the basics and also each other.
> A swarm library which is the top of the hierarchy and uses symbols from
> all of the above.
> 
> Libtool appears to restrict options to an either or choice:
> Either: Build everything static in which case every symbol will be
> incorporated into every executable built against the top level library.
> OR: Build everything dynamic in which case everything has to be in the
> right place at the right times and a complex DYLD_LIBRARY_PATH set up to
> get the apps to run.  and you also get plagued with run time warning about
> not being able to find the build directories.  Might this last problem go
> away with --disable-fast-install?
> 
> What we would like to do is to build most of the lower level libraries
> static and link them into a single swarm dynamic library against which
> executables would be dynamically linked.  Libtool; appears to specifically
> rule this out.
> 
> Or can you explain how to do it?

In this case you would want to change the lower level libraries to
convenience libraries.  When Libtool then attempts to link the swarm
dynamic library, it would simply incorporate the ojbect files into
the dynamic library.  It's common practice to organize software by
bundling it up in archives, convenience libraries simply allow you to
do this portably.  If the user configures to build all-static, then
it will do the same, i.e. archive the same object files (swarm's + any
convenience lib's objects) into the swarm static archive.
If you're using Automake, use noinst_LTLIBRARIES to define which
libs are convenience libs.

HTH,

Robert




reply via email to

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