mirror of
https://github.com/php/php-src.git
synced 2024-12-25 09:49:08 +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
|
||||||
dnl PHP_SETUP_KERBEROS(shared-add [, action-found [, action-not-found]])
|
dnl PHP_SETUP_KERBEROS(shared-add [, action-found])
|
||||||
dnl
|
dnl
|
||||||
dnl Common setup macro for kerberos
|
dnl Common setup macro for kerberos
|
||||||
dnl
|
dnl
|
||||||
AC_DEFUN([PHP_SETUP_KERBEROS],[
|
AC_DEFUN([PHP_SETUP_KERBEROS],[
|
||||||
found_kerberos=no
|
PKG_CHECK_MODULES([KERBEROS], [krb5-gssapi krb5])
|
||||||
unset KERBEROS_CFLAGS
|
|
||||||
unset KERBEROS_LIBS
|
|
||||||
|
|
||||||
dnl First try to find krb5-config
|
PHP_EVAL_INCLINE($KERBEROS_CFLAGS)
|
||||||
if test -z "$KRB5_CONFIG"; then
|
PHP_EVAL_LIBLINE($KERBEROS_LIBS, $1)
|
||||||
AC_PATH_PROG(KRB5_CONFIG, krb5-config, no, [$PATH:/usr/kerberos/bin:/usr/local/bin])
|
|
||||||
fi
|
|
||||||
|
|
||||||
dnl If krb5-config is found try using it
|
ifelse([$2],[],:,[$2])
|
||||||
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
|
|
||||||
])
|
])
|
||||||
|
|
||||||
dnl
|
dnl
|
||||||
|
@ -51,11 +51,6 @@ AC_DEFUN([PHP_IMAP_KRB_CHK], [
|
|||||||
PHP_SETUP_KERBEROS(IMAP_SHARED_LIBADD,
|
PHP_SETUP_KERBEROS(IMAP_SHARED_LIBADD,
|
||||||
[
|
[
|
||||||
AC_DEFINE(HAVE_IMAP_KRB,1,[ ])
|
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
|
else
|
||||||
AC_EGREP_HEADER(auth_gss, $IMAP_INC_DIR/linkage.h, [
|
AC_EGREP_HEADER(auth_gss, $IMAP_INC_DIR/linkage.h, [
|
||||||
@ -98,8 +93,8 @@ PHP_ARG_WITH([imap],
|
|||||||
|
|
||||||
PHP_ARG_WITH([kerberos],
|
PHP_ARG_WITH([kerberos],
|
||||||
[for IMAP Kerberos support],
|
[for IMAP Kerberos support],
|
||||||
[AS_HELP_STRING([[--with-kerberos[=DIR]]],
|
[AS_HELP_STRING([--with-kerberos],
|
||||||
[IMAP: Include Kerberos support. DIR is the Kerberos install prefix])],
|
[IMAP: Include Kerberos support])],
|
||||||
[no],
|
[no],
|
||||||
[no])
|
[no])
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ PHP_ARG_WITH([openssl],
|
|||||||
|
|
||||||
PHP_ARG_WITH([kerberos],
|
PHP_ARG_WITH([kerberos],
|
||||||
[for Kerberos support],
|
[for Kerberos support],
|
||||||
[AS_HELP_STRING([[--with-kerberos[=DIR]]],
|
[AS_HELP_STRING([--with-kerberos],
|
||||||
[OPENSSL: Include Kerberos support])],
|
[OPENSSL: Include Kerberos support])],
|
||||||
[no],
|
[no],
|
||||||
[no])
|
[no])
|
||||||
|
Loading…
Reference in New Issue
Block a user