On Fri, Mar 24, 2000 at 03:59:50PM +0000, [EMAIL PROTECTED] wrote:
>
> > 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:
> [snip]
> > > 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.
>
> Hmm. If I understand this correctly, I don't think this is
> exactly what I want, either.
>
> I'm writing a plugin for an application which dlopen's its plugins
> when it starts up. The application author has made available a
> plugin library (static, but pic), which I link with my code to build
> the plugin. This works fine using gcc on linux, but I can't get
> libtool to do it. Can libtool do this?
Ah, okay I see what you mean now. And I'm afraid that the answer is
"sort of", because linking static libraries (albeit of pic objects) into
shared libraries is non-portable, do libtool can't really support it
reliably.
If the target architecture of your target machine supports `pass_all'
in dep_libs_check_method (like linux does) then it will work. But it
is still non-portable, which may be a consideration for you.
The portable (but complicated) way to it, is to have your make rules
extract the pic objects from the static archive with $AR, and link all
of those objects into your plugin. There is already code in libtool
that does something similar with convenience libraries (which are
after all static `ar' libraries of pic objects) if the host compiler
doesn't do --whole-archive, so you can probably start from there.
> I really appreciate your help in this, by the way.
You're welcome.
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