Bug 13427 - Can't build LDAP enable on Solaris
Summary: Can't build LDAP enable on Solaris
Status: CLOSED FIXED
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: Build (show other bugs)
Version: 2.0.42
Hardware: Sun Solaris
: P3 critical with 6 votes (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2002-10-08 23:04 UTC by Gary Algier
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments
Similar failures on FreeBSD, likely related. Openldap in use. (1.30 KB, text/plain)
2002-11-06 23:25 UTC, Joe R. Doupnik
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gary Algier 2002-10-08 23:04:31 UTC
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)
Comment 1 Joe R. Doupnik 2002-11-06 23:25:18 UTC
Created attachment 3762 [details]
Similar failures on FreeBSD, likely related. Openldap in use.
Comment 2 Graham Leggett 2003-01-21 14:28:56 UTC
Patch has been applied to APR v0.9.2.

If this problem still persists, please reopen this bug.