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],
14 [AS_HELP_STRING([--with-krb5-conf=@<:@krb5-config-location@:>@],
15 [use a krb5-config script to configure Kerberos])])
17 if test X$with_krb5_conf != X; then
19 if test X$with_krb5_conf = Xyes; then
20 AC_PATH_PROG(KRB5_CONFIG, krb5-config, not_found)
21 if test X$KRB5_CONFIG = Xnot_found; then
22 AC_MSG_ERROR([cannot find krb5-config script, you must configure Kerberos manually])
27 KRB5CFLAGS=`$KRB5_CONFIG --cflags krb5`
29 if test $retval -ne 0; then
30 AC_MSG_ERROR([$KRB5_CONFIG failed with an error code of $retval])
32 KRB5LIBS=`$KRB5_CONFIG --libs krb5`
34 if test $retval -ne 0; then
35 AC_MSG_ERROR([$KRB5_CONFIG failed with an error code of $retval])
37 AC_MSG_RESULT([Adding $KRB5CFLAGS to KRB5CFLAGS])
38 AC_MSG_RESULT([Adding $KRB5LIBS to KRB5LIBS])
42 [AS_HELP_STRING([--with-krb5],
43 [support for Kerberos 5 (manual configuration)])])
45 if test X$with_krb5 = Xyes; then
46 if test X$conf_krb5 = XYES; then
47 AC_MSG_ERROR([--with-krb5-config and --with-krb5 are mutually exclusive, choose only one])
49 if test "X$KRB5CFLAGS" = X; then
50 AC_MSG_WARN([KRB5CFLAGS is not set])
52 if test "X$KRB5LIBS" = X; then
53 AC_MSG_WARN([KRB5LIBS is not set])
59 if test X$conf_krb5 = XYES; then
60 AC_MSG_RESULT([Configuring support for Kerberos 5 utilities])
62 save_CPPFLAGS="$CPPFLAGS"
63 CPPFLAGS="$CPPFLAGS $KRB5CFLAGS"
65 LIBS="$LIBS $KRB5LIBS"
66 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])
67 AC_CHECK_FUNCS([krb5_524_convert_creds], ,
68 [AC_CHECK_FUNCS([krb524_convert_creds_kdc], ,
69 [AC_CHECK_LIB([krb524], [krb524_convert_creds_kdc],
70 [LIBS="-lkrb524 $LIBS"
71 KRB5LIBS="-lkrb524 $LIBS"
72 AC_DEFINE([HAVE_KRB524_CONVERT_CREDS_KDC], 1,
73 [Define to 1 if you have the `krb524_convert_creds_kdc' function.])])])])
74 AC_CHECK_HEADERS([kerberosIV/krb.h])
75 AC_CHECK_HEADERS([kerberosV/heim_err.h])
77 AC_MSG_CHECKING(for krb5_creds.keyblock existence)
78 AC_CACHE_VAL(ac_cv_krb5_creds_keyblock_exists,
83 printf("%x\n", _c.keyblock);],
84 ac_cv_krb5_creds_keyblock_exists=yes,
85 ac_cv_krb5_creds_keyblock_exists=no)])
86 AC_MSG_RESULT($ac_cv_krb5_creds_keyblock_exists)
88 AC_MSG_CHECKING(for krb5_creds.session existence)
89 AC_CACHE_VAL(ac_cv_krb5_creds_session_exists,
94 printf("%x\n", _c.session);],
95 ac_cv_krb5_creds_session_exists=yes,
96 ac_cv_krb5_creds_session_exists=no)])
97 AC_MSG_RESULT($ac_cv_krb5_creds_session_exists)
99 AC_MSG_CHECKING(for krb5_prompt.type existence)
100 AC_CACHE_VAL(ac_cv_krb5_prompt_type_exists,
105 printf("%x\n", _p.type);],
106 ac_cv_krb5_prompt_type_exists=yes,
107 ac_cv_krb5_prompt_type_exists=no)])
108 AC_MSG_RESULT($ac_cv_krb5_prompt_type_exists)
110 if test "x$ac_cv_krb5_creds_keyblock_exists" = "xyes"; then
111 AC_DEFINE(HAVE_KRB5_CREDS_KEYBLOCK, 1, [define if krb5_creds has keyblock])
113 if test "x$ac_cv_krb5_creds_session_exists" = "xyes"; then
114 AC_DEFINE(HAVE_KRB5_CREDS_SESSION, 1, [define if krb5_creds has session])
116 if test "x$ac_cv_krb5_prompt_type_exists" = "xyes"; then
117 AC_DEFINE(HAVE_KRB5_PROMPT_TYPE, 1, [define if krb5_prompt has type])
120 dnl AC_CHECK_MEMBERS([krb5_creds.keyblock, krb5_creds.session],,, [#include <krb5.h>])
121 CPPFLAGS="$save_CPPFLAGS"
125 if test "x$ac_cv_krb5_cc_register_exists" = "xyes"; then
126 AC_DEFINE(HAVE_KRB5_CC_REGISTER, 1, [define if krb5_cc_register exists])