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

Re: LD_LIBRARY_PATH for make test



Howard Chu wrote:
> Hallvard B Furuseth wrote:
>> Michael Ströder writes:
>>> 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:
> 
> Setting LD_LIBRARY_PATH in defines.sh was always lame at best.

Well, it works in my setup. Maybe I will add it to my build script
before make test.

> In
> particular, it does nothing for systems like HPUX or AIX (which use
> SHLIB_PATH and LIBPATH, respectively) and I imagine there are many other
> systems in the same boat. Part of the point in using libtool is to avoid
> having to muck with this kind of stuff directly in our own scripts.

Ok.

> That's on a build with no special linker flags configured.

Ok, now I can see the problem. My build script (see below, lines
wrapped) has vars set for the case when BDB or SASL are installed in
different prefixes. At the moment I'm building against the pre-installed
ones and set these prefixes to /usr. Because of this /usr/lib gets
prepended to rpath:

[..]
 0x0000000f (RPATH)                      Library rpath:
[/usr/lib:/usr/src/michael/openldap/OPENLDAP_REL_ENG_2_4/openldap/libraries/libldap_r/.libs:/usr/src/michael/openldap/OPENLDAP_REL_ENG_2_4/openldap/libraries/liblber/.libs:/opt/openldap-RE24/lib]
 0x0000001d (RUNPATH)                    Library runpath:
[/usr/lib:/usr/src/michael/openldap/OPENLDAP_REL_ENG_2_4/openldap/libraries/libldap_r/.libs:/usr/src/michael/openldap/OPENLDAP_REL_ENG_2_4/openldap/libraries/liblber/.libs:/opt/openldap-RE24/lib]
[..]

Any idea how to change the order without having to remove the linker
flags completely? It's so convenient just to change a prefix.

Ciao, Michael.

-------------------------------- snip --------------------------------
OPENLDAP_VERSION=$1
#BDB_PREFIX="/opt/bdb-4.6"
BDB_PREFIX="/usr"
SSL_PREFIX="/usr"
KRB5_PREFIX="/usr"
SASL_PREFIX="/usr"
OPENLDAP_PREFIX="/opt/openldap-${OPENLDAP_VERSION}"

export CFLAGS="-g -O2 -DSLAP_LIGHTWEIGHT_DISPATCHER"
export CPPFLAGS="-I${SSL_PREFIX}/include -I${BDB_PREFIX}/include
-I${KRB5_PREFIX}/include -I${SASL_PREFIX}/include"
#export CPPFLAGS="-I${SSL_PREFIX}/include -I${BDB_PREFIX}/include"
export LDFLAGS="-L${BDB_PREFIX}/lib -L${SSL_PREFIX}/lib
-L${KRB5_PREFIX}/lib -L${SASL_PREFIX}/lib -Wl,-R${SSL_PREFIX}/lib
-Wl,-R${BDB_PREFIX}/lib,-R${SASL_PREFIX}/lib,-R${KRB5_PREFIX}/lib"

make distclean
./configure \
  --prefix=${OPENLDAP_PREFIX} \
  --enable-dynamic=yes \
  --enable-ndb=no \
  --enable-backends=mod \
  --enable-overlays=mod \
  --enable-perl=no \
  --enable-shell=no \
  --enable-local=yes \
  --with-cyrus-sasl=yes \
  --with-kerberos=yes \
  --with-tls=yes \
  --with-threads=yes \
  --with-odbc=auto \
  --enable-crypt=yes \
  --enable-spasswd=yes \
  --enable-lmpasswd=yes \
  --enable-shared=yes

make depend
make
ulimit -c unlimited
SLEEP1=7
SLEEP2=15
make test