[email protected] wrote:
> Mike wrote:
>> making the code use reduced library sets for only linux targets is fine by
>> me.
>> libtool already has plenty of target-specific code based on the quality of
>> library handling.
>
>
> I think the scope of the problem is more devious than you imagine.
>
> Example:
> - install libA to /odd/lib/libA.so
> - configure libB with /odd/lib/libA.so
> - install libB to /odd/usr/lib/libB.so
> - configure App with libB in /odd/usr/lib/libB.so
> - compilation of App fails since the linker can't find libA.so
>
> Libtool's dependency lists would have told the linker where libA was
> installed. Many people follow this sort of pattern on shared filesystems.
rpath tells that as well, and libtool adds it automatically when
installing to a non-standard path. I tested the above:
$ cd malaga-7.12
$ ./configure --prefix=/home/anssi/odd --libdir=/home/anssi/odd/lib
$ make && make install
$ sed -i "s,^dependency_libs=.*$,dependency_libs=''," \
/home/anssi/odd/lib/libmalaga.la
$ cd ../libvoikko-2.0
$ ./configure --prefix=/home/anssi/odd/usr \
--libdir=/home/anssi/odd/usr/lib LDFLAGS=-L/home/anssi/odd/lib \
CPPFLAGS=-I/home/anssi/odd/include
$ make && make install
$ sed -i "s,^dependency_libs=.*$,dependency_libs=''," \
/home/anssi/odd/usr/lib/libvoikko.la
$ cd ../tmispell-voikko-0.7.1
$ ./configure --prefix=/home/anssi/odd/usr \
--libdir=/home/anssi/odd/usr/lib \
LDFLAGS=-L/home/anssi/odd/usr/lib \
CPPFLAGS=-I/home/anssi/odd/usr/include
$ make && make install
Compilation worked fine. The program also works correctly:
$ /home/anssi/odd/usr/bin/tmispell --help | head -n1
Usage: tmispell-voikko [options] [file]...
This is because libtool automatically sets the RPATH correctly in the
binary and the libraries:
$ objdump -p /home/anssi/odd/usr/bin/tmispell | grep -e voikko -e RPATH
NEEDED libvoikko.so.1
RPATH /home/anssi/odd/usr/lib
$ objdump -p /home/anssi/odd/usr/lib/libvoikko.so.1 | grep -e malaga -e
RPATH
NEEDED libmalaga.so.7
RPATH /home/anssi/odd/lib
--
Anssi Hannula
_______________________________________________
http://lists.gnu.org/mailman/listinfo/libtool