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 != X; 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])
60 if test X$conf_krb5 = XYES; then
61 AC_MSG_RESULT([Configuring support for Kerberos 5 utilities])
64 save_CPPFLAGS="$CPPFLAGS"
65 CPPFLAGS="$CPPFLAGS $KRB5CFLAGS"
67 LIBS="$LIBS $KRB5LIBS"
68 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_decode_ticket krb5_get_prompt_types krb5_allow_weak_crypto krb5_enctype_enable krb5_svc_get_msg])
69 AC_CHECK_FUNCS([krb5_524_convert_creds], ,
70 [AC_CHECK_FUNCS([krb524_convert_creds_kdc], ,
71 [AC_CHECK_LIB([krb524], [krb524_convert_creds_kdc],
72 [LIBS="-lkrb524 $LIBS"
73 KRB5LIBS="-lkrb524 $LIBS"
74 AC_DEFINE([HAVE_KRB524_CONVERT_CREDS_KDC], 1,
75 [Define to 1 if you have the `krb524_convert_creds_kdc' function.])])])])
76 AC_CHECK_HEADERS([kerberosIV/krb.h])
77 AC_CHECK_HEADERS([kerberosV/heim_err.h])
79 AC_CHECK_MEMBERS([krb5_creds.keyblock,
82 [], [], [#include <krb5.h>])
84 CPPFLAGS="$save_CPPFLAGS"