On Thu, Mar 23, 2000 at 09:12:54PM -0500, Jason Day wrote:
> On Fri, Mar 24, 2000 at 12:43:24AM +0000, Gary V. Vaughan wrote:
> > On Thu, Mar 23, 2000 at 05:38:35PM -0500, Jason Day wrote:
> > > So I tried building a shared version of the static library, and libtool gave
> > > me a shared library, but with a dependency I didn't want. Is there a way to
> > > link an object file and a (PIC) static library into a self-contained shared
> > > library?
> >
> > You want the pic objects in the static lib to be added to the shared
> > lib right?
>
> Yes, that's right.
>
> >
> > If you are building the PIC-static lib yourself, then create it as
> > libtool convenience library and link *that* into the shared lib that
> > depends on it.
>
> Do you mean to link with the .la file, instead of using -l?
Yes. Provided that the static library was built as a convenience
library -- i.e. using noinst_LTLIBRARIES primary in automake.
> Can I do this after the library has been installed?
No. Nor does it make sense to be able to really. If you want to
install the static library, then don't create it as a convenience
library, just as a standard `ar/ranlib' archive:
lib_LTLIBRARIES = libnotconvenience.la
libnotconvenience_la_LDFLAGS = -static
Once this is installed, you can link the shared library with the
installed .la file, but the objects won't be added to the shared lib,
the shared.la will record the dependency so that when you later come
to link an application with shared.la, you don't list
libnotconvenience.la on the application link line, libtool will add it
automatically, and the objects will be added (statically) to the
applicatioon.
Ofcourse you will need libtool-1.3b or better for this to work =)O|
Cheers,
Gary.
--
___ _ ___ __ _ mailto:[EMAIL PROTECTED]
/ __|__ _ _ ___ _| | / / | / /_ _ _ _ __ _| |_ __ _ ___ [EMAIL PROTECTED]
| (_ / _` | '_|// / |/ /| |/ / _` | || / _` | ' \/ _` | _ \
\___\__,_|_|\_, /|___(_)___/\__,_|\_,_\__, |_||_\__,_|//_/
home page: /___/ /___/ gpg public key:
http://www.oranda.demon.co.uk http://www.oranda.demon.co.uk/key.asc