php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #75695
Patch ldap-openssl-libdir.patch revision 2017-12-16 00:02 UTC by me at nbishop dot name
revision 2017-12-15 23:59 UTC by me at nbishop dot name

Patch ldap-openssl-libdir.patch for Compile Failure Bug #75695

Patch version 2017-12-15 23:59 UTC

Return to Bug #75695 | Download this patch
This patch is obsolete

Obsoleted by patches:

Patch Revisions:

Developer: me@nbishop.name

diff -ur php-7.1.12.master/acinclude.m4 php-7.1.12.patch/acinclude.m4
--- php-7.1.12.master/acinclude.m4	2017-11-21 22:02:36.000000000 -0500
+++ php-7.1.12.patch/acinclude.m4	2017-12-15 16:29:31.000000000 -0500
@@ -2376,7 +2376,11 @@
     fi
 
     if test -z "$OPENSSL_LIBDIR"; then
-      AC_MSG_ERROR([Cannot find OpenSSL's libraries])
+      if test -r $PHP_LIBDIR/libssl.a -o -r $PHP_LIBDIR/libssl.$SHLIB_SUFFIX_NAME; then
+        OPENSSL_LIBDIR=$PHP_LIBDIR
+      else
+        AC_MSG_ERROR([Cannot find OpenSSL's libraries])
+      fi
     fi
 
     old_CPPFLAGS=$CPPFLAGS
diff -ur php-7.1.12.master/ext/ldap/config.m4 php-7.1.12.patch/ext/ldap/config.m4
--- php-7.1.12.master/ext/ldap/config.m4	2017-11-21 22:02:24.000000000 -0500
+++ php-7.1.12.patch/ext/ldap/config.m4	2017-12-15 18:34:50.000000000 -0500
@@ -6,17 +6,15 @@
   if test -f $1/include/ldap.h; then
     LDAP_DIR=$1
     LDAP_INCDIR=$1/include
-    LDAP_LIBDIR=$1/$PHP_LIBDIR
   elif test -f $1/include/umich-ldap/ldap.h; then
     LDAP_DIR=$1
     LDAP_INCDIR=$1/include/umich-ldap
-    LDAP_LIBDIR=$1/$PHP_LIBDIR
   elif test -f $1/ldap/public/ldap.h; then
     LDAP_DIR=$1
     LDAP_INCDIR=$1/ldap/public
-    LDAP_LIBDIR=$1/$PHP_LIBDIR
   else
 
+
     dnl Find Oracle Instant Client RPM header location corresponding to the given lib path e.g. for --with-ldap=/usr/lib/oracle/12.1/client64/lib
     AC_CHECK_SIZEOF(long int, 4)
     if test "$ac_cv_sizeof_long_int" = "4"; then
@@ -117,70 +115,87 @@
     LDAP_PTHREAD=
   fi
 
-  if test -f $LDAP_LIBDIR/liblber.a || test -f $LDAP_LIBDIR/liblber.$SHLIB_SUFFIX_NAME; then
-    PHP_ADD_LIBRARY_WITH_PATH(lber, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
-    PHP_ADD_LIBRARY_WITH_PATH(ldap, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
-
-  elif test -f $LDAP_LIBDIR/libldap.$SHLIB_SUFFIX_NAME || test -f $LDAP_LIBDIR/libldap.$SHLIB_SUFFIX_NAME.3 || test -f $LDAP_LIBDIR/libldap.3.dylib; then
-    PHP_ADD_LIBRARY_WITH_PATH(ldap, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
-
-  elif test -f $LDAP_LIBDIR/libssldap50.$SHLIB_SUFFIX_NAME; then
-    if test -n "$LDAP_PTHREAD"; then
-      PHP_ADD_LIBRARY($LDAP_PTHREAD)
-    fi
-    PHP_ADD_LIBRARY_WITH_PATH(nspr4, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
-    PHP_ADD_LIBRARY_WITH_PATH(plc4, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
-    PHP_ADD_LIBRARY_WITH_PATH(plds4, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
-    PHP_ADD_LIBRARY_WITH_PATH(ssldap50, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
-    PHP_ADD_LIBRARY_WITH_PATH(ldap50, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
-    PHP_ADD_LIBRARY_WITH_PATH(prldap50, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
-    PHP_ADD_LIBRARY_WITH_PATH(ssl3, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
-    AC_DEFINE(HAVE_NSLDAP,1,[ ])
-
-  elif test -f $LDAP_LIBDIR/libldapssl41.$SHLIB_SUFFIX_NAME; then
-    if test -n "$LDAP_PTHREAD"; then
-      PHP_ADD_LIBRARY($LDAP_PTHREAD)
-    fi
-    PHP_ADD_LIBRARY_WITH_PATH(nspr3, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
-    PHP_ADD_LIBRARY_WITH_PATH(plc3, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
-    PHP_ADD_LIBRARY_WITH_PATH(plds3, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
-    PHP_ADD_LIBRARY_WITH_PATH(ldapssl41, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
-    AC_DEFINE(HAVE_NSLDAP,1,[ ])
-
-  elif test -f $LDAP_LIBDIR/libldapssl30.$SHLIB_SUFFIX_NAME; then
-    if test -n "$LDAP_PTHREAD"; then
-      PHP_ADD_LIBRARY($LDAP_PTHREAD)
-    fi
-    PHP_ADD_LIBRARY_WITH_PATH(ldapssl30, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
-    AC_DEFINE(HAVE_NSLDAP,1,[ ])
+  LDAP_LIB_FOUND="no"
+  SEARCH_DIRS="/usr/local/lib64 /usr/lib64 /lib /usr/lib $PHP_LIBDIR"
+  for i in $SEARCH_DIRS; do
+    LDAP_LIBDIR=$i
 
-  elif test -f $LDAP_LIBDIR/libldap30.$SHLIB_SUFFIX_NAME; then
-    if test -n "$LDAP_PTHREAD"; then
-      PHP_ADD_LIBRARY($LDAP_PTHREAD)
+    if test -f $LDAP_LIBDIR/liblber.a || test -f $LDAP_LIBDIR/liblber.$SHLIB_SUFFIX_NAME; then
+      PHP_ADD_LIBRARY_WITH_PATH(lber, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
+      PHP_ADD_LIBRARY_WITH_PATH(ldap, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
+	  LDAP_LIB_FOUND="yes"
+
+    elif test -f $LDAP_LIBDIR/libldap.$SHLIB_SUFFIX_NAME || test -f $LDAP_LIBDIR/libldap.$SHLIB_SUFFIX_NAME.3 || test -f $LDAP_LIBDIR/libldap.3.dylib; then
+      PHP_ADD_LIBRARY_WITH_PATH(ldap, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
+	  LDAP_LIB_FOUND="yes"
+
+    elif test -f $LDAP_LIBDIR/libssldap50.$SHLIB_SUFFIX_NAME; then
+      if test -n "$LDAP_PTHREAD"; then
+        PHP_ADD_LIBRARY($LDAP_PTHREAD)
+      fi
+      PHP_ADD_LIBRARY_WITH_PATH(nspr4, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
+      PHP_ADD_LIBRARY_WITH_PATH(plc4, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
+      PHP_ADD_LIBRARY_WITH_PATH(plds4, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
+      PHP_ADD_LIBRARY_WITH_PATH(ssldap50, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
+      PHP_ADD_LIBRARY_WITH_PATH(ldap50, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
+      PHP_ADD_LIBRARY_WITH_PATH(prldap50, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
+      PHP_ADD_LIBRARY_WITH_PATH(ssl3, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
+      AC_DEFINE(HAVE_NSLDAP,1,[ ])
+	  LDAP_LIB_FOUND="yes"
+
+    elif test -f $LDAP_LIBDIR/libldapssl41.$SHLIB_SUFFIX_NAME; then
+      if test -n "$LDAP_PTHREAD"; then
+        PHP_ADD_LIBRARY($LDAP_PTHREAD)
+      fi
+      PHP_ADD_LIBRARY_WITH_PATH(nspr3, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
+      PHP_ADD_LIBRARY_WITH_PATH(plc3, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
+      PHP_ADD_LIBRARY_WITH_PATH(plds3, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
+      PHP_ADD_LIBRARY_WITH_PATH(ldapssl41, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
+      AC_DEFINE(HAVE_NSLDAP,1,[ ])
+	  LDAP_LIB_FOUND="yes"
+
+    elif test -f $LDAP_LIBDIR/libldapssl30.$SHLIB_SUFFIX_NAME; then
+      if test -n "$LDAP_PTHREAD"; then
+        PHP_ADD_LIBRARY($LDAP_PTHREAD)
+      fi
+      PHP_ADD_LIBRARY_WITH_PATH(ldapssl30, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
+      AC_DEFINE(HAVE_NSLDAP,1,[ ])
+	  LDAP_LIB_FOUND="yes"
+
+    elif test -f $LDAP_LIBDIR/libldap30.$SHLIB_SUFFIX_NAME; then
+      if test -n "$LDAP_PTHREAD"; then
+        PHP_ADD_LIBRARY($LDAP_PTHREAD)
+      fi
+      PHP_ADD_LIBRARY_WITH_PATH(ldap30, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
+      AC_DEFINE(HAVE_NSLDAP,1,[ ])
+	  LDAP_LIB_FOUND="yes"
+
+    elif test -f $LDAP_LIBDIR/libumich_ldap.$SHLIB_SUFFIX_NAME; then
+      PHP_ADD_LIBRARY_WITH_PATH(umich_lber, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
+      PHP_ADD_LIBRARY_WITH_PATH(umich_ldap, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
+	  LDAP_LIB_FOUND="yes"
+
+    elif test -f $LDAP_LIBDIR/libclntsh.$SHLIB_SUFFIX_NAME.12.1; then
+      PHP_ADD_LIBRARY_WITH_PATH(clntsh, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
+      AC_DEFINE(HAVE_ORALDAP,1,[ ])
+      AC_DEFINE(HAVE_ORALDAP_12,1,[ ])
+	  LDAP_LIB_FOUND="yes"
+
+    elif test -f $LDAP_LIBDIR/libclntsh.$SHLIB_SUFFIX_NAME.11.1; then
+      PHP_ADD_LIBRARY_WITH_PATH(clntsh, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
+      AC_DEFINE(HAVE_ORALDAP,1,[ ])
+      AC_DEFINE(HAVE_ORALDAP_11,1,[ ])
+	  LDAP_LIB_FOUND="yes"
+
+    elif test -f $LDAP_LIBDIR/libclntsh.$SHLIB_SUFFIX_NAME; then
+      PHP_ADD_LIBRARY_WITH_PATH(clntsh, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
+      AC_DEFINE(HAVE_ORALDAP,1,[ ])
+      AC_DEFINE(HAVE_ORALDAP_10,1,[ ])
+	  LDAP_LIB_FOUND="yes"
     fi
-    PHP_ADD_LIBRARY_WITH_PATH(ldap30, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
-    AC_DEFINE(HAVE_NSLDAP,1,[ ])
-
-  elif test -f $LDAP_LIBDIR/libumich_ldap.$SHLIB_SUFFIX_NAME; then
-    PHP_ADD_LIBRARY_WITH_PATH(umich_lber, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
-    PHP_ADD_LIBRARY_WITH_PATH(umich_ldap, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
-
-  elif test -f $LDAP_LIBDIR/libclntsh.$SHLIB_SUFFIX_NAME.12.1; then
-    PHP_ADD_LIBRARY_WITH_PATH(clntsh, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
-    AC_DEFINE(HAVE_ORALDAP,1,[ ])
-    AC_DEFINE(HAVE_ORALDAP_12,1,[ ])
-
-  elif test -f $LDAP_LIBDIR/libclntsh.$SHLIB_SUFFIX_NAME.11.1; then
-    PHP_ADD_LIBRARY_WITH_PATH(clntsh, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
-    AC_DEFINE(HAVE_ORALDAP,1,[ ])
-    AC_DEFINE(HAVE_ORALDAP_11,1,[ ])
-
-  elif test -f $LDAP_LIBDIR/libclntsh.$SHLIB_SUFFIX_NAME; then
-     PHP_ADD_LIBRARY_WITH_PATH(clntsh, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
-     AC_DEFINE(HAVE_ORALDAP,1,[ ])
-     AC_DEFINE(HAVE_ORALDAP_10,1,[ ])
+  done
 
-  else
+  if test "$PHP_LDAP" = "no"; then
     AC_MSG_ERROR(Cannot find ldap libraries in $LDAP_LIBDIR.)
   fi
 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 06:01:30 2024 UTC