Improve logging around XML processing of content.
[shibboleth/sp.git] / configure.ac
index ff6ebd9..74d787d 100644 (file)
@@ -1,7 +1,7 @@
 AC_PREREQ([2.50])
-AC_INIT([shibboleth], [2.3], [shibboleth-users@internet2.edu], [shibboleth])
+AC_INIT([shibboleth], [2.4], [shibboleth-users@internet2.edu], [shibboleth])
 AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE([shibboleth],[2.3])
+AM_INIT_AUTOMAKE([shibboleth],[2.4])
 
 sinclude(doxygen.m4)
 sinclude(acx_pthread.m4)
@@ -98,7 +98,7 @@ if test "x$SSLFLAGS" = "x" ; then
         if pkg-config openssl ; then
             SSLFLAGS="`$PKG_CONFIG --cflags openssl`"
         else
-            AC_MSG_ERROR([OpenSSL not supported by pkg-config, try --with-openssl instead])
+            AC_MSG_WARN([OpenSSL not supported by pkg-config, try --with-openssl instead])
         fi
     fi
 fi
@@ -157,7 +157,7 @@ AC_ARG_WITH(log4shib,
     fi
     ])
 if test -f "${LOG4SHIB_CONFIG}"; then
-    LDFLAGS="`${LOG4SHIB_CONFIG} --libs` $LDFLAGS"
+    LIBS="`${LOG4SHIB_CONFIG} --libs` $LIBS"
     CPPFLAGS="`${LOG4SHIB_CONFIG} --cflags` $CPPFLAGS"
        AC_CHECK_HEADER([log4shib/CategoryStream.hh],,AC_MSG_ERROR([unable to find log4shib header files]))
        AC_TRY_LINK(
@@ -182,7 +182,7 @@ else
            ])
        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"
+           LIBS="`${LOG4CPP_CONFIG} --libs` $LIBS"
            CPPFLAGS="`${LOG4CPP_CONFIG} --cflags` $CPPFLAGS"
                AC_CHECK_HEADER([log4cpp/CategoryStream.hh],,AC_MSG_ERROR([unable to find log4cpp header files]))
                AC_TRY_LINK(
@@ -258,6 +258,20 @@ LITE_LIBS="-lxmltooling-lite"
 XMLSEC_LIBS="-lxmltooling"
 AC_CHECK_HEADER([xmltooling/base.h],,
                 AC_MSG_ERROR([unable to find xmltooling header files]))
+                
+
+# save and append master libs
+save_LIBS="$LIBS"
+LIBS="$XMLSEC_LIBS $LIBS"
+
+AC_TRY_LINK(
+    [#include <xmltooling/io/HTTPResponse.h>],
+    [xmltooling::HTTPResponse::sanitizeURL("http://test")],
+    [AC_DEFINE(HAVE_XMLTOOLING,1,[Define if xmltooling library was found])],
+    [AC_MSG_ERROR([unable to link with XMLTooling, or version was too old])])
+
+# restore master libs
+LIBS="$save_LIBS"
 
 # Establish location of xmltooling catalog.
 XMLTOOLINGXMLDIR=""
@@ -292,8 +306,8 @@ XMLSEC_LIBS="-lxml-security-c $XMLSEC_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_CHECK_HEADER([xsec/utils/XSECPlatformUtils.hpp],,AC_MSG_ERROR([unable to find XML-Security-C header files]))
+AC_MSG_CHECKING([XML-Security-C 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)
@@ -302,12 +316,21 @@ int i = 0;
 #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_MSG_FAILURE([XML-Security-C 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])])
 
+
+AC_MSG_CHECKING([whether XML-Security-C supports white/blacklisting of algorithms])
+AC_TRY_COMPILE([#include <xsec/framework/XSECAlgorithmMapper.hpp>],
+      [XSECAlgorithmMapper* mapper; mapper->whitelistAlgorithm(NULL);],
+      [AC_MSG_RESULT([yes])]
+      [AC_DEFINE([SHIBSP_XMLSEC_WHITELISTING], [1], [Define to 1 if XML-Security-C supports white/blacklisting algorithms.])],
+      [AC_MSG_RESULT([no])])
+
+
 # restore master libs
 LIBS="$save_LIBS"
 
@@ -712,14 +735,14 @@ if test "$WANT_APACHE_20" = "yes" ; then
         AC_PATH_PROG(APU_CONFIG, apu-config,,[`$APXS2 -q SBINDIR`]:[$PATH])
         ])
     if test -f "${APU_CONFIG}"; then
-        APU_CFLAGS="`${APU_CONFIG} --cflags` `${APU_CONFIG} --cppflags` `${APU_CONFIG} --includes`"
+        APU_CFLAGS="`${APU_CONFIG} --includes`"
     else
         AC_MSG_ERROR([Unable to locate apu-config, may need --with-apu option.])
     fi
 
     # extract settings we need from APXS2 -q
     APXS2_CC="`$APXS2 -q CC`"
-    APXS2_CFLAGS="`$APXS2 -q CPPFLAGS` `$APXS2 -q CFLAGS` $APU_CFLAGS"
+    APXS2_CFLAGS="`$APXS2 -q CPPFLAGS` `$APXS2 -q CFLAGS` $APR_CFLAGS $APU_CFLAGS"
     APXS2_INCLUDE="`$APXS2 -q INCLUDEDIR`"
 fi
 
@@ -825,7 +848,7 @@ if test "$WANT_APACHE_22" = "yes" ; then
         AC_PATH_PROG(APU1_CONFIG, apu-1-config,,[`$APXS22 -q SBINDIR`]:[$PATH])
         ])
     if test -f "${APU1_CONFIG}"; then
-        APU1_CFLAGS="`${APU1_CONFIG} --cflags` `${APU1_CONFIG} --cppflags` `${APU1_CONFIG} --includes`"
+        APU1_CFLAGS="`${APU1_CONFIG} --includes`"
     else
         AC_MSG_ERROR([Unable to locate apu-1-config, may need --with-apu1 option.])
     fi