]> Pileus Git - ~andy/fetchmail/commitdiff
If krb5-config provides gssapi library information, use that rather than guessing.
authorMatthias Andree <matthias.andree@gmx.de>
Sun, 14 May 2006 21:07:20 +0000 (21:07 -0000)
committerMatthias Andree <matthias.andree@gmx.de>
Sun, 14 May 2006 21:07:20 +0000 (21:07 -0000)
svn path=/branches/BRANCH_6-3/; revision=4833

NEWS
configure.ac

diff --git a/NEWS b/NEWS
index 69969d04a5932ef20ce6d15e59dcc60b2c2a46d3..004e6d270dd923bc583e8a80bd7056a763e3d981 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -65,6 +65,8 @@ fetchmail 6.3.5 (not yet released):
 * Drop #include <com_err.h> from Kerberos 5 header file, fixes compile error on
   SUSE Linux 10.0.
 * Fix des_pcbc_encrypt compile warnings in kerberos.c line 246.
+* If krb5-config provides gssapi library information, use that rather than
+  guessing.
 
 # CHANGES:
 * Rename all fetchmail-internal lock_* functions to fm_lock_*. Obsoletes
index 7b47be0fcba05864cdb3a8e1f98e11562a4a8af8..c6078d57f16ba5c77389b42c31499c7e345a3fb0 100644 (file)
@@ -594,7 +594,7 @@ test "$with_ssl" != "no" && AC_DEFINE(SSL_ENABLE,1,Define if you want SSL suppor
 
 if test "$with_ssl" = "yes"
 then
-    #  He didn't specify an SSL location.  Let's look at some common
+    #  User didn't specify an SSL location.  Let's look at some common
     #  directories where SSL has been found in the past and try and auto
     #  configure for SSL.  OpenSSL determination will be made later.
     #  This will screw up if an OpenSSL install is located in a later
@@ -717,29 +717,39 @@ then
   then
     with_gssapi=$with_kerberos5
   fi
+
   if test "$with_gssapi" != "yes" -a -n "$with_gssapi"
   then
     CFLAGS="$CFLAGS -I$with_gssapi/include"
     LDFLAGS="$LDFLAGS -L$with_gssapi/lib"
   fi
 
-  AC_CHECK_LIB(gss, gss_check_version, LIBS="$LIBS -lgss", nogss=t)
-  if test -n "$nogss"
-  then
-  if test -f "$with_gssapi/include/roken.h"
-  then
-     LIBS="$LIBS -lkrb5 -lasn1 -ldes -lroken -ldb -ldl"
-     AC_CHECK_LIB(gssapi, gss_init_sec_context,LIBS="$LIBS -lgssapi",
-                  AC_MSG_ERROR([could not find libgssapi which is needed for GSSAPI support]), )
-     AC_DEFINE(HEIMDAL)
+  dnl obtain gssapi default libs
+  if krb5-config --libs gssapi 2>/dev/null >/dev/null ; then
+      LIBS="$LIBS `krb5-config --libs gssapi`"
   else
-     AC_CHECK_LIB(gssapi_krb5, gss_init_sec_context,LIBS="$LIBS -lgssapi_krb5",
-                  AC_MSG_ERROR([could not find libgssapi_krb5 which is needed for GSSAPI support]), -lkrb5)
-  fi
+    AC_CHECK_LIB(gss, gss_check_version, LIBS="$LIBS -lgss", nogss=t)
+    if test -n "$nogss"
+    then
+      # -lgss not found
+      if test -f "$with_gssapi/include/roken.h"
+      then
+         # have roken.h, assume Heimdal
+         LIBS="$LIBS -lkrb5 -lasn1 -ldes -lroken -ldb -ldl"
+         AC_CHECK_LIB(gssapi, gss_init_sec_context,LIBS="$LIBS -lgssapi",
+                      AC_MSG_ERROR([could not find libgssapi which is needed for GSSAPI support]), )
+         AC_DEFINE(HEIMDAL)
+      else
+         # no roken.h, assume MIT
+         AC_CHECK_LIB(gssapi_krb5, gss_init_sec_context,LIBS="$LIBS -lgssapi_krb5",
+                      AC_MSG_ERROR([could not find libgssapi_krb5 which is needed for GSSAPI support]), -lkrb5)
+      fi
+    fi
   fi
   AC_DEFINE(GSSAPI,1,Define if you want GSSAPI authentication)
-  save_CPPFLAGS=$CPPFLAGS
-  CPPFLAGS="-I$with_gssapi/include"
+  if test "$with_gssapi" != yes ; then
+    CPPFLAGS="-I$with_gssapi/include"
+  fi
   AC_CHECK_HEADERS(gss.h gssapi.h gssapi/gssapi.h gssapi/gssapi_generic.h)
   if test "$ac_cv_header_gssapi_h" = "yes"; then
     AC_EGREP_HEADER(GSS_C_NT_HOSTBASED_SERVICE, gssapi.h, AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE,1,Define if you have MIT kerberos))