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?