[xml] --with-zlib=DIR failing at runtime



 I have a system that has 2 instances of the zlib libraries.

One is in the standard places used by openssh and other packages:
-rw-r--r-- 1 root root 118212 Jul  8  2006 /usr/lib/libz.a
lrwxrwxrwx 1 root root      9 Feb 11  2010 /usr/lib/libz.so -> libz.so.1
lrwxrwxrwx 1 root root 13 Nov 2 2007 /usr/lib/libz.so.1 -> libz.so.1.2.3
-rw-r--r-- 1 root root  90024 Jul  8  2006 /usr/lib/libz.so.1.2.3
-rw-r--r-- 1 root root 66415 Jul  8  2006 /usr/include/zlib.h

The other instance I just compiled along with Apache2, PHP, cURL, jpegsrc, openssl, cmake, libssh, libxml2, etc.:
-rw-r--r-- 1 root staff 124886 Jun  1 13:28 /usr/local/lib/libz.a
lrwxrwxrwx 1 root staff 13 Jun 1 13:28 /usr/local/lib/libz.so -> libz.so.1.2.7 lrwxrwxrwx 1 root staff 13 Jun 1 13:28 /usr/local/lib/libz.so.1 -> libz.so.1.2.7
-rwxr-xr-x 1 root staff  98479 Jun  1 13:28 /usr/local/lib/libz.so.1.2.7
-rw-r--r-- 1 root staff 86717 Jun  1 13:28 /usr/local/include/zlib.h

I tried to use the --with-zlib= configure parameter to force it to use the zlib in /usr/local:
# tar xzf ./libxml2-2.7.8.tar.gz
# cd libxml2-2.7.8
# ./configure --with-zlib=/usr/local
# make
# make install
 # ls -l /usr/local/lib/libxml2.so.2.7.8
-rwxr-xr-x 1 root staff  4135622 Jun  1 14:55 libxml2.so.2.7.8

After compiling, the result is:
# ldd /usr/local/lib/libxml2.so.2.7.8
/usr/local/lib/libxml2.so.2.7.8: /usr/lib/libz.so.1: no version information available (required by /usr/local/lib/libxml2.so.2.7.8) /usr/local/lib/libxml2.so.2.7.8: /usr/lib/libz.so.1: no version information available (required by /usr/local/lib/libxml2.so.2.7.8)
        libdl.so.2 => /lib/libdl.so.2 (0x00002ba210000000)
        libz.so.1 => /usr/lib/libz.so.1 (0x00002ba210104000)
        libm.so.6 => /lib/libm.so.6 (0x00002ba21021a000)
        libc.so.6 => /lib/libc.so.6 (0x00002ba21039c000)
        /lib64/ld-linux-x86-64.so.2 (0x0000555555554000)

So - it is showing /usr/lib vs. /usr/local/lib...

Then I compiled libxml2 using the following script (trying to push /usr/lib and /usr/include out of the way temporarily):
# tar xzf ./libxml2-2.7.8.tar.gz
# cd libxml2-2.7.8
# mkdir /usr/lib/zlibsave.$$
# mv /usr/lib/libz.* /usr/lib/zlibsave.$$
# mkdir /usr/include/zlibsave.$$
# mv /usr/include/zlib.* /usr/include/zlibsave.$$
# ldconfig
# ./configure --with-zlib=/usr/local
# make
# make install
# mv /usr/lib/zlibsave.$$/* /usr/lib
# rmdir /usr/lib/zlibsave.$$
# mv /usr/include/zlibsave.$$/* /usr/include
# rmdir /usr/include/zlibsave.$$

I get the same result either way... ldd still show that it is linked to the /usr/lib version (even though it wasn't even there during the compilation phase... How can I force the compilation process to set the runtime execution to always use the zlib libraries from the folder specified at compile time?

Thanks for you help,
Larry Irwin



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