[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: LD_LIBRARY_PATH for make test



Quanah Gibson-Mount wrote:
> 
> LDFLAGS="-L/usr/local/lib -R/usr/local/lib"
> LD_LIBRARY_PATH=/usr/local/lib CPPFLAGS="-I/usr/local/include" CC=gcc
> CXX=g++ CFLAGS='-g -O2 -DSLAP_LIGHTWEIGHT_DISPATCHER' CXXFLAGS='-g -O2'
> sh ../configure --datadir='${prefix}/lib' --libexecdir='${prefix}/lib'

In my build script I don't even set LD_LIBRARY_PATH.

> and here's my resulting slapd:
> 
> [root@freelancer .libs]# ldd slapd
>        libldap_r-2.4.so.2 => not found
>        liblber-2.4.so.2 => not found

And that's the difference:

$ ldd servers/slapd/.libs/slapd
[..]
	libldap_r-2.4.so.2 => /usr/lib/libldap_r-2.4.so.2 (0xb7fc0000)
	liblber-2.4.so.2 => /usr/lib/liblber-2.4.so.2 (0xb7fb0000)
[..]

> [root@freelancer .libs]# ldd lt-slapd
>        libldap_r-2.4.so.2 =>
> /usr/local/build/openldap-2.4.16/qbuild/libraries/libldap_r/.libs/libldap_r-2.4.so.2
> (0x00002b99e1623000)
>        liblber-2.4.so.2 =>
> /usr/local/build/openldap-2.4.16/qbuild/libraries/liblber/.libs/liblber-2.4.so.2
> (0x00002b99e186e000)

Is /usr/local/build/openldap-2.4.16/qbuild your source and build directory?

In my source directory it's different:

$ ldd servers/slapd/.libs/lt-slapd
	linux-gate.so.1 =>  (0xffffe000)
	libldap_r-2.4.so.2 => /usr/lib/libldap_r-2.4.so.2 (0xb7f21000)
	liblber-2.4.so.2 => /usr/lib/liblber-2.4.so.2 (0xb7f11000)

> and I have no installed openldap in /usr/local/*
> 
> The /usr/lib dir has pre-existing libldap:

So this doesn't get linked because you set
LD_LIBRARY_PATH=/usr/local/lib. I don't want that because this might
break other things in a local setup where LD_LIBRARY_PATH in a shell
profile.

So this works great for you. But this won't work for others. And I'd
really like to know what's wrong with my suggestion to generally set
LD_LIBRARY_PATH in tests/scripts/defines.sh like this:

LD_LIBRARY_PATH=$TESTWD/../libraries/liblber/.libs:$TESTWD/../libraries/libldap/.libs:$TESTWD/../libraries/libldap_r/.libs:${LD_LI
BRARY_PATH} export LD_LIBRARY_PATH

Ciao, Michael.