Fix line endings.
[shibboleth/resolver.git] / configure.ac
index 52d63d6..c3b411b 100644 (file)
-AC_PREREQ([2.50])\r
-AC_INIT([shibboleth-resolver], [0.1], [shibboleth-users@internet2.edu], [shibboleth-resolver])\r
-AM_CONFIG_HEADER(config.h)\r
-AM_INIT_AUTOMAKE([shibboleth-resolver],[0.1])\r
-\r
-sinclude(acx_pthread.m4)\r
-\r
-AC_ARG_ENABLE(debug,\r
-    AC_HELP_STRING(--enable-debug, [Have GCC compile with symbols (Default = no)\r
-]),\r
-    enable_debug=$enableval, enable_debug=no)\r
-\r
-if test "$enable_debug" = "yes" ; then\r
-    GCC_CFLAGS="$CFLAGS -g -D_DEBUG"\r
-    GCC_CXXFLAGS="$CXXFLAGS -g -D_DEBUG"\r
-else\r
-    GCC_CFLAGS="$CFLAGS -O2 -DNDEBUG"\r
-    GCC_CXXFLAGS="$CXXFLAGS -O2 -DNDEBUG"\r
-fi\r
-\r
-AC_PROG_CC([gcc gcc3 cc])\r
-AC_PROG_CXX([g++ g++3 c++ CC])\r
-AC_CANONICAL_HOST\r
-\r
-if test "$GCC" = "yes" ; then\r
-#    AC_HAVE_GCC_VERSION(4,0,0,0,\r
-#        [\r
-#        AC_DEFINE(GCC_HASCLASSVISIBILITY,1,\r
-#            [Define to enable class visibility control in gcc.])\r
-#        GCC_CFLAGS="$GCC_CFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"\r
-#        GCC_CXXFLAGS="$GCC_CXXFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"\r
-#        ])\r
-    CFLAGS="-Wall $GCC_CFLAGS"\r
-    CXXFLAGS="-Wall $GCC_CXXFLAGS"\r
-else\r
-# Fix for Sun Workshop compiler in debug mode, may be Sun case #6360993\r
-       case "${host_cpu}-${host_os}" in\r
-               *solaris*)\r
-                       if test "$CXX" = "CC" ; then\r
-                               CXXFLAGS="$CXXFLAGS -Qoption ccfe -stabs=no%dfltlit+no%dflthlp"\r
-                       fi\r
-                       ;;\r
-               *osf*)\r
-                       CXXFLAGS="$CXXFLAGS -D_POSIX_PII_SOCKET"\r
-                       ;;\r
-       esac\r
-fi\r
-\r
-AC_DISABLE_STATIC\r
-AC_PROG_LIBTOOL\r
-\r
-AC_LANG(C)\r
-\r
-# Checks for typedefs, structures, and compiler characteristics.\r
-AC_C_CONST\r
-AC_TYPE_SIZE_T\r
-AC_STRUCT_TM\r
-\r
-# Checks for library functions.\r
-AC_CHECK_FUNCS([strcasecmp])\r
-\r
-# checks for pthreads\r
-ACX_PTHREAD([enable_threads="pthread"],[enable_threads="no"])\r
-if test $enable_threads != "pthread"; then\r
-    AC_MSG_ERROR([unable to find pthreads, currently this is required])\r
-else\r
-    AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.])\r
-    LIBS="$PTHREAD_LIBS $LIBS"\r
-    CFLAGS="$PTHREAD_CFLAGS $CFLAGS"\r
-    CXXFLAGS="$PTHREAD_CFLAGS $CXXFLAGS"\r
-fi\r
-\r
-AC_LANG(C++)\r
-\r
-# C++ requirements\r
-AC_CXX_REQUIRE_STL\r
-AC_CXX_NAMESPACES\r
-\r
-# log4shib settings (favor this version over the log4cpp code)\r
-AC_PATH_PROG(LOG4SHIB_CONFIG,log4shib-config)\r
-AC_ARG_WITH(log4shib,\r
-    AC_HELP_STRING([--with-log4shib=PATH], [where log4shib-config is installed]),\r
-    [\r
-    LOG4SHIB_CONFIG="${with_log4shib}"\r
-    if ! test -f "${LOG4SHIB_CONFIG}" ; then\r
-       LOG4SHIB_CONFIG="${with_log4shib}/bin/log4shib-config"\r
-    fi\r
-    ])\r
-if test -f "${LOG4SHIB_CONFIG}"; then\r
-    LDFLAGS="`${LOG4SHIB_CONFIG} --libs` $LDFLAGS"\r
-    CPPFLAGS="`${LOG4SHIB_CONFIG} --cflags` $CPPFLAGS"\r
-       AC_CHECK_HEADER([log4shib/CategoryStream.hh],,AC_MSG_ERROR([unable to find log4shib header files]))\r
-       AC_TRY_LINK(\r
-               [#include <log4shib/Category.hh>\r
-#include <log4shib/CategoryStream.hh>],\r
-               [log4shib::Category::getInstance("foo").errorStream() << log4shib::eol],\r
-               [AC_DEFINE(SHIBRESOLVER_LOG4SHIB,1,[Define if log4shib library is used.])],\r
-               [AC_MSG_ERROR([unable to link with log4shib])])\r
-else\r
-    AC_MSG_WARN([log4shib-config not found, may need to use --with-log4shib option])\r
-    AC_MSG_WARN([will look for original log4cpp library])\r
-    \r
-       # log4cpp settings\r
-       AC_PATH_PROG(LOG4CPP_CONFIG,log4cpp-config)\r
-       AC_ARG_WITH(log4cpp,\r
-           AC_HELP_STRING([--with-log4cpp=PATH], [where log4cpp-config is installed]),\r
-           [\r
-           LOG4CPP_CONFIG="${with_log4cpp}"\r
-           if ! test -f "${LOG4CPP_CONFIG}" ; then\r
-               LOG4CPP_CONFIG="${with_log4cpp}/bin/log4cpp-config"\r
-           fi\r
-           ])\r
-       if test -f "${LOG4CPP_CONFIG}"; then\r
-               AC_MSG_WARN([will try to use log4cpp, note that most non-Internet2 supplied versions are not thread-safe])\r
-           LDFLAGS="`${LOG4CPP_CONFIG} --libs` $LDFLAGS"\r
-           CPPFLAGS="`${LOG4CPP_CONFIG} --cflags` $CPPFLAGS"\r
-               AC_CHECK_HEADER([log4cpp/CategoryStream.hh],,AC_MSG_ERROR([unable to find log4cpp header files]))\r
-               AC_TRY_LINK(\r
-                       [#include <log4cpp/Category.hh>\r
-#include <log4cpp/CategoryStream.hh>],\r
-                       [log4cpp::Category::getInstance("foo").errorStream() << log4cpp::eol],\r
-                       [AC_DEFINE(SHIBRESOLVER_LOG4CPP,1,[Define if log4cpp library is used.])],\r
-                       [AC_MSG_ERROR([unable to link with log4cpp, need version 1.0 or later])])\r
-       else\r
-           AC_MSG_ERROR([log4cpp-config not found, may need to use --with-log4cpp option])\r
-       fi\r
-fi\r
-\r
-# Xerces settings\r
-AC_ARG_WITH(xerces, \r
-            AC_HELP_STRING([--with-xerces=PATH], [where xerces-c is installed]),\r
-            [if test x_$with_xerces != x_/usr; then\r
-                LDFLAGS="-L${with_xerces}/lib $LDFLAGS"\r
-                CPPFLAGS="-I${with_xerces}/include $CPPFLAGS"\r
-            fi])\r
-LIBS="-lxerces-c $LIBS"\r
-AC_CHECK_HEADER([xercesc/dom/DOM.hpp],,\r
-                AC_MSG_ERROR([unable to find xerces header files]))\r
-AC_MSG_CHECKING([Xerces version])\r
-AC_PREPROC_IFELSE(\r
-    [AC_LANG_PROGRAM([#include <xercesc/util/XercesVersion.hpp>],\r
-[#if  _XERCES_VERSION != 20600\r
-int i = 0;\r
-#else\r
-#error cannot use version 2.6.0\r
-#endif])],\r
-    [AC_MSG_RESULT(OK)],\r
-    [AC_MSG_FAILURE([Xerces-C v2.6.0 has bugs that inhibit use with signed XML, please use a newer version])])\r
-AC_TRY_LINK(\r
-        [#include <xercesc/util/PlatformUtils.hpp>],\r
-        [xercesc::XMLPlatformUtils::Initialize()],\r
-        [AC_DEFINE(HAVE_LIBXERCESC,1,[Define if Xerces-C library was found])],\r
-        [AC_MSG_ERROR([unable to link with Xerces])])\r
-\r
-\r
-#XML-Tooling settings\r
-AC_ARG_WITH(xmltooling,\r
-            AC_HELP_STRING([--with-xmltooling=PATH], [where xmltooling-c is installed]),\r
-            [if test x_$with_xmltooling != x_/usr; then\r
-                LDFLAGS="-L${with_xmltooling}/lib $LDFLAGS"\r
-                CPPFLAGS="-I${with_xmltooling}/include $CPPFLAGS"\r
-            fi])\r
-LITE_LIBS="-lxmltooling-lite"\r
-XMLSEC_LIBS="-lxmltooling"\r
-AC_CHECK_HEADER([xmltooling/base.h],,\r
-                AC_MSG_ERROR([unable to find xmltooling header files]))\r
-\r
-# XML-Security settings\r
-AC_ARG_WITH(xmlsec,\r
-            AC_HELP_STRING([--with-xmlsec=PATH], [where xmlsec is installed]),,\r
-            [with_xmlsec=/usr])\r
-\r
-if test x_$with_xmlsec != x_/usr; then\r
-    LDFLAGS="-L${with_xmlsec}/lib $LDFLAGS"\r
-    CPPFLAGS="-I${with_xmlsec}/include $CPPFLAGS"\r
-fi        \r
-XMLSEC_LIBS="-lxml-security-c $XMLSEC_LIBS"\r
-\r
-# save and append master libs\r
-save_LIBS="$LIBS"\r
-LIBS="$XMLSEC_LIBS $LIBS"\r
-\r
-AC_CHECK_HEADER([xsec/utils/XSECPlatformUtils.hpp],,AC_MSG_ERROR([unable to find XML-Security header files]))\r
-AC_MSG_CHECKING([XML-Security version])\r
-AC_PREPROC_IFELSE(\r
-    [AC_LANG_PROGRAM([#include <xsec/utils/XSECPlatformUtils.hpp>],\r
-    [#if XSEC_VERSION_MAJOR > 1 || (XSEC_VERSION_MAJOR == 1 && XSEC_VERSION_MEDIUM > 3)\r
-int i = 0;\r
-#else\r
-#error need version 1.4.0 or later\r
-#endif])],\r
-    [AC_MSG_RESULT(OK)],\r
-    [AC_MSG_FAILURE([XML-Security version 1.4.0 or greater is required.])])\r
-AC_TRY_LINK(\r
-    [#include <xsec/utils/XSECPlatformUtils.hpp>],\r
-    [XSECPlatformUtils::Initialise()],,\r
-    [AC_MSG_ERROR([unable to link with XML-Security])])\r
-\r
-# restore master libs\r
-LIBS="$save_LIBS"\r
-\r
-# OpenSAML settings\r
-AC_ARG_WITH(saml,\r
-    AC_HELP_STRING([--with-saml=PATH], [where saml is installed]),\r
-    [if test x_$with_saml != x_/usr; then\r
-        LDFLAGS="-L${with_saml}/lib $LDFLAGS"\r
-        CPPFLAGS="-I${with_saml}/include $CPPFLAGS"\r
-    fi])\r
-XMLSEC_LIBS="-lsaml $XMLSEC_LIBS"\r
-\r
-# save and append master libs\r
-save_LIBS="$LIBS"\r
-LIBS="$XMLSEC_LIBS $LIBS"\r
-\r
-AC_CHECK_HEADER([saml/saml2/metadata/Metadata.h],,\r
-                AC_MSG_ERROR([unable to find OpenSAML header files]))\r
-AC_TRY_LINK(\r
-       [#include <saml/SAMLConfig.h>],\r
-       [opensaml::SAMLConfig::getConfig()],\r
-    [AC_DEFINE(HAVE_SAML,1,[Define if saml library was found])],\r
-    [AC_MSG_ERROR([unable to link with OpenSAML])])\r
-\r
-# restore master libs\r
-LIBS="$save_LIBS"\r
-\r
-# Shibboleth SP settings\r
-AC_ARG_WITH(shibsp,\r
-    AC_HELP_STRING([--with-shibsp=PATH], [where Shibboleth SP is installed]),\r
-    [if test x_$with_shibsp != x_/usr; then\r
-        LDFLAGS="-L${with_shibsp}/lib $LDFLAGS"\r
-        CPPFLAGS="-I${with_shibsp}/include $CPPFLAGS"\r
-    fi])\r
-LITE_LIBS="-lshibsp-lite $LITE_LIBS"\r
-XMLSEC_LIBS="-lshibsp $XMLSEC_LIBS"\r
-\r
-# save and append master libs\r
-save_LIBS="$LIBS"\r
-LIBS="$XMLSEC_LIBS $LIBS"\r
-\r
-AC_CHECK_HEADER([shibsp/SPConfig.h],,\r
-                AC_MSG_ERROR([unable to find Shibboleth SP header files]))\r
-AC_TRY_LINK(\r
-    [#include <shibsp/SPConfig.h>],\r
-    [shibsp::SPConfig::getConfig()],\r
-    [AC_DEFINE(HAVE_SHIBSP,1,[Define if Shibboleth SP library was found])],\r
-    [AC_MSG_ERROR([unable to link with Shibboleth SP])])\r
-\r
-AC_MSG_CHECKING([whether SP library supports non-plugin remoting])\r
-AC_TRY_COMPILE([#include <shibsp/ServiceProvider.hpp>],\r
-    [shibsp::ServiceProvider* sp;\r
-     sp->regListener(NULL,NULL);\r
-    ],\r
-    [AC_MSG_RESULT([yes])]\r
-    [AC_DEFINE([SHIBRESOLVER_SHIBSP_HAS_REMOTING], [1], [Define to 1 if Shibboleth SP supports non-plugin remoting.])],\r
-    [AC_MSG_RESULT([no])])\r
-\r
-# restore master libs\r
-LIBS="$save_LIBS"\r
-\r
-AC_SUBST(LITE_LIBS)\r
-AC_SUBST(XMLSEC_LIBS)\r
-\r
-AC_CONFIG_FILES([resolver.spec Portfile])\r
-\r
-# output the underlying makefiles\r
-AC_CONFIG_FILES([Makefile doc/Makefile shibresolver/Makefile])\r
-\r
-LIBTOOL="$LIBTOOL --silent"\r
-\r
-AC_OUTPUT\r
+AC_PREREQ([2.50])
+AC_INIT([shibboleth-resolver], [0.1], [shibboleth-users@internet2.edu], [shibboleth-resolver])
+AM_CONFIG_HEADER(config.h)
+AM_INIT_AUTOMAKE([shibboleth-resolver],[0.1])
+
+sinclude(acx_pthread.m4)
+
+AC_ARG_ENABLE(debug,
+    AC_HELP_STRING(--enable-debug, [Have GCC compile with symbols (Default = no)
+]),
+    enable_debug=$enableval, enable_debug=no)
+
+if test "$enable_debug" = "yes" ; then
+    GCC_CFLAGS="$CFLAGS -g -D_DEBUG"
+    GCC_CXXFLAGS="$CXXFLAGS -g -D_DEBUG"
+else
+    GCC_CFLAGS="$CFLAGS -O2 -DNDEBUG"
+    GCC_CXXFLAGS="$CXXFLAGS -O2 -DNDEBUG"
+fi
+
+AC_PROG_CC([gcc gcc3 cc])
+AC_PROG_CXX([g++ g++3 c++ CC])
+AC_CANONICAL_HOST
+
+if test "$GCC" = "yes" ; then
+#    AC_HAVE_GCC_VERSION(4,0,0,0,
+#        [
+#        AC_DEFINE(GCC_HASCLASSVISIBILITY,1,
+#            [Define to enable class visibility control in gcc.])
+#        GCC_CFLAGS="$GCC_CFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
+#        GCC_CXXFLAGS="$GCC_CXXFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
+#        ])
+    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
+
+AC_DISABLE_STATIC
+AC_PROG_LIBTOOL
+
+AC_LANG(C)
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_C_CONST
+AC_TYPE_SIZE_T
+AC_STRUCT_TM
+
+# Checks for library functions.
+AC_CHECK_FUNCS([strcasecmp])
+
+# checks for pthreads
+ACX_PTHREAD([enable_threads="pthread"],[enable_threads="no"])
+if test $enable_threads != "pthread"; then
+    AC_MSG_ERROR([unable to find pthreads, currently this is required])
+else
+    AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.])
+    LIBS="$PTHREAD_LIBS $LIBS"
+    CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
+    CXXFLAGS="$PTHREAD_CFLAGS $CXXFLAGS"
+fi
+
+AC_LANG(C++)
+
+# C++ requirements
+AC_CXX_REQUIRE_STL
+AC_CXX_NAMESPACES
+
+# log4shib settings (favor this version over the log4cpp code)
+AC_PATH_PROG(LOG4SHIB_CONFIG,log4shib-config)
+AC_ARG_WITH(log4shib,
+    AC_HELP_STRING([--with-log4shib=PATH], [where log4shib-config is installed]),
+    [
+    LOG4SHIB_CONFIG="${with_log4shib}"
+    if ! test -f "${LOG4SHIB_CONFIG}" ; then
+       LOG4SHIB_CONFIG="${with_log4shib}/bin/log4shib-config"
+    fi
+    ])
+if test -f "${LOG4SHIB_CONFIG}"; then
+    LDFLAGS="`${LOG4SHIB_CONFIG} --libs` $LDFLAGS"
+    CPPFLAGS="`${LOG4SHIB_CONFIG} --cflags` $CPPFLAGS"
+       AC_CHECK_HEADER([log4shib/CategoryStream.hh],,AC_MSG_ERROR([unable to find log4shib header files]))
+       AC_TRY_LINK(
+               [#include <log4shib/Category.hh>
+#include <log4shib/CategoryStream.hh>],
+               [log4shib::Category::getInstance("foo").errorStream() << log4shib::eol],
+               [AC_DEFINE(SHIBRESOLVER_LOG4SHIB,1,[Define if log4shib library is used.])],
+               [AC_MSG_ERROR([unable to link with log4shib])])
+else
+    AC_MSG_WARN([log4shib-config not found, may need to use --with-log4shib option])
+    AC_MSG_WARN([will look for original log4cpp library])
+    
+       # log4cpp settings
+       AC_PATH_PROG(LOG4CPP_CONFIG,log4cpp-config)
+       AC_ARG_WITH(log4cpp,
+           AC_HELP_STRING([--with-log4cpp=PATH], [where log4cpp-config is installed]),
+           [
+           LOG4CPP_CONFIG="${with_log4cpp}"
+           if ! test -f "${LOG4CPP_CONFIG}" ; then
+               LOG4CPP_CONFIG="${with_log4cpp}/bin/log4cpp-config"
+           fi
+           ])
+       if test -f "${LOG4CPP_CONFIG}"; then
+               AC_MSG_WARN([will try to use log4cpp, note that most non-Internet2 supplied versions are not thread-safe])
+           LDFLAGS="`${LOG4CPP_CONFIG} --libs` $LDFLAGS"
+           CPPFLAGS="`${LOG4CPP_CONFIG} --cflags` $CPPFLAGS"
+               AC_CHECK_HEADER([log4cpp/CategoryStream.hh],,AC_MSG_ERROR([unable to find log4cpp header files]))
+               AC_TRY_LINK(
+                       [#include <log4cpp/Category.hh>
+#include <log4cpp/CategoryStream.hh>],
+                       [log4cpp::Category::getInstance("foo").errorStream() << log4cpp::eol],
+                       [AC_DEFINE(SHIBRESOLVER_LOG4CPP,1,[Define if log4cpp library is used.])],
+                       [AC_MSG_ERROR([unable to link with log4cpp, need version 1.0 or later])])
+       else
+           AC_MSG_ERROR([log4cpp-config not found, may need to use --with-log4cpp option])
+       fi
+fi
+
+# Xerces settings
+AC_ARG_WITH(xerces, 
+            AC_HELP_STRING([--with-xerces=PATH], [where xerces-c is installed]),
+            [if test x_$with_xerces != x_/usr; then
+                LDFLAGS="-L${with_xerces}/lib $LDFLAGS"
+                CPPFLAGS="-I${with_xerces}/include $CPPFLAGS"
+            fi])
+LIBS="-lxerces-c $LIBS"
+AC_CHECK_HEADER([xercesc/dom/DOM.hpp],,
+                AC_MSG_ERROR([unable to find xerces header files]))
+AC_MSG_CHECKING([Xerces version])
+AC_PREPROC_IFELSE(
+    [AC_LANG_PROGRAM([#include <xercesc/util/XercesVersion.hpp>],
+[#if  _XERCES_VERSION != 20600
+int i = 0;
+#else
+#error cannot use version 2.6.0
+#endif])],
+    [AC_MSG_RESULT(OK)],
+    [AC_MSG_FAILURE([Xerces-C v2.6.0 has bugs that inhibit use with signed XML, please use a newer version])])
+AC_TRY_LINK(
+        [#include <xercesc/util/PlatformUtils.hpp>],
+        [xercesc::XMLPlatformUtils::Initialize()],
+        [AC_DEFINE(HAVE_LIBXERCESC,1,[Define if Xerces-C library was found])],
+        [AC_MSG_ERROR([unable to link with Xerces])])
+
+
+#XML-Tooling settings
+AC_ARG_WITH(xmltooling,
+            AC_HELP_STRING([--with-xmltooling=PATH], [where xmltooling-c is installed]),
+            [if test x_$with_xmltooling != x_/usr; then
+                LDFLAGS="-L${with_xmltooling}/lib $LDFLAGS"
+                CPPFLAGS="-I${with_xmltooling}/include $CPPFLAGS"
+            fi])
+LITE_LIBS="-lxmltooling-lite"
+XMLSEC_LIBS="-lxmltooling"
+AC_CHECK_HEADER([xmltooling/base.h],,
+                AC_MSG_ERROR([unable to find xmltooling header files]))
+
+# XML-Security settings
+AC_ARG_WITH(xmlsec,
+            AC_HELP_STRING([--with-xmlsec=PATH], [where xmlsec is installed]),,
+            [with_xmlsec=/usr])
+
+if test x_$with_xmlsec != x_/usr; then
+    LDFLAGS="-L${with_xmlsec}/lib $LDFLAGS"
+    CPPFLAGS="-I${with_xmlsec}/include $CPPFLAGS"
+fi        
+XMLSEC_LIBS="-lxml-security-c $XMLSEC_LIBS"
+
+# save and append master libs
+save_LIBS="$LIBS"
+LIBS="$XMLSEC_LIBS $LIBS"
+
+AC_CHECK_HEADER([xsec/utils/XSECPlatformUtils.hpp],,AC_MSG_ERROR([unable to find XML-Security header files]))
+AC_MSG_CHECKING([XML-Security version])
+AC_PREPROC_IFELSE(
+    [AC_LANG_PROGRAM([#include <xsec/utils/XSECPlatformUtils.hpp>],
+    [#if XSEC_VERSION_MAJOR > 1 || (XSEC_VERSION_MAJOR == 1 && XSEC_VERSION_MEDIUM > 3)
+int i = 0;
+#else
+#error need version 1.4.0 or later
+#endif])],
+    [AC_MSG_RESULT(OK)],
+    [AC_MSG_FAILURE([XML-Security version 1.4.0 or greater is required.])])
+AC_TRY_LINK(
+    [#include <xsec/utils/XSECPlatformUtils.hpp>],
+    [XSECPlatformUtils::Initialise()],,
+    [AC_MSG_ERROR([unable to link with XML-Security])])
+
+# restore master libs
+LIBS="$save_LIBS"
+
+# OpenSAML settings
+AC_ARG_WITH(saml,
+    AC_HELP_STRING([--with-saml=PATH], [where saml is installed]),
+    [if test x_$with_saml != x_/usr; then
+        LDFLAGS="-L${with_saml}/lib $LDFLAGS"
+        CPPFLAGS="-I${with_saml}/include $CPPFLAGS"
+    fi])
+XMLSEC_LIBS="-lsaml $XMLSEC_LIBS"
+
+# save and append master libs
+save_LIBS="$LIBS"
+LIBS="$XMLSEC_LIBS $LIBS"
+
+AC_CHECK_HEADER([saml/saml2/metadata/Metadata.h],,
+                AC_MSG_ERROR([unable to find OpenSAML header files]))
+AC_TRY_LINK(
+       [#include <saml/SAMLConfig.h>],
+       [opensaml::SAMLConfig::getConfig()],
+    [AC_DEFINE(HAVE_SAML,1,[Define if saml library was found])],
+    [AC_MSG_ERROR([unable to link with OpenSAML])])
+
+# restore master libs
+LIBS="$save_LIBS"
+
+# Shibboleth SP settings
+AC_ARG_WITH(shibsp,
+    AC_HELP_STRING([--with-shibsp=PATH], [where Shibboleth SP is installed]),
+    [if test x_$with_shibsp != x_/usr; then
+        LDFLAGS="-L${with_shibsp}/lib $LDFLAGS"
+        CPPFLAGS="-I${with_shibsp}/include $CPPFLAGS"
+    fi])
+LITE_LIBS="-lshibsp-lite $LITE_LIBS"
+XMLSEC_LIBS="-lshibsp $XMLSEC_LIBS"
+
+# save and append master libs
+save_LIBS="$LIBS"
+LIBS="$XMLSEC_LIBS $LIBS"
+
+AC_CHECK_HEADER([shibsp/SPConfig.h],,
+                AC_MSG_ERROR([unable to find Shibboleth SP header files]))
+AC_TRY_LINK(
+    [#include <shibsp/SPConfig.h>],
+    [shibsp::SPConfig::getConfig()],
+    [AC_DEFINE(HAVE_SHIBSP,1,[Define if Shibboleth SP library was found])],
+    [AC_MSG_ERROR([unable to link with Shibboleth SP])])
+
+AC_MSG_CHECKING([whether SP library supports non-plugin remoting])
+AC_TRY_COMPILE([#include <shibsp/ServiceProvider.hpp>],
+    [shibsp::ServiceProvider* sp;
+     sp->regListener(NULL,NULL);
+    ],
+    [AC_MSG_RESULT([yes])]
+    [AC_DEFINE([SHIBRESOLVER_SHIBSP_HAS_REMOTING], [1], [Define to 1 if Shibboleth SP supports non-plugin remoting.])],
+    [AC_MSG_RESULT([no])])
+
+# restore master libs
+LIBS="$save_LIBS"
+
+AC_SUBST(LITE_LIBS)
+AC_SUBST(XMLSEC_LIBS)
+
+AC_CONFIG_FILES([resolver.spec Portfile])
+
+# output the underlying makefiles
+AC_CONFIG_FILES([Makefile doc/Makefile shibresolver/Makefile])
+
+LIBTOOL="$LIBTOOL --silent"
+
+AC_OUTPUT