mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Autotools: Fix ext/ldap shared build (#18673)
This fixes checks when building shared ldap library, or when ldap installation directory is passed as argument: ./configure --with-ldap=shared ./configure --with-ldap=/path/to/ldap ./configure --with-ldap=shared,/path/to/ldap
This commit is contained in:
parent
c4fba3708c
commit
25e8aa5cd2
1 changed files with 16 additions and 15 deletions
|
@ -101,13 +101,16 @@ if test "$PHP_LDAP" != "no"; then
|
|||
|
||||
PHP_ADD_INCLUDE([$LDAP_INCDIR])
|
||||
|
||||
dnl Save original values
|
||||
_SAVE_CPPFLAGS=$CPPFLAGS
|
||||
_SAVE_LIBS=$LIBS
|
||||
CPPFLAGS="$CPPFLAGS -I$LDAP_INCDIR"
|
||||
LIBS="$LIBS $LDAP_SHARED_LIBADD"
|
||||
LDAP_CFLAGS="-I$LDAP_INCDIR"
|
||||
LDAP_LIBS=$LDAP_SHARED_LIBADD
|
||||
])
|
||||
|
||||
dnl Save original values
|
||||
_SAVE_CFLAGS=$CFLAGS
|
||||
_SAVE_LIBS=$LIBS
|
||||
CFLAGS="$CFLAGS $LDAP_CFLAGS"
|
||||
LIBS="$LIBS $LDAP_LIBS"
|
||||
|
||||
dnl Check for 3 arg ldap_set_rebind_proc
|
||||
AC_CACHE_CHECK([for 3 arg ldap_set_rebind_proc],
|
||||
[php_cv_have_3arg_setrebindproc],
|
||||
|
@ -134,11 +137,14 @@ if test "$PHP_LDAP" != "no"; then
|
|||
ldap_whoami_s
|
||||
]))
|
||||
|
||||
AS_IF([test "$PHP_LDAP_PKGCONFIG" = false], [
|
||||
dnl Restore original values
|
||||
CPPFLAGS=$_SAVE_CPPFLAGS
|
||||
LIBS=$_SAVE_LIBS
|
||||
])
|
||||
dnl Sanity check
|
||||
AC_CHECK_FUNC([ldap_sasl_bind_s],,
|
||||
[AC_CHECK_FUNC([ldap_simple_bind_s],,
|
||||
[AC_MSG_ERROR([LDAP library build check failed.])])])
|
||||
|
||||
dnl Restore original values
|
||||
CFLAGS=$_SAVE_CFLAGS
|
||||
LIBS=$_SAVE_LIBS
|
||||
|
||||
dnl SASL check
|
||||
AS_VAR_IF([PHP_LDAP_SASL], [no],, [
|
||||
|
@ -149,11 +155,6 @@ if test "$PHP_LDAP" != "no"; then
|
|||
[Define to 1 if the ldap extension has SASL support enabled.])
|
||||
])
|
||||
|
||||
dnl Sanity check
|
||||
AC_CHECK_FUNC([ldap_sasl_bind_s],,
|
||||
[AC_CHECK_FUNC([ldap_simple_bind_s],,
|
||||
[AC_MSG_ERROR([LDAP library build check failed.])])])
|
||||
|
||||
PHP_SUBST([LDAP_SHARED_LIBADD])
|
||||
AC_DEFINE([HAVE_LDAP], [1],
|
||||
[Define to 1 if the PHP extension 'ldap' is available.])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue