Stephan, thanks for your reply!

I have tried your suggestion (installing a plain shared
library instead of a convenience library), and basically
it works, but this has (seems to have) some disdavantages.
One problem is that the shared library that the user builds
as a Tcl extension (and which then depends on my installed
shared library) should be self-contained: it should not
have references to external symbols --
but it is (turned out to be) possible to link (a reference to)
my installed plain shared library in a users shared library.

However:
 1) I'm a bit afraid that this is not supported everywhere
    (I think the libtool documentation says this somewhere).

 2) In order to find my installed plain shared library (say A),
    the user who wants to build and use a 'self-contained'
    shared library (say B) that depends on A, probably will
    (may) have to set LD_LIBRARY_PATH or something similar,
    (maybe the name of the variable to set even differs from
     platform to platform?), which is not so nice --
    I know how to 'put' the path to shared lib A in a program
    P while linking P, but I got the impression that it is not
    possible to 'put' the path to shared lib A in a another
    shared lib B that depends on A, while linking B.

This is why I had the impression that things would be easier
if I (can) put my code in a convenience library (or just use
ld -r to put all code in a single object file?) that is
installed somewhere, and then gets included (linked in) the
shared library that the user builds.
However, wrt this solution I have the impression that
the current version of automake does not support having
object files as a target to build and install...
(I won't mind being told I'm wrong here :-)

(Sorry for the length of this message...)

Regards,
Axel.

Stephan Kulow wrote:
> Axel Belinfante wrote:
> > 
> > (I'm currently not subscribed to the libtool mailing list; if you reply,
> >  please send it not only to the list but also directly to me)
> > 
> > Hello,
> > I have a question for which I could not found the answer on this list
> > nor on the automake list.
> > 
> > What I'm looking for is the following: For my application to work,
> > my end-users will have to build a shared library (a 'plugin' for Tcl).
> > This shared library will contain code specifically written by the
> > end-user (code that depends on his/her needs), and some general code
> > that I supply. So, I am looking for a way to install my code as
> > a partially build library (libtool convenience library?) that the
> > end-users can link together with their own code to build their plugin.
> > 
> > I'm lazy :-) and using autoconf, automake, and since recently, libtool.
> > I succeeded to build a libtool convenience library in one directory
> > using an automake noinst_LTLIBRARIES line, and then use this library
> > in another directory by explictly refering to it, as suggested
> > in the libtool documentation. This works perfectly!
> > However, how can I now _install_ the convenience library?
> > Or should I use a completely different approach to solve my problem?
> 
> Why not install a plain shared library (lib_LTLIBRARIES)? This would
> solve your problem at least on all platforms supporting native inter-
> library dependencies. 
> Even installing the convenience library (which you could do over a
> install-exec-local target for example) would add the drawback that
> your users would have to use libtool

Reply via email to