mirror of
https://github.com/php/php-src.git
synced 2024-12-25 01:40:50 +08:00
Merge branch 'PHP-7.4'
* PHP-7.4: Use PKG_CHECK_MODULES to detect the kerberos libraries
This commit is contained in:
commit
cf84bbf606
54
acinclude.m4
54
acinclude.m4
@ -1906,61 +1906,17 @@ AC_DEFUN([PHP_SETUP_ICU],[
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl PHP_SETUP_KERBEROS(shared-add [, action-found [, action-not-found]])
|
||||
dnl PHP_SETUP_KERBEROS(shared-add [, action-found])
|
||||
dnl
|
||||
dnl Common setup macro for kerberos
|
||||
dnl
|
||||
AC_DEFUN([PHP_SETUP_KERBEROS],[
|
||||
found_kerberos=no
|
||||
unset KERBEROS_CFLAGS
|
||||
unset KERBEROS_LIBS
|
||||
PKG_CHECK_MODULES([KERBEROS], [krb5-gssapi krb5])
|
||||
|
||||
dnl First try to find krb5-config
|
||||
if test -z "$KRB5_CONFIG"; then
|
||||
AC_PATH_PROG(KRB5_CONFIG, krb5-config, no, [$PATH:/usr/kerberos/bin:/usr/local/bin])
|
||||
fi
|
||||
PHP_EVAL_INCLINE($KERBEROS_CFLAGS)
|
||||
PHP_EVAL_LIBLINE($KERBEROS_LIBS, $1)
|
||||
|
||||
dnl If krb5-config is found try using it
|
||||
if test "$PHP_KERBEROS" != "no" && test -x "$KRB5_CONFIG"; then
|
||||
KERBEROS_LIBS=`$KRB5_CONFIG --libs gssapi`
|
||||
KERBEROS_CFLAGS=`$KRB5_CONFIG --cflags gssapi`
|
||||
|
||||
if test -n "$KERBEROS_LIBS"; then
|
||||
found_kerberos=yes
|
||||
PHP_EVAL_LIBLINE($KERBEROS_LIBS, $1)
|
||||
PHP_EVAL_INCLINE($KERBEROS_CFLAGS)
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl If still not found use old skool method
|
||||
if test "$found_kerberos" = "no"; then
|
||||
|
||||
if test "$PHP_KERBEROS" = "yes"; then
|
||||
PHP_KERBEROS="/usr/kerberos /usr/local /usr"
|
||||
fi
|
||||
|
||||
for i in $PHP_KERBEROS; do
|
||||
if test -f $i/$PHP_LIBDIR/libkrb5.a || test -f $i/$PHP_LIBDIR/libkrb5.$SHLIB_SUFFIX_NAME; then
|
||||
PHP_KERBEROS_DIR=$i
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if test "$PHP_KERBEROS_DIR"; then
|
||||
found_kerberos=yes
|
||||
PHP_ADD_LIBPATH($PHP_KERBEROS_DIR/$PHP_LIBDIR, $1)
|
||||
PHP_ADD_LIBRARY(gssapi_krb5, 1, $1)
|
||||
PHP_ADD_LIBRARY(krb5, 1, $1)
|
||||
PHP_ADD_LIBRARY(k5crypto, 1, $1)
|
||||
PHP_ADD_LIBRARY(com_err, 1, $1)
|
||||
PHP_ADD_INCLUDE($PHP_KERBEROS_DIR/include)
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$found_kerberos" = "yes"; then
|
||||
ifelse([$2],[],:,[$2])
|
||||
ifelse([$3],[],,[else $3])
|
||||
fi
|
||||
ifelse([$2],[],:,[$2])
|
||||
])
|
||||
|
||||
dnl
|
||||
|
@ -51,11 +51,6 @@ AC_DEFUN([PHP_IMAP_KRB_CHK], [
|
||||
PHP_SETUP_KERBEROS(IMAP_SHARED_LIBADD,
|
||||
[
|
||||
AC_DEFINE(HAVE_IMAP_KRB,1,[ ])
|
||||
], [
|
||||
AC_MSG_ERROR([Kerberos libraries not found.
|
||||
|
||||
Check the path given to --with-kerberos (if no path is given, searches in /usr/kerberos, /usr/local and /usr )
|
||||
])
|
||||
])
|
||||
else
|
||||
AC_EGREP_HEADER(auth_gss, $IMAP_INC_DIR/linkage.h, [
|
||||
@ -98,8 +93,8 @@ PHP_ARG_WITH([imap],
|
||||
|
||||
PHP_ARG_WITH([kerberos],
|
||||
[for IMAP Kerberos support],
|
||||
[AS_HELP_STRING([[--with-kerberos[=DIR]]],
|
||||
[IMAP: Include Kerberos support. DIR is the Kerberos install prefix])],
|
||||
[AS_HELP_STRING([--with-kerberos],
|
||||
[IMAP: Include Kerberos support])],
|
||||
[no],
|
||||
[no])
|
||||
|
||||
|
@ -7,7 +7,7 @@ PHP_ARG_WITH([openssl],
|
||||
|
||||
PHP_ARG_WITH([kerberos],
|
||||
[for Kerberos support],
|
||||
[AS_HELP_STRING([[--with-kerberos[=DIR]]],
|
||||
[AS_HELP_STRING([--with-kerberos],
|
||||
[OPENSSL: Include Kerberos support])],
|
||||
[no],
|
||||
[no])
|
||||
|
Loading…
Reference in New Issue
Block a user