+dnl ----------------------------------------------------------------
+dnl Kerberos
+ol_link_kbind=no
+ol_link_kpasswd=no
+ol_link_krb5=no
+ol_link_krb4=no
+
+if test $ol_with_kerberos = auto -o $ol_with_kerberos = k5 \
+ -o $ol_with_kerberos = k5only -o $ol_with_kerberos = k425 ; then
+
+ AC_CHECK_HEADERS(krb5.h)
+
+ if test $ac_cv_header_krb5_h = yes ; then
+ dnl lazy check for Heimdal Kerberos
+ AC_CHECK_HEADERS(heim_err.h)
+ if test $ac_cv_header_heim_err_h = yes ; then
+ krb5_impl=heimdal
+ else
+ krb5_impl=mit
+ fi
+
+ if test $krb5_impl = mit; then
+ AC_CHECK_LIB(krb5, main,
+ [have_krb5=yes
+ KRB5_LIBS="-lkrb5 -lcrypto -lcom_err"],
+ [have_krb5=no],
+ [-lcrypto -lcom_err])
+
+ elif test $krb5_impl = heimdal; then
+ AC_CHECK_LIB(krb5, main,
+ [have_krb5=yes
+ KRB5_LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err"],
+ [have_krb5=no],
+ [-ldes -lasn1 -lroken -lcom_err])
+
+ AC_DEFINE(HAVE_HEIMDAL_KERBEROS, 1,
+ [define if you have HEIMDAL Kerberos])
+ else
+ have_krb5=no
+ AC_MSG_WARN([Unrecongized Kerberos5 Implementation])
+ fi
+
+ if test $have_krb5 = yes ; then
+ ol_link_krb5=yes
+
+ AC_DEFINE(HAVE_KRB5, 1,
+ [define if you have Kerberos V])
+
+ if test $ol_enable_kpasswd != no ; then
+ ol_link_kpasswd=yes;
+ fi
+
+ if test $ol_with_kerberos = k5only ; then
+ ol_with_kerberos=found
+ fi
+
+ elif test $ol_with_kerberos != auto ; then
+ AC_MSG_ERROR([Required Kerberos 5 support not available])
+ fi
+
+ fi
+fi
+
+if test $ol_link_krb5 = yes -a \
+ \( $ol_with_kerberos = auto -o $ol_with_kerberos = k425 \) ; then