2 AC_REVISION($Revision$)
3 AC_DEFUN(modname,[rlm_krb5])
5 if test x$with_[]modname != xno; then
10 dnl extra argument: --with-rlm-krb5-lib-dir
12 AC_ARG_WITH(rlm-krb5-lib-dir,
13 [ --with-rlm-krb5-lib-dir=DIR Directory for krb5 library files []],
16 AC_MSG_ERROR(Need rlm-krb5-lib-dir)
21 rlm_krb5_lib_dir="$withval"
26 dnl extra argument: --with-rlm-krb5-include-dir
28 AC_ARG_WITH(rlm-krb5-include-dir,
29 [ --with-rlm-krb5-include-dir=DIR Directory for krb5 include files []],
32 AC_MSG_ERROR(Need rlm-krb5-include-dir)
37 rlm_krb5_include_dir="$withval"
42 dnl extra argument: --enable-heimdal-krb5
43 AC_ARG_ENABLE(heimdal-krb5,
44 [ --enable-heimdal-krb5 Enable if you have heimdal krb5],
45 [ case "$enableval" in
47 krb5_h_cflags="-DHEIMDAL_KRB5"
52 smart_try_dir=$rlm_krb5_include_dir
53 AC_SMART_CHECK_INCLUDE(krb5.h)
55 smart_try_dir=$rlm_krb5_lib_dir
57 AC_SMART_CHECK_LIB(k5crypto, krb5_encrypt_data)
58 if test "x$ac_cv_lib_k5crypto_krb5_encrypt_data" = "xyes"; then
59 krb5libcrypto="-lk5crypto"
62 AC_SMART_CHECK_LIB(crypto, DH_new)
63 if test "x$ac_cv_lib_crypto_DH_new" = "xyes"; then
64 krb5libcrypto="-lcrypto"
67 if test x$krb5libcrypto = x; then
68 AC_MSG_WARN([neither krb5 'k5crypto' nor 'crypto' libraries are found!])
71 AC_SMART_CHECK_LIB(com_err, set_com_err_hook)
72 if test "x$ac_cv_lib_com_err_set_com_err_hook" != "xyes"; then
73 AC_MSG_WARN([the comm_err library isn't found!])
76 AC_SMART_CHECK_LIB(krb5, krb5_init_context)
77 if test "x$ac_cv_lib_krb5_krb5_init_context" != "xyes"; then
84 echo \*\*\* module modname is disabled.
87 if test x"$fail" != x""; then
88 if test x"${enable_strict_dependencies}" = x"yes"; then
89 AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.])
91 AC_MSG_WARN([silently not building ]modname[.])
92 AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]);
97 krb5_ldflags=$SMART_LIBS
98 krb5_cflags="${krb5_h_cflags} $SMART_CFLAGS"
100 AC_SUBST(krb5_cflags)
101 AC_SUBST(krb5_ldflags)