]> granicus.if.org Git - php/commitdiff
Use PKG_CHECK_MODULES to detect the kerberos libraries
authorHugh McMaster <hugh.mcmaster@outlook.com>
Fri, 19 Apr 2019 04:57:35 +0000 (14:57 +1000)
committerPeter Kokot <peterkokot@gmail.com>
Sat, 20 Apr 2019 13:13:24 +0000 (15:13 +0200)
acinclude.m4
ext/imap/config.m4
ext/openssl/config0.m4

index 3c372439c0face997a9edc31c85afe4baf079e4f..e195154919471b201fd8e68e1de299e5021f7fd2 100644 (file)
@@ -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
-
-  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
+  PHP_EVAL_INCLINE($KERBEROS_CFLAGS)
+  PHP_EVAL_LIBLINE($KERBEROS_LIBS, $1)
 
-    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
index 4eeda854b7f4e74c7844358fe7c62d0e932162a7..1d96769a923d07028ccf5553ebe70b632e5197c6 100644 (file)
@@ -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])
 
index df90e05ba3aa493c3fb06074cbc97a6cab1926cc..8d7d65621dcf81e222602d7cb39bd96b17bfcb6f 100644 (file)
@@ -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])