libtool
[Top][All Lists]
Advanced

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

Re: Dlopening documentation


From: Peter O'Gorman
Subject: Re: Dlopening documentation
Date: Tue, 09 Mar 2004 00:29:49 +0900
User-agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4

Gary V. Vaughan wrote:

The current libtool docs say:

@node Finding the dlname
@section Finding the correct name to dlopen
@cindex names of dynamic modules
@cindex dynamic modules, names

After a library has been linked with @samp{-module}, it can be dlopened.
Unfortunately, because of the variation in library names,
your package needs to determine the correct file to dlopen.

The most straightforward and flexible implementation is to determine the
name at runtime, by finding the installed @samp{.la} file, and searching
it for the following lines:

@example
# The name that we can @code{dlopen}.
dlname='@var{dlname}'
@end example

If @var{dlname} is empty, then the library cannot be dlopened.
Otherwise, it gives the dlname of the library.  So, if the library was
installed as @file{/usr/local/lib/libhello.la}, and the @var{dlname} was
@file{libhello.so.3}, then @file{/usr/local/lib/libhello.so.3} should be
dlopened.

If your program uses this approach, then it should search the
directories listed in the @address@hidden@code{LIBPATH}
on AIX, and @code{SHLIB_PATH} on HP-UX.} environment variable, as well as
the directory where libraries will eventually be installed.  Searching
this variable (or equivalent) will guarantee that your program can find
its dlopened modules, even before installation, provided you have linked
them using libtool.


I have a feeling that this is all done automatically by lt_dlopen.  If it
isn't then it should be...

Comments?

Last time I looked lt_dlopen did all of this.

It seems that we ought to recommend that "lib<name>.la" be the filename passed to lt_dlopen(), things probably work best in that case, but hey, you're the one with "author" in your .sig :)

Peter
--
Peter O'Gorman - http://www.pogma.com




reply via email to

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