DEVEL15-linux-2-6-27-20080816
[openafs.git] / src / cf / kerberos.m4
index 2212f88..0fb4286 100644 (file)
@@ -10,7 +10,10 @@ dnl AC_ARG_VAR(KRB5CFLAGS, [C flags to compile Kerberos 5 programs])
 dnl AC_ARG_VAR(KRB5LIBS, [Libraries and flags to compile Kerberos 5 programs])
 dnl AC_ARG_VAR(KRB5_CONFIG, [Location of krb5-config script])
 
-AC_ARG_WITH([krb5-conf],[--with-krb5-conf[=krb5-config-location]    Use a krb5-config script to configure Kerberos])
+AC_ARG_WITH([krb5-conf],
+    [AS_HELP_STRING([--with-krb5-conf=@<:@krb5-config-location@:>@],
+        [use a krb5-config script to configure Kerberos])])
+
 if test X$with_krb5_conf != X; then
                conf_krb5=YES
                if test X$with_krb5_conf = Xyes; then
@@ -35,7 +38,9 @@ if test X$with_krb5_conf != X; then
                AC_MSG_RESULT([Adding $KRB5LIBS to KRB5LIBS])
 fi
 
-AC_ARG_WITH([krb5], [--with-krb5 Support for Kerberos 5 (manual configuration)])
+AC_ARG_WITH([krb5], 
+    [AS_HELP_STRING([--with-krb5],
+        [support for Kerberos 5 (manual configuration)])])
 
 if test X$with_krb5 = Xyes; then
         if test X$conf_krb5 = XYES; then
@@ -58,7 +63,7 @@ if test X$conf_krb5 = XYES; then
        CPPFLAGS="$CPPFLAGS $KRB5CFLAGS"
        save_LIBS="$LIBS"
        LIBS="$LIBS $KRB5LIBS"
-       AC_CHECK_FUNCS([add_to_error_table add_error_table krb5_princ_size krb5_principal_get_comp_string])
+       AC_CHECK_FUNCS([add_to_error_table add_error_table krb5_princ_size krb5_principal_get_comp_string encode_krb5_enc_tkt_part encode_krb5_ticket krb5_c_encrypt krb5_c_encrypt_length krb5_cc_register krb5_decode_ticket krb5_get_prompt_types])
        AC_CHECK_FUNCS([krb5_524_convert_creds], ,
            [AC_CHECK_FUNCS([krb524_convert_creds_kdc], ,
                [AC_CHECK_LIB([krb524], [krb524_convert_creds_kdc],
@@ -91,27 +96,38 @@ ac_cv_krb5_creds_session_exists=yes,
 ac_cv_krb5_creds_session_exists=no)])
 AC_MSG_RESULT($ac_cv_krb5_creds_session_exists)
 
+AC_MSG_CHECKING(for krb5_prompt.type existence)
+AC_CACHE_VAL(ac_cv_krb5_prompt_type_exists,
+[
+AC_TRY_COMPILE(
+[#include <krb5.h>],
+[krb5_prompt _p;
+printf("%x\n", _p.type);], 
+ac_cv_krb5_prompt_type_exists=yes,
+ac_cv_krb5_prompt_type_exists=no)])
+AC_MSG_RESULT($ac_cv_krb5_prompt_type_exists)
+       
 if test "x$ac_cv_krb5_creds_keyblock_exists" = "xyes"; then
        AC_DEFINE(HAVE_KRB5_CREDS_KEYBLOCK, 1, [define if krb5_creds has keyblock])
 fi
 if test "x$ac_cv_krb5_creds_session_exists" = "xyes"; then
        AC_DEFINE(HAVE_KRB5_CREDS_SESSION, 1, [define if krb5_creds has session])
 fi
+if test "x$ac_cv_krb5_prompt_type_exists" = "xyes"; then
+       AC_DEFINE(HAVE_KRB5_PROMPT_TYPE, 1, [define if krb5_prompt has type])
+fi
        
 dnl    AC_CHECK_MEMBERS([krb5_creds.keyblock, krb5_creds.session],,, [#include <krb5.h>])
        CPPFLAGS="$save_CPPFLAGS"
        LIBS="$save_LIBS"
 fi
 
-if test "$ac_cv_header_kerberosV_heim_err_h" = "yes"; then
-    ASETKEY=
-else
-    ASETKEY=asetkey
+if test "x$ac_cv_krb5_cc_register_exists" = "xyes"; then
+        AC_DEFINE(HAVE_KRB5_CC_REGISTER, 1, [define if krb5_cc_register exists])
 fi
 
 AC_SUBST(BUILD_KRB5)
 AC_SUBST(KRB5CFLAGS)
 AC_SUBST(KRB5LIBS)
-AC_SUBST(ASETKEY)
 
 ])dnl