+ if test $ac_cv_header_heim_err_h = yes ; then
+ krb5_impl=heimdal
+ else
+ krb5_impl=mit
+ fi
+
+ if test $krb5_impl = mit; then
+ echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
+echo "configure:6035: checking for main in -lkrb5" >&5
+ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
+if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lkrb5 -lcrypto -lcom_err $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 6043 "configure"
+#include "confdefs.h"
+
+int main() {
+main()
+; return 0; }
+EOF
+if { (eval echo configure:6050: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ have_krb5=yes
+ KRB5_LIBS="-lkrb5 -lcrypto -lcom_err"
+else
+ echo "$ac_t""no" 1>&6
+have_krb5=no
+fi
+
+
+ elif test $krb5_impl = heimdal; then
+ echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
+echo "configure:6075: checking for main in -lkrb5" >&5
+ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
+if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 6083 "configure"
+#include "confdefs.h"
+
+int main() {
+main()
+; return 0; }
+EOF
+if { (eval echo configure:6090: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ have_krb5=yes
+ KRB5_LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err"
+else
+ echo "$ac_t""no" 1>&6
+have_krb5=no
+fi
+
+
+ cat >> confdefs.h <<\EOF
+#define HAVE_HEIMDAL_KERBEROS 1
+EOF
+
+ else
+ have_krb5=no
+ echo "configure: warning: Unrecongized Kerberos5 Implementation" 1>&2
+ fi
+
+ if test $have_krb5 = yes ; then
+ ol_link_krb5=yes
+
+ cat >> confdefs.h <<\EOF
+#define HAVE_KRB5 1
+EOF
+
+
+ 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
+ { echo "configure: error: Required Kerberos 5 support not available" 1>&2; exit 1; }
+ fi