Fix GSS extension tests and headers for Heimdal/GNU
[shibboleth/cpp-sp-resolver.git] / configure.ac
index 9803375..eba8497 100644 (file)
@@ -378,35 +378,38 @@ if test x"$want_gss" = xyes; then
   if test -n "$gnu_gss"; then
     LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
     LIBS="$LIBS -lgss"
-  elif test -z "$GSSAPI_LIB_DIR"; then
-     case $host in
-     *-*-darwin*)
-        LIBS="$LIBS -lgssapi_krb5 -lresolv"
-        ;;
-     *)
-        if test -f "$GSSAPI_ROOT/bin/krb5-config"; then
-           dnl krb5-config doesn't have --libs-only-L or similar, put everything
-           dnl into LIBS
-           gss_libs=`$GSSAPI_ROOT/bin/krb5-config --libs gssapi`
-           LIBS="$LIBS $gss_libs"
-        elif test "$GSSAPI_ROOT" != "yes"; then
-           LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff"
-           LIBS="$LIBS -lgssapi"
-        else
-           LIBS="$LIBS -lgssapi"
-        fi
-        ;;
-     esac
   else
-     LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
-     LIBS="$LIBS -lgssapi"
+    if test -z "$GSSAPI_LIB_DIR"; then
+      GSSAPI_LIB_DIR="$GSSAPI_ROOT/lib$libsuff"
+    fi
+    if test "$GSSAPI_ROOT" != "yes"; then
+       LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff"
+    fi
+    if test -f "$GSSAPI_ROOT/bin/krb5-config"; then
+      dnl krb5-config does not have --libs-only-L or similar, put everything into LIBS
+      gss_libs=`$GSSAPI_ROOT/bin/krb5-config --libs gssapi`
+    else
+      if test "x$not_mit" = "x1"; then
+        gss_libs="-lgssapi"
+      else
+        gss_libs="-lgssapi_krb5"
+      fi
+    fi
+    LIBS="$LIBS $gss_libs"
   fi
 
   AC_MSG_CHECKING([whether GSS-API naming extensions are available])
   AC_COMPILE_IFELSE(
-    [AC_LANG_PROGRAM([[#include <gssapi/gssapi_ext.h>]],
+    [AC_LANG_PROGRAM([[
+#ifdef SHIBRESOLVER_HAVE_GSSGNU
+# include <gss.h>
+#elif defined SHIBRESOLVER_HAVE_GSSMIT
+# include <gssapi/gssapi_ext.h>
+#else
+# include <gssapi.h>
+#endif]],
     [[gss_get_name_attribute(NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);]])],
-    [AC_MSG_RESULT([yes])AC_DEFINE([HAVE_GSSAPI_NAMINGEXTS],[1],[Define to 1 if GSS-API naming extensions are available.])],
+    [AC_MSG_RESULT([yes])AC_DEFINE([SHIBRESOLVER_HAVE_GSSAPI_NAMINGEXTS],[1],[Define to 1 if GSS-API naming extensions are available.])],
     [AC_MSG_RESULT([no])])
 
 else