libtool
[Top][All Lists]
Advanced

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

Re: Moving Installed Libraries built with libtool


From: Benoit Sigoure
Subject: Re: Moving Installed Libraries built with libtool
Date: Tue, 4 Dec 2007 08:39:42 +0100

On Nov 29, 2007, at 12:16 PM, Christophe Eymard wrote:

Hello list,

[...]

GStreamer installs by default a bunch of libraries in $PREFIX/lib, but
it uses lots of other libraries in $PREFIX/lib/gstreamer-0.10, which are
_not_ in the LD_LIBRARY_PATH. I assume there that this is some libtool
magic that does all the dirty work by hardcoding some paths.

Here is the thing; I would like to move my installation while keeping
the magic ! Basically, I just want to change the prefix. Is there anyway I could do that using libtool ? Or is there any other tool I could use ?


Libtool probably uses RPATHs on your platform to tell the linker where are the shared libraries, so you don't have to fiddle with LD_LIBRARY_PATH and friends. AFAIK, you can't trivially change them, so the binaries aren't relocatable (unless you still have the .o in which case you can re-./configure with a different --prefix, remove all the *.la files and do a `make all install' to let libtool re-link everything and install your package for another prefix without having to go through a complete re-compilation).

There are some tools out there that patch the ELF binaries to achieve this without having to go through the relinking stuff, but that's not portable. Moreover, some (most?) of these tools seem to require you to add extra bytes ('\0') in the RPATH fields (otherwise you can't relocate the stuff in a $prefix that contains more characters than the original one). I don't know how they achieve this, however.

And even if you succeed with this method, you must also patch all the .la files so that they reference the new prefix. And you must also make sure your application wasn't compiled with hard-coded absolute paths (e.g. -DPKGDATADIR="/path/to/prefix").

So yeah it's a bit of an issue, I guess people often come up with wrapper scripts that set the right LD_LIBRARY_PATH and then exec the binary but that's not always a viable solution.

--
Benoit Sigoure aka Tsuna
EPITA Research and Development Laboratory






reply via email to

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