From a52e0a601e801dd3d365e84b352da809b3bcab60 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Wed, 30 Aug 2000 19:46:06 +0000 Subject: Robustify the kerberos checks svn path=/trunk/; revision=5118 --- configure.in | 65 ++++++++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 48 insertions(+), 17 deletions(-) (limited to 'configure.in') 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) -- cgit