4 dnl Kerberos autoconf glue
7 AC_DEFUN([OPENAFS_KRB5CONF],[
9 dnl AC_ARG_VAR(KRB5CFLAGS, [C flags to compile Kerberos 5 programs])
10 dnl AC_ARG_VAR(KRB5LIBS, [Libraries and flags to compile Kerberos 5 programs])
11 dnl AC_ARG_VAR(KRB5_CONFIG, [Location of krb5-config script])
13 AC_ARG_WITH([krb5-conf],[--with-krb5-conf[=krb5-config-location] Use a krb5-config script to configure Kerberos])
14 if test X$with_krb5_conf != X; then
16 if test X$with_krb5_conf = Xyes; then
17 AC_PATH_PROG(KRB5_CONFIG, krb5-config, not_found)
18 if test X$KRB5_CONFIG = Xnot_found; then
19 AC_MSG_ERROR([cannot find krb5-config script, you must configure Kerberos manually])
24 KRB5CFLAGS=`$KRB5_CONFIG --cflags krb5`
26 if test $retval -ne 0; then
27 AC_MSG_ERROR([$KRB5_CONFIG failed with an error code of $retval])
29 KRB5LIBS=`$KRB5_CONFIG --libs krb5`
31 if test $retval -ne 0; then
32 AC_MSG_ERROR([$KRB5_CONFIG failed with an error code of $retval])
34 AC_MSG_RESULT([Adding $KRB5CFLAGS to KRB5CFLAGS])
35 AC_MSG_RESULT([Adding $KRB5LIBS to KRB5LIBS])
38 AC_ARG_WITH([krb5], [--with-krb5 Support for Kerberos 5 (manual configuration)])
40 if test X$with_krb5 = Xyes; then
41 if test X$conf_krb5 = XYES; then
42 AC_MSG_ERROR([--with-krb5-config and --with-krb5 are mutually exclusive, choose only one])
44 if test "X$KRB5CFLAGS" = X; then
45 AC_MSG_WARN([KRB5CFLAGS is not set])
47 if test "X$KRB5LIBS" = X; then
48 AC_MSG_WARN([KRB5LIBS is not set])
54 if test X$conf_krb5 = XYES; then
55 AC_MSG_RESULT([Configuring support for Kerberos 5 utilities])
57 save_CPPFLAGS="$CPPFLAGS"
58 CPPFLAGS="$CPPFLAGS $KRB5CFLAGS"
60 LIBS="$LIBS $KRB5LIBS"
61 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])
62 AC_CHECK_HEADERS([kerberosIV/krb.h])
64 AC_MSG_CHECKING(for krb5_creds.keyblock existance)
65 AC_CACHE_VAL(ac_cv_krb5_creds_keyblock_exists,
69 [struct krb5_creds _c;
70 printf("%x\n", _c.keyblock);],
71 ac_cv_krb5_creds_keyblock_exists=yes,
72 ac_cv_krb5_creds_keyblock_exists=no)])
73 AC_MSG_RESULT($ac_cv_krb5_creds_keyblock_exists)
75 AC_MSG_CHECKING(for krb5_creds.keyblock existance)
76 AC_CACHE_VAL(ac_cv_krb5_creds_session_exists,
80 [struct krb5_creds _c;
81 printf("%x\n", _c.session);],
82 ac_cv_krb5_creds_session_exists=yes,
83 ac_cv_krb5_creds_session_exists=no)])
84 AC_MSG_RESULT($ac_cv_krb5_creds_session_exists)
86 if "x$ac_cv_krb5_creds_keyblock_exists" = "xyes"; then
87 AC_DEFINE(HAVE_KRB5_CREDS_KEYBLOCK, 1, [define if krb5_creds has keyblock])
89 if "x$ac_cv_krb5_creds_session_exists" = "xyes"; then
90 AC_DEFINE(HAVE_KRB5_CREDS_SESSION, 1, [define if krb5_creds has session])
93 dnl AC_CHECK_MEMBERS([krb5_creds.keyblock, krb5_creds.session],,, [#include <krb5.h>])
94 CPPFLAGS="$save_CPPFLAGS"