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])
62 AC_CHECK_FUNCS([krb5_524_convert_creds], ,
63 [AC_CHECK_FUNCS([krb524_convert_creds_kdc], ,
64 [AC_CHECK_LIB([krb524], [krb524_convert_creds_kdc],
65 [LIBS="-lkrb524 $LIBS"
66 KRB5LIBS="-lkrb524 $LIBS"
67 AC_DEFINE([HAVE_KRB524_CONVERT_CREDS_KDC], 1,
68 [Define to 1 if you have the `krb524_convert_creds_kdc' function.])])])])
69 AC_CHECK_HEADERS([kerberosIV/krb.h])
70 AC_CHECK_HEADERS([kerberosV/heim_err.h])
72 AC_MSG_CHECKING(for krb5_creds.keyblock existence)
73 AC_CACHE_VAL(ac_cv_krb5_creds_keyblock_exists,
78 printf("%x\n", _c.keyblock);],
79 ac_cv_krb5_creds_keyblock_exists=yes,
80 ac_cv_krb5_creds_keyblock_exists=no)])
81 AC_MSG_RESULT($ac_cv_krb5_creds_keyblock_exists)
83 AC_MSG_CHECKING(for krb5_creds.session existence)
84 AC_CACHE_VAL(ac_cv_krb5_creds_session_exists,
89 printf("%x\n", _c.session);],
90 ac_cv_krb5_creds_session_exists=yes,
91 ac_cv_krb5_creds_session_exists=no)])
92 AC_MSG_RESULT($ac_cv_krb5_creds_session_exists)
94 if test "x$ac_cv_krb5_creds_keyblock_exists" = "xyes"; then
95 AC_DEFINE(HAVE_KRB5_CREDS_KEYBLOCK, 1, [define if krb5_creds has keyblock])
97 if test "x$ac_cv_krb5_creds_session_exists" = "xyes"; then
98 AC_DEFINE(HAVE_KRB5_CREDS_SESSION, 1, [define if krb5_creds has session])
101 dnl AC_CHECK_MEMBERS([krb5_creds.keyblock, krb5_creds.session],,, [#include <krb5.h>])
102 CPPFLAGS="$save_CPPFLAGS"