From 1d3505994cbf22da08b342001a3411279fc32249 Mon Sep 17 00:00:00 2001 From: Matthias Andree Date: Sun, 3 Jul 2005 18:23:16 +0000 Subject: Nalin Dahyabhai's patch to use the krb5-config script, if present. Sent by Miloslav Trmac. svn path=/trunk/; revision=4072 --- NEWS | 2 ++ configure.ac | 28 ++++++++++++++++++++++++++++ kerberos.h | 21 +++++++++++++-------- 3 files changed, 43 insertions(+), 8 deletions(-) diff --git a/NEWS b/NEWS index a0103ce2..a2cc1d5e 100644 --- a/NEWS +++ b/NEWS @@ -83,6 +83,8 @@ fetchmail 6.3.0 (not yet released officially): * Nalin Dahyabhai's fix for sink.c/transact.c to reserve sufficient space for \r\n trailers in snprintf calls. Sent by Miloslav Trmac, possibly fixing Red Hat bug #114470. (Matthias Andree). +* Nalin Dahyabhai's patch to use the krb5-config script, if present. + Sent by Miloslav Trmac. (Matthias Andree) fetchmail-6.2.5 (Wed Oct 15 18:39:22 EDT 2003), 23079 lines: diff --git a/configure.ac b/configure.ac index d98bebe6..06110c4e 100644 --- a/configure.ac +++ b/configure.ac @@ -411,6 +411,17 @@ then AC_DEFINE(KERBEROS_V5,1,Define if you have Kerberos V5) CEFLAGS="$CEFLAGS -I/usr/include/kerberosV" LIBS="$LIBS -lasn1 -lkrb5 -lcom_err -lkafs" +elif krb5-config 2> /dev/null >/dev/null ; then + krb5_prefix=`krb5-config --prefix krb5` + AC_MSG_RESULT([krb5-config points to kerberosV under $krb5_prefix]) + if test -f ${krb5_prefix}/include/et/com_err.h && \ + ! test -f ${krb5_prefix}/include/com_err.h ; then + CEFLAGS="$CEFLAGS -I${krb5_prefix}/include/et" + fi + unset krb5_prefix + CEFLAGS="$CEFLAGS `krb5-config --cflags krb5`" + LIBS="$LIBS `krb5-config --libs krb5`" + AC_DEFINE(KERBEROS_V5) else if test "$with_kerberos5" != "yes" then @@ -486,6 +497,23 @@ then AC_DEFINE(KERBEROS_V4,1,Define if you have Kerberos V4) CEFLAGS="$CEFLAGS -I/usr/include/kerberosIV" LIBS="$LIBS -lkrb -ldes" +elif krb4-config 2> /dev/null >/dev/null ; then + krb4_prefix=`krb4-config --prefix` + AC_MSG_RESULT([krb4-config points to kerberosIV under $krb4_prefix]) + unset krb4_prefix + CEFLAGS="$CEFLAGS `krb4-config --cflags`" + LIBS="$LIBS `krb4-config --libs`" + AC_DEFINE(KERBEROS_V4) +elif krb5-config 2> /dev/null >/dev/null ; then + krb4_prefix=`krb5-config --prefix krb4` + AC_MSG_RESULT([krb5-config points to kerberosIV under $krb4_prefix]) + if test -f ${krb4_prefix}/include/kerberosIV/krb.h ; then + AC_DEFINE(KERBEROS_V4_V5,1,Define if you have Kerberos V4 headers under a kerberosIV directory) + fi + unset krb4_prefix + CEFLAGS="$CEFLAGS `krb5-config --cflags krb4`" + LIBS="$LIBS `krb5-config --libs krb4`" + AC_DEFINE(KERBEROS_V4) else #we need to detect when we're building under a kerberosV compatibility #layer, btw... diff --git a/kerberos.h b/kerberos.h index 32cb93e9..713a505b 100644 --- a/kerberos.h +++ b/kerberos.h @@ -15,14 +15,19 @@ #endif #ifdef KERBEROS_V4 -# if defined (__bsdi__) -# include /* order of includes matters */ -# define krb_get_err_text(e) (krb_err_txt[e]) -# endif -# include -# if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__linux__) -# define krb_get_err_text(e) (krb_err_txt[e]) -# include +# ifdef KERBEROS_V4_V5 +# include +# include +# else +# if defined (__bsdi__) +# include /* order of includes matters */ +# define krb_get_err_text(e) (krb_err_txt[e]) +# endif +# include +# if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__linux__) +# define krb_get_err_text(e) (krb_err_txt[e]) +# include +# endif # endif #endif -- cgit v1.2.3