2004.10.24 07:37 "[Tiff] [request] add --rpath for jpeg and zlib", by Norihiko Murase
I tried building tiff-3.7.0 under the following environment:
CPU: i386 family
OS: FreeBSD 4.8-RELEASE
Compiler: gcc-2.95.4 (/usr/bin/gcc)
However, the built tools (such as tiffsplit) load the shared libraries jpeg and zlib INCORRECTLY!
% ldd tiff-3.7.0/tools/.libs/tiffsplit
libtiff.so.3 => /usr/local/tiff/lib/libtiff.so.3 (0x28067000)
libz.so => /usr/lib/libz.so (0x280a9000)
libm.so.2 => /usr/lib/libm.so.2 (0x280b6000)
libc.so.4 => /usr/lib/libc.so.4 (0x280d1000)
They should have loaded /usr/local/zlib/lib/libz.so, NOT that in /usr/lib.
I did build tiff-3.7.0 in the following method:
% gzip -cd tiff-3.7.0.tar.gz | gtar xf -
% cd tiff-3.7.0
% patch -p1 < ../patch_1
The patch 'patch_1' is described at
% patch < ../patch_2
The patch 'patch_2' is described at
% ./configure \
# NOTE that I specified the library path for jpeg and zlib.
The tools (such as tiffsplit) built in this method should have loaded
However, the following libraries are loaded:
as the above result of ldd command tells.
The solution for this problem is to add the --rpath option when you build libtiff.so and the tools.
-L/usr/local/jpeg/lib -Wl,--rpath -Wl,/usr/local/jpeg/lib
-L/usr/local/zlib/lib -Wl,--rpath -Wl,/usr/local/zlib/lib
... -ljpeg -lz -lm -Wl,--rpath -Wl,/usr/local/tiff/lib
P.S. Thank you very much for fixing the bug on the '--disable-old-jpeg' option in the configure script!! :-) :-)
Norihiko Murase <skeleten [AT] shillest.net>