php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24025 Can't build with shared ldap support
Submitted: 2003-06-04 14:49 UTC Modified: 2003-06-30 19:02 UTC
From: andreas at conectiva dot com dot br Assigned:
Status: Closed Package: Compile Failure
PHP Version: 4CVS-2003-06-04 (stable) OS: linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
47 + 36 = ?
Subscribe to this entry?

 
 [2003-06-04 14:49 UTC] andreas at conectiva dot com dot br
The configure test for ldap_start_tls_s and other ldap functions fails to pass along needed ldap libraries:

(...)
configure:41587: checking for ldap_parse_reference
configure:41615: gcc -o conftest -O2 -march=i386 -mcpu=pentiumpro -fPIC  -L/usr/lib -ldb-4.1 -L/usr/lib/krb5 conftest.c -lcrypt -lpam
 -lgmp -lfreetype -lpng -lz -ljpeg -lz -ldb-4.1 -lgdbm -lcurl -lbz2 -lz -lssl -lcrypto -lresolv -lm -ldl -lnsl  -lcurl -lz -lssl -lcr
ypto -ldl -lz -lxml2 -lz -lm 1>&5
(...)
configure:41587: checking for ldap_start_tls_s
configure:41615: gcc -o conftest -O2 -march=i386 -mcpu=pentiumpro -fPIC  -L/usr/lib -ldb-4.1 -L/usr/lib/krb5 conftest.c -lcrypt -lpam
 -lgmp -lfreetype -lpng -lz -ljpeg -lz -ldb-4.1 -lgdbm -lcurl -lbz2 -lz -lssl -lcrypto -lresolv -lm -ldl -lnsl  -lcurl -lz -lssl -lcr
ypto -ldl -lz -lxml2 -lz -lm 1>&5
(...)

The patch below, against ext/ldap/config.m4, worksaround this problem. Worked here, but may not be the right way to fix this:
--- php4-STABLE-200306041730/ext/ldap/config.m4.orig    2003-06-04 16:25:11.000000000 -0300
+++ php4-STABLE-200306041730/ext/ldap/config.m4 2003-06-04 16:30:21.000000000 -0300
@@ -110,7 +110,9 @@
 
   dnl Check for 3 arg ldap_set_rebind_proc
   _SAVE_CPPFLAGS=$CPPFLAGS
+  _SAVE_LDFLAGS=$LDFLAGS
   CPPFLAGS="$CPPFLAGS -I$LDAP_INCDIR"
+  LDFLAGS="$LDFLAGS -L$LDAP_LIBDIR $LDAP_SHARED_LIBADD"
   AC_CACHE_CHECK([for 3 arg ldap_set_rebind_proc], ac_cv_3arg_setrebindproc,
   [AC_TRY_COMPILE([#include <ldap.h>], [ldap_set_rebind_proc(0,0,0)],
   ac_cv_3arg_setrebindproc=yes, ac_cv_3arg_setrebindproc=no)])
@@ -118,8 +120,15 @@
     AC_DEFINE(HAVE_3ARG_SETREBINDPROC,1,[Whether 3 arg set_rebind_proc()])
   fi
   CPPFLAGS=$_SAVE_CPPFLAGS
+  LDFLAGS=$_SAVE_LDFLAGS
 
   dnl Solaris 2.8 claims to be 2004 API, but doesn't have
   dnl ldap_parse_reference() nor ldap_start_tls_s()
+  _SAVE_CPPFLAGS=$CPPFLAGS
+  _SAVE_LDFLAGS=$LDFLAGS
+  CPPFLAGS="$CPPFLAGS -I$LDAP_INCDIR"
+  LDFLAGS="$LDFLAGS -L$LDAP_LIBDIR $LDAP_SHARED_LIBADD"
   AC_CHECK_FUNCS([ldap_parse_reference ldap_start_tls_s])
+  CPPFLAGS=$_SAVE_CPPFLAGS
+  LDFLAGS=$_SAVE_LDFLAGS
 fi 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-06-30 19:02 UTC] sniper@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 07:01:27 2024 UTC