DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH
 

(libtool14.info.gz) Finding the dlname

Info Catalog (libtool14.info.gz) Dlpreopening (libtool14.info.gz) Dlopened modules (libtool14.info.gz) Dlopen issues
 
 9.3 Finding the correct name to dlopen
 ======================================
 
 After a library has been linked with `-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 `.la' file, and searching
 it for the following lines:
 
      # The name that we can `dlopen'.
      dlname='DLNAME'
 
    If DLNAME is empty, then the library cannot be dlopened.  Otherwise,
 it gives the dlname of the library.  So, if the library was installed
 as `/usr/local/lib/libhello.la', and the DLNAME was `libhello.so.3',
 then `/usr/local/lib/libhello.so.3' should be dlopened.
 
    If your program uses this approach, then it should search the
 directories listed in the `LD_LIBRARY_PATH'(1) 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.
 
    ---------- Footnotes ----------
 
    (1) `LIBPATH' on AIX, and `SHLIB_PATH' on HP-UX.
 
Info Catalog (libtool14.info.gz) Dlpreopening (libtool14.info.gz) Dlopened modules (libtool14.info.gz) Dlopen issues
automatically generated byinfo2html