diff --git a/UPGRADING b/UPGRADING index eceb9b6f0ad..66be319cb9b 100644 --- a/UPGRADING +++ b/UPGRADING @@ -567,6 +567,9 @@ The following extensions and SAPIs are affected: . --with-icu-dir has been removed. If --enable-intl is passed, then libicu is always required. +- Ldap: + . --with-ldap-sasl no longer accepts a directory. + - Libxml: . --with-libxml-dir has been removed. . --enable-libxml becomes --with-libxml. diff --git a/ext/ldap/config.m4 b/ext/ldap/config.m4 index 1812cb0e0b9..fff818b8f40 100644 --- a/ext/ldap/config.m4 +++ b/ext/ldap/config.m4 @@ -41,59 +41,15 @@ AC_DEFUN([PHP_LDAP_CHECKS], [ fi ]) -AC_DEFUN([PHP_LDAP_SASL_CHECKS], [ - if test "$1" = "yes"; then - SEARCH_DIRS="/usr/local /usr" - else - SEARCH_DIRS=$1 - fi - - for i in $SEARCH_DIRS; do - if test -f $i/include/sasl/sasl.h; then - LDAP_SASL_DIR=$i - AC_DEFINE(HAVE_LDAP_SASL_SASL_H,1,[ ]) - break - elif test -f $i/include/sasl.h; then - LDAP_SASL_DIR=$i - AC_DEFINE(HAVE_LDAP_SASL_H,1,[ ]) - break - fi - done - - if test "$LDAP_SASL_DIR"; then - LDAP_SASL_INCDIR=$LDAP_SASL_DIR/include - LDAP_SASL_LIBDIR=$LDAP_SASL_DIR/$PHP_LIBDIR - else - AC_MSG_ERROR([sasl.h not found!]) - fi - - if test "$PHP_LDAP_SASL" = "yes"; then - SASL_LIB="-lsasl2" - else - SASL_LIB="-L$LDAP_SASL_LIBDIR -lsasl2" - fi - - PHP_CHECK_LIBRARY(sasl2, sasl_version, - [ - PHP_ADD_INCLUDE($LDAP_SASL_INCDIR) - PHP_ADD_LIBRARY_WITH_PATH(sasl2, $LDAP_SASL_LIBDIR, LDAP_SHARED_LIBADD) - AC_DEFINE(HAVE_LDAP_SASL, 1, [LDAP SASL support]) - ], [ - AC_MSG_ERROR([LDAP SASL check failed. Please check config.log for more information.]) - ], [ - $LDAP_SHARED_LIBADD $SASL_LIB - ]) -]) - PHP_ARG_WITH([ldap], [for LDAP support], [AS_HELP_STRING([[--with-ldap[=DIR]]], [Include LDAP support])]) PHP_ARG_WITH([ldap-sasl], - [for LDAP Cyrus SASL support], - [AS_HELP_STRING([[--with-ldap-sasl[=DIR]]], - [LDAP: Include Cyrus SASL support])], + [whether to build with LDAP Cyrus SASL support], + [AS_HELP_STRING([--with-ldap-sasl], + [LDAP: Build with Cyrus SASL support])], [no], [no]) @@ -216,7 +172,12 @@ if test "$PHP_LDAP" != "no"; then dnl SASL check if test "$PHP_LDAP_SASL" != "no"; then - PHP_LDAP_SASL_CHECKS([$PHP_LDAP_SASL]) + PKG_CHECK_MODULES([SASL], [libsasl2]) + + PHP_EVAL_INCLINE($SASL_CFLAGS) + PHP_EVAL_LIBLINE($SASL_LIBS, LDAP_SHARED_LIBADD) + + AC_DEFINE(HAVE_LDAP_SASL, 1, [LDAP SASL support]) fi dnl Sanity check diff --git a/ext/ldap/config.w32 b/ext/ldap/config.w32 index 49f740bd651..b947aa5177c 100644 --- a/ext/ldap/config.w32 +++ b/ext/ldap/config.w32 @@ -17,7 +17,6 @@ if (PHP_LDAP != "no") { AC_DEFINE('HAVE_LDAP_START_TLS_S', 1); AC_DEFINE('HAVE_LDAP', 1); AC_DEFINE('HAVE_LDAP_SASL', 1); - AC_DEFINE('HAVE_LDAP_SASL_SASL_H', 1); AC_DEFINE('LDAP_DEPRECATED', 1); AC_DEFINE('HAVE_LDAP_CONTROL_FIND', 1); AC_DEFINE('HAVE_LDAP_PARSE_EXTENDED_RESULT', 1); diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c index 8a91e5060c4..f1486cd3154 100644 --- a/ext/ldap/ldap.c +++ b/ext/ldap/ldap.c @@ -53,9 +53,7 @@ #include "ext/standard/php_string.h" #include "ext/standard/info.h" -#ifdef HAVE_LDAP_SASL_H -#include -#elif defined(HAVE_LDAP_SASL_SASL_H) +#ifdef HAVE_LDAP_SASL #include #endif