libtool
[Top][All Lists]
Advanced

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

Dlopening documentation


From: Gary V. Vaughan
Subject: Dlopening documentation
Date: Thu, 04 Mar 2004 18:29:16 +0000
User-agent: Mozilla Thunderbird 0.5 (X11/20040208)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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?

Cheers,
        Gary.
- --
Gary V. Vaughan      ())_.  address@hidden,gnu.org}
Research Scientist   ( '/   http://www.oranda.demon.co.uk
GNU Hacker           / )=   http://www.gnu.org/software/libtool
Technical Author   `(_~)_   http://sources.redhat.com/autobook
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFAR3V7FRMICSmD1gYRApgGAKCCjCTkoUnNNFAUWcWnasuSuV5emQCeNMJk
szxgxoSil/N4ZUWQQi6vebY=
=FzWl
-----END PGP SIGNATURE-----




reply via email to

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