]> arthur.barton.de Git - netatalk.git/commitdiff
Add configure option for Kerberos support
authorJamie Gilbertson <jamie.gilbertson@luniv.ca>
Tue, 13 Mar 2012 02:34:33 +0000 (20:34 -0600)
committerFrank Lahm <franklahm@googlemail.com>
Mon, 19 Mar 2012 11:48:24 +0000 (12:48 +0100)
We need to use the native Kerberos API to read afpd's keytab. So, we add a configure feature for the next patch in the series to use.

Signed-off-by: Jamie Gilbertson <jamie.gilbertson@luniv.ca>
configure.ac
macros/netatalk.m4
macros/summary.m4

index 7ab53637e81de8cfa58162ae92c4354107e8fcbc..c556887bcc74585e84860eced75ecd5f47d28899 100644 (file)
@@ -160,6 +160,9 @@ AC_NETATALK_PGP_UAM
 dnl Check for building Kerberos V UAM module
 AC_NETATALK_KRB5_UAM
 
+dnl Check for Kerberos 5 support
+AC_NETATALK_KERBEROS
+
 dnl Check for overwrite the config files or not
 AC_NETATALK_OVERWRITE_CONFIG
 
index 1b0f4944b1e43684d5816ae62217fc872058668d..1fcdcb77168ec82e5545fd88633b3e3bc02dd29c 100644 (file)
@@ -489,6 +489,41 @@ fi
 AM_CONDITIONAL(USE_GSSAPI, test x"$netatalk_cv_build_krb5_uam" = x"yes")
 ])
 
+AC_DEFUN([AC_NETATALK_KERBEROS], [
+AC_MSG_CHECKING([for Kerberos 5 (necessary for GetSrvrInfo:DirectoryNames support)])
+AC_ARG_WITH([kerberos],
+    [AS_HELP_STRING([--with-kerberos], [Kerberos 5 support (default=auto)])],
+    [],
+    [with_kerberos=auto])
+AC_MSG_RESULT($with_kerberos)
+
+if test x"$with_kerberos" != x"no"; then
+   have_krb5_header="no"
+   AC_CHECK_HEADERS([krb5/krb5.h krb5.h], [have_krb5_header="yes"; break])
+   if test x"$have_krb5_header" = x"no" && test x"$with_kerberos" != x"auto"; then
+      AC_MSG_FAILURE([--with-kerberos was given, but no headers found])
+   fi
+
+   AC_PATH_PROG([KRB5_CONFIG], [krb5-config])
+   AC_MSG_CHECKING([for krb5-config])
+   if test -x "$KRB5_CONFIG"; then
+      AC_MSG_RESULT([$KRB5_CONFIG])
+      CFLAGS="$CFLAGS `$KRB5_CONFIG --cflags krb5`"
+      LIBS="`$KRB5_CONFIG --libs krb5` $LIBS"
+      with_kerberos="yes"
+   else
+      AC_MSG_RESULT([not found])
+      if test x"$with_kerberos" != x"auto"; then
+         AC_MSG_FAILURE([--with-kerberos was given, but krb5-config could not be found])
+      fi
+   fi
+fi
+
+if test x"$with_kerberos" = x"yes"; then
+   AC_DEFINE([HAVE_KERBEROS], [1], [Define if Kerberos 5 is available])
+fi
+])
+
 dnl Check for overwrite the config files or not
 AC_DEFUN([AC_NETATALK_OVERWRITE_CONFIG], [
 AC_MSG_CHECKING([whether configuration files should be overwritten])
index 2af44d6ab9d166c506b558d887581ba0dc2aa62e..e6927be761a53d405a03667fe1c47044488e57c4 100644 (file)
@@ -51,6 +51,7 @@ dnl   fi
        AC_MSG_RESULT([         cracklib support:        $netatalk_cv_with_cracklib])
        AC_MSG_RESULT([         Samba sharemode interop: $neta_cv_have_smbshmd])
        AC_MSG_RESULT([         ACL support:             $with_acl_support])
+       AC_MSG_RESULT([         Kerberos support:        $with_kerberos])
        AC_MSG_RESULT([         LDAP support:            $with_ldap])
        if test x"$use_pam_so" = x"yes" -a x"$netatalk_cv_install_pam" = x"no"; then
                AC_MSG_RESULT([])