Update specfile for RH7
[shibboleth/cpp-sp-resolver.git] / configure.ac
index 9803375..06cc7d3 100644 (file)
@@ -1,5 +1,5 @@
 AC_PREREQ([2.50])
-AC_INIT([shibboleth-resolver], [0.2], [MOONSHOT-COMMUNITY@JISCMAIL.AC.UK], [shibboleth-resolver])
+AC_INIT([shibboleth-resolver], [0.3], [MOONSHOT-COMMUNITY@JISCMAIL.AC.UK], [shibboleth-resolver])
 AC_CONFIG_SRCDIR(src)
 AC_CONFIG_AUX_DIR(build-aux)
 AC_CONFIG_MACRO_DIR(m4)
@@ -37,20 +37,20 @@ if test "$GCC" = "yes" ; then
 #        ])
     CFLAGS="-Wall $GCC_CFLAGS"
     CXXFLAGS="-Wall $GCC_CXXFLAGS"
-else
-# Fix for Sun Workshop compiler in debug mode, may be Sun case #6360993
-       case "${host_cpu}-${host_os}" in
-               *solaris*)
-                       if test "$CXX" = "CC" ; then
-                               CXXFLAGS="$CXXFLAGS -Qoption ccfe -stabs=no%dfltlit+no%dflthlp"
-                       fi
-                       ;;
-               *osf*)
-                       CXXFLAGS="$CXXFLAGS -D_POSIX_PII_SOCKET"
-                       ;;
-       esac
 fi
 
+# Fix for Sun Workshop compiler in debug mode, may be Sun case #6360993
+# Also enables POSIX semantics for some functions.
+case "${host_cpu}-${host_os}" in
+    *solaris*)
+       CFLAGS="$CFLAGS -D_POSIX_PTHREAD_SEMANTICS"
+       CXXFLAGS="$CXXFLAGS -D_POSIX_PTHREAD_SEMANTICS"
+       if test "$CXX" = "CC" ; then
+               CXXFLAGS="$CXXFLAGS -Qoption ccfe -stabs=no%dfltlit+no%dflthlp"
+       fi
+    ;;
+esac
+
 AC_LANG(C)
 
 # Checks for typedefs, structures, and compiler characteristics.
@@ -378,35 +378,39 @@ 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.h>
+# 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