[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Shared library location
From: |
Ralf Wildenhues |
Subject: |
Re: Shared library location |
Date: |
Sat, 6 Jun 2009 08:40:26 +0200 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
Hello Russell,
* Russell Shaw wrote on Fri, Jun 05, 2009 at 06:42:16PM CEST:
> In my code that isn't installed, i dlopen "my.so":
>
> ~/home/russ/myproj/src/libdir/my.so
>
> When i "make install", i want the dlopen to get my.so
> from a system location:
>
> /usr/lib/my.so
>
> What "make" variable can i utilize that has a value
> dependent on whether the package is installed or not?
Typically, projects that create modules use libtool to do so, and use
libtool --mode=execute -dlopen libdir/my.la ./program ...
to run an uninstalled program, while they use
program ...
to run an installed program. The former ensures that dlopening my.so
will find the uninstalled library.
Should you not use libtool, you could still use wrapper scripts for your
uninstalled programs to prefer uninstalled libraries, config files, etc.
The Automake package does this too, with the tests/address@hidden@
and tests/address@hidden@ wrappers.
Hope that helps.
Cheers,
Ralf