[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How does libtool and LD_LIBRARY_PATH affect the path for shared libs
From: |
Ralf Wildenhues |
Subject: |
Re: How does libtool and LD_LIBRARY_PATH affect the path for shared libs |
Date: |
Wed, 24 Sep 2008 08:03:07 +0200 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
Hello Jorge,
* Jorge Medina wrote on Wed, Sep 24, 2008 at 12:51:36AM CEST:
>
> I have been trying to build and create a package (rpm) of Apache.
> (2.2.8) for a RedHat 5 Enterprise Linux (64-bit); but using my own
> version of APR and APR-utils instead of the versions shipped with
> Apache.
AFAIR the apr tools apply some changes to their libtool. I have no
idea whether they have any relevance here.
> I am trying to ship a package the compiled version and that would
> install somewhere like:
> <installation directory>
> |- apr
> | |- lib
> |- apr-util
> | |- lib
> \- apache
>
> But the installation directory may or may not be different that that
> used during compile and install time in the machine where all components
> were built.
That is at least somewhat of a problem.
> I have been trying to tell the Apache process, httpd, to use the
> libraries in <installation_directory>/apr/lib and
> <installation_directory>/apr-util/lib using the LD_LIBRARY_PATH
> variable, but the process keeps loading existing versions of the
> libraries in the target machine under /usr/lib64 (I used the command
> 'ldd httpd' and 'httpd -V')
Does it have run paths to /usr/lib64 set? That would be a bug
(use 'objdump -p' to find out).
> For the apr-util library, the httpd process seems to look first in
> the directory where the libraries were installed with "make install".
> But for the apr library the httpd process seems to always look in
> /usr/lib64.
Does the httpd depend upon the library (i.e., is there a DT_NEEDED
entry for the library soname in the program) or does it dlopen it?
> So, I was wondering if this is something that can be fixed with
> libtool or ldconfig.
Not sure yet what could help, at least not after the fact. Maybe
hacking around in the binaries (with objcopy).
> Do I need to run the libtool included in the apr/build-1 directory?
> Something like:
> libtool --mode=finish <installation_directory>/apr-util/lib
> <installation_directory>/apr/lib
No, typically that doesn't affect this situation.
> Running libtool --config shows:
> # Is shlibpath searched before the hard-coded library
> search path?
> shlibpath_overrides_runpath=no
>
> Does it imply that I can't use LD_LIBARY_PATH to specify the path
> to the libraries?
It means that run paths will be tried before LD_LIBRARY_PATH.
> I am confused. I want to distribute binaries -as opposed to
> including the source code in the rpm- and be able to run Apache no
> matter where the installation directory selected when installing the
> package. I am including most required libraries with my package.
Relocatable binary distribution isn't easy (and of course isn't
portable). The gnulib package has a couple of relocatable modules
to help, but that will be a bit of work for you to use (and you might
not like the shell wrapper concept).
Cheers,
Ralf