how does libldap detection work in ./configure script?

Tomasz Chmielewski mangoo at
Tue Jan 24 21:16:53 GMT 2006

I'm trying to cross-compile Samba 3.0.21a for a target Linux/mipsel.

Actually, it does compile after some minor chenges, and runs fine.

What I failed to compile is ldap support - if I add --with-ldap to the 
./configure script, it fails:

checking for LDAP support... yes
checking ldap.h usability... yes
checking ldap.h presence... yes
checking for ldap.h... yes
checking lber.h usability... yes
checking lber.h presence... yes
checking for lber.h... yes
checking for ber_scanf in -llber... yes
checking for ldap_init in -lldap... no
checking for ldap_set_rebind_proc... no
checking whether ldap_set_rebind_proc takes 3 arguments... 3
configure: error: libldap is needed for LDAP support

I am sure that LDFLAGS is correct and contains a compiled for 

-L/home/data/wrt54/openldap-2.3.18/libraries/libldap/.libs (...)

# cd /home/data/wrt54/openldap-2.3.18/libraries/libldap/.libs/

# file libldap*      symbolic link to `'  ELF 32-bit LSB shared object, MIPS, version 1 
(SYSV), not stripped ELF 32-bit LSB shared object, MIPS, version 1 
(SYSV), not stripped
libldap.a:             current ar archive            symbolic link to `../'
libldap.lai:           ASCII English text            symbolic link to `'

# strings | grep ldap_init
ldap_init: trying %s
ldap_init: using %s
ldap_init: HOME env is %s
ldap_init: HOME env is NULL
ldap_init: %s env is %s
ldap_init: %s env is NULL

Why does configure fail to detect libldap?

Note that liblber is detected (it also comes from the OpenLDAP).

Tomasz Chmielewski

More information about the samba-technical mailing list