diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | configure.in | 65 |
2 files changed, 52 insertions, 17 deletions
@@ -1,3 +1,7 @@ +2000-08-30 Peter Williams <peterw@helixcode.com> + + * configure.in: Robustify the kerberos checks. + 2000-08-29 Dan Winship <danw@helixcode.com> * configure.in, acconfig.h: decruft diff --git a/configure.in b/configure.in index 1b5a2e8ceb..a163f4da98 100644 --- a/configure.in +++ b/configure.in @@ -386,26 +386,57 @@ dnl Kerberos dnl ******** AC_ARG_WITH(krb5, [ --with-krb5=PREFIX Location of Kerberos 5 libs/includes]) AC_ARG_WITH(krb4, [ --with-krb4=PREFIX Location of Kerberos 4 libs/includes]) -AC_MSG_CHECKING(for Kerberos 5) -AC_MSG_RESULT(${with_krb5:=no}) -if test x$with_krb5 != xno; then - KRB5_CFLAGS="-I$with_krb5/include/krb5" - KRB5_LDFLAGS="-L$with_krb5/lib -lkrb5 -lk5crypto -lcom_err" - AC_DEFINE(HAVE_KRB5) +if test x${with_krb5:=no} != xno; then + CFLAGS_save="$CFLAGS" + LDFLAGS_save="$LDFLAGS" + CFLAGS="-I$with_krb5/include/krb5" + LDFLAGS="-L$with_krb5/lib" + AC_CHECK_LIB(krb5, krb5_init_context, + [ + AC_DEFINE(HAVE_KRB5) + KRB5_CFLAGS="$CFLAGS" + KRB5_LDFLAGS="$LDFLAGS -lkrb5 -lk5crypto -lcom_err" + ],[ + AC_MSG_WARN([A sample Kerberos 5 program could not be compiled with the +Kerberos found in $with_krb5. Please verify that the prefix is correct.]) + with_krb5=no + ], [-lk5crypto -lcom_err]) + CFLAGS="$CFLAGS_save" + LDFLAGS="$LIBS_save" +else + AC_MSG_CHECKING(for Kerberos 5) + AC_MSG_RESULT($with_krb5) fi -AC_MSG_CHECKING(for Kerberos 4) -AC_MSG_RESULT(${with_krb4:=no}) -if test x$with_krb4 != xno; then - KRB4_CFLAGS="-I$with_krb4/include -I$with_krb4/include/kerberosIV $KRB5_CFLAGS" - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -L$with_krb4/lib" + +if test x${with_krb4:=no} != xno; then + CFLAGS_save="$CFLAGS" + LDFLAGS_save="$LDFLAGS" + CFLAGS="-I$with_krb4/include" + LDFLAGS="-L$with_krb4/lib" AC_CHECK_LIB(krb, krb_mk_req, - [KRB4_LDFLAGS="-L$with_krb4/lib -lkrb -ldes"], - [KRB4_LDFLAGS="-L$with_krb4/lib -lkrb4 -ldes425 -lkrb5 -lk5crypto -lcom_err"], - -ldes) - LDFLAGS="$save_LDFLAGS" - AC_DEFINE(HAVE_KRB4) + [ + AC_DEFINE(HAVE_KRB4) + KRB4_CFLAGS="$CFLAGS" + KRB4_LDFLAGS="$LDFLAGS -lkrb -ldes" + ],[ + AC_CHECK_LIB(krb4, krb_mk_req, + [ + AC_DEFINE(HAVE_KRB4) + KRB4_CFLAGS="$CFLAGS" + KRB4_LDFLAGS="$LDFLAGS -lkrb4 -ldes425 $KRB5_LDFLAGS" + ],[ + AC_MSG_WARN([A sample Kerberos 4 program could not be compiled with the +Kerberos found in $with_krb4. Please verify that the prefix is correct.]) + with_krb4=no + ],[-ldes425 $KRB5_LDFLAGS]) + ], [-ldes]) + CFLAGS="$CFLAGS_save" + LDFLAGS="$LIBS_save" +else + AC_MSG_CHECKING(for Kerberos 4) + AC_MSG_RESULT(${with_krb4}) fi + AC_SUBST(KRB5_CFLAGS) AC_SUBST(KRB5_LDFLAGS) AC_SUBST(KRB4_CFLAGS) |