[ILUG] TOTD: ld's rpath option...
paul at clubi.ie
Wed Dec 8 16:57:34 GMT 2004
Handy tip if you want to install a shared library to a strange
location but want your application to be able to find it without fuss
(ie without having to add $strange_location to /etc/ld.so.conf): use
the -rpath option of ld to specify an absolute path to the library or
the directory it is located in, eg -rpath /usr/lib64/strange_dir.
This'd result in:
# ldd app | grep strange_location
libwhatever.so.0 => /usr/lib64/strange_dir/libwhatever.so.0 (0x0000003c1c400000)
This might be useful in order to avoid cluttering a standard lib
directory even further, or for shipping your own version of a common
library (though, what happens in latter case if system /also/ has
that library, i dont know).
Paul Jakma paul at clubi.ie paul at jakma.org Key ID: 64A2FF6A
He who spends a storm beneath a tree, takes life with a grain of TNT.
More information about the ILUG