[Top][All Lists]

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

Re: How to know the exact path of installed shared library?

From: Ralf Wildenhues
Subject: Re: How to know the exact path of installed shared library?
Date: Thu, 19 Jul 2007 23:03:36 +0200
User-agent: Mutt/1.5.13 (2006-08-11)

Hello Kent,

* Kent Boortz wrote on Thu, Jul 19, 2007 at 03:31:54AM CEST:
> For legacy reasons a ODBC driver is installed into "/usr/lib" or
> "/usr/local/lib" even if more to be considered a "plugin" than a
> normal shared library (i.e. it will be loaded with dlopen()).

I suppose at this point I should be promoting libltdl, and its
lt_dlopen/lt_dlopenext as portable dlopen wrappers, and its facilities
for search paths.

> Together with building and installing the driver, I also want to put
> the path of the installed driver into a script generated in the build.
> A script to register the driver with an ODBC manager. But the script
> needs to contain the path to the driver install location, including
> possible ".so", ".dylib", ".sl" or similar shared library extension.

Look at the generated .la file.  'libdir' contains the directory.
Either 'dlname', or, if empty, the last entry of 'library_names', is
the library name to open.  Look in libltdl/ltdl.c for details.  You may
have to do extra work on w32.

> I was thinking of something like in the make file
>           DRIVER_PATH=`libtool --print-shared-install-path`

A convenient interface such as you suggest does not exist, sorry.

Hope that helps.


reply via email to

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