DEVEL15-linux-configure-vfs-update-20070612
[openafs.git] / src / cf / kerberos.m4
index 7f8e58c..0ee0838 100644 (file)
@@ -58,13 +58,53 @@ 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 krb5_524_convert_creds krb524_convert_creds_kdc])
+       AC_CHECK_FUNCS([add_to_error_table add_error_table krb5_princ_size krb5_principal_get_comp_string])
+       AC_CHECK_FUNCS([krb5_524_convert_creds], ,
+           [AC_CHECK_FUNCS([krb524_convert_creds_kdc], ,
+               [AC_CHECK_LIB([krb524], [krb524_convert_creds_kdc],
+                   [LIBS="-lkrb524 $LIBS"
+                    KRB5LIBS="-lkrb524 $LIBS"
+                    AC_DEFINE([HAVE_KRB524_CONVERT_CREDS_KDC], 1,
+                        [Define to 1 if you have the `krb524_convert_creds_kdc' function.])])])])
        AC_CHECK_HEADERS([kerberosIV/krb.h])
-       AC_CHECK_MEMBERS([krb5_creds.keyblock, krb5_creds.session],,, [#include <krb5.h>])
+       AC_CHECK_HEADERS([kerberosV/heim_err.h])
+
+AC_MSG_CHECKING(for krb5_creds.keyblock existence)
+AC_CACHE_VAL(ac_cv_krb5_creds_keyblock_exists,
+[
+AC_TRY_COMPILE(
+[#include <krb5.h>],
+[krb5_creds _c;
+printf("%x\n", _c.keyblock);], 
+ac_cv_krb5_creds_keyblock_exists=yes,
+ac_cv_krb5_creds_keyblock_exists=no)])
+AC_MSG_RESULT($ac_cv_krb5_creds_keyblock_exists)
+       
+AC_MSG_CHECKING(for krb5_creds.session existence)
+AC_CACHE_VAL(ac_cv_krb5_creds_session_exists,
+[
+AC_TRY_COMPILE(
+[#include <krb5.h>],
+[krb5_creds _c;
+printf("%x\n", _c.session);], 
+ac_cv_krb5_creds_session_exists=yes,
+ac_cv_krb5_creds_session_exists=no)])
+AC_MSG_RESULT($ac_cv_krb5_creds_session_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
+       
+dnl    AC_CHECK_MEMBERS([krb5_creds.keyblock, krb5_creds.session],,, [#include <krb5.h>])
        CPPFLAGS="$save_CPPFLAGS"
        LIBS="$save_LIBS"
 fi
+
 AC_SUBST(BUILD_KRB5)
 AC_SUBST(KRB5CFLAGS)
 AC_SUBST(KRB5LIBS)
+
 ])dnl