I have attempted to build the LDAP enabled Apache 2.0.43 on Solaris 9 using OpenLDAP 2.0.7 (from Sunfreeware.com). The Solaris compiles require one to link LDAP with "... -lldap -llber -lsocket -lnsl -lresolv ...". The attempted LDAP lookups in srclib/apr-util/configure don't include this. Attempts to specify something on the command line like: ../configure --with-ldap="ldap, \"-llber -lsocket\"..." will never work as the variable set by the script is different from the variable used. Attempts to fix the script to try more possibilities fails because the attempts are performed in a loop with a cache variable set and tested each time that is based purly upon the library name, not using the extralibs names. This causes second and subsequent tests to never be run. It looks like someone tried to unset the cache variable, but the name unset does not match the name set. I don't know if the "''" in the middle of the name is a bug in this package, a bug in autoconf, or "planned", but it gets translated to two extra "_" characters. The sure fix is to unset both. The fix: make these changes to build/apu-conf.m4 and rebuild configure: diff -u -r1.1.1.1 apu-conf.m4 --- build/apu-conf.m4 8 Oct 2002 21:38:11 -0000 1.1.1.1 +++ build/apu-conf.m4 8 Oct 2002 22:38:52 -0000 @@ -651,6 +651,7 @@ ldaplib=$1 extralib=$2 unset ac_cv_lib_${ldaplib}_ldap_init + unset ac_cv_lib_${ldaplib}___ldap_init AC_CHECK_LIB(${ldaplib}, ldap_init, [ APR_ADDTO(APRUTIL_EXPORT_LIBS,[-l${ldaplib} ${extralib}]) @@ -699,9 +700,13 @@ APU_FIND_LDAPLIB("ldapssl20") APU_FIND_LDAPLIB("ldap", "-llber") APU_FIND_LDAPLIB("ldap", "-llber -lresolv") + APU_FIND_LDAPLIB("ldap", "-llber -lsocket -lnsl -lresolv") APU_FIND_LDAPLIB("ldap", "-ldl -lpthread") else - APU_FIND_LDAPLIB($LDAPLIB) + APU_FIND_LDAPLIB($LIBLDAP) + APU_FIND_LDAPLIB($LIBLDAP, "-lresolv") + APU_FIND_LDAPLIB($LIBLDAP, "-lsocket -lnsl -lresolv") + APU_FIND_LDAPLIB($LIBLDAP, "-ldl -lpthread") fi test ${apu_has_ldap} != "define" && AC_MSG_ERROR(could not find an LDAP library)
Created attachment 3762 [details] Similar failures on FreeBSD, likely related. Openldap in use.
Patch has been applied to APR v0.9.2. If this problem still persists, please reopen this bug.