Try and hook CPPFLAGS
[shibboleth/sp.git] / configure.ac
index 4737f43..e7b8702 100644 (file)
@@ -1,7 +1,7 @@
 AC_PREREQ([2.50])
-AC_INIT([shibboleth], [1.2.1], [shibboleth-users@internet2.edu], [shibboleth])
+AC_INIT([shibboleth], [1.3], [shibboleth-users@internet2.edu], [shibboleth])
 AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE([shibboleth],[1.2.1])
+AM_INIT_AUTOMAKE([shibboleth],[1.3])
 
 sinclude(acx_pthread.m4)
 sinclude(acx_rpctest.m4)
@@ -12,9 +12,11 @@ AC_ARG_ENABLE(debug,
     enable_debug=$enableval, enable_debug=no)
 
 if test "$enable_debug" = "yes" ; then
+    GCC_CPPFLAGS="$CPPFLAGS -D_DEBUG"
     GCC_CFLAGS="$CFLAGS -g -D_DEBUG"
     GCC_CXXFLAGS="$CXXFLAGS -g -D_DEBUG"
 else
+    GCC_CPPFLAGS="$CPPFLAGS -DNDEBUG"
     GCC_CFLAGS="$CFLAGS -O2 -DNDEBUG"
     GCC_CXXFLAGS="$CXXFLAGS -O2 -DNDEBUG"
 fi
@@ -23,6 +25,7 @@ AC_PROG_CC([gcc gcc3 cc])
 AC_PROG_CXX([g++ g++3 c++ CC])
 
 if test "$GCC" = "yes" ; then
+    CPPFLAGS="$GCC_CPPFLAGS"
     CFLAGS="$GCC_CFLAGS"
     CXXFLAGS="$GCC_CXXFLAGS"
 fi
@@ -186,13 +189,13 @@ AC_CHECK_HEADER([xercesc/dom/DOM.hpp],,
 AC_MSG_CHECKING([Xerces version])
 AC_PREPROC_IFELSE(
         [AC_LANG_PROGRAM([#include <xercesc/util/XercesVersion.hpp>],
-[#if  _XERCES_VERSION != 20600 && _XERCES_VERSION >= 20300
+[#if  _XERCES_VERSION == 20601
 int i = 0;
 #else
-#error cannot use version = 2.6.0 or < 2.3.0
+#error must use patched version 2.6.1 provided by Shibboleth project (http://wayf.internet2.edu/shibboleth/)
 #endif])],
         [AC_MSG_RESULT(OK)],
-        [AC_MSG_FAILURE([Shibboleth requires a Xerces version > 2.3.0, but cannot use 2.6.0 -- a 2.6.1 patched release is available from us])])
+        [AC_MSG_ERROR([Shibboleth requires patched Xerces version 2.6.1 (http://wayf.internet2.edu/shibboleth/)])])
 AC_TRY_LINK(
         [#include <xercesc/util/PlatformUtils.hpp>],
         [xercesc::XMLPlatformUtils::Initialize()],
@@ -208,12 +211,12 @@ AC_ARG_WITH(xmlsec,
                 CPPFLAGS="-I${with_xmlsec}/include $CPPFLAGS"
             fi])
 LIBS="-lxml-security-c $LIBS"
-AC_CHECK_HEADER([xsec/utils/XSECPlatformUtils.hpp],,AC_MSG_ERROR([unable to find xsec header files]))
+AC_CHECK_HEADER([xsec/xenc/XENCEncryptionMethod.hpp],,AC_MSG_ERROR([unable to find xml-security 1.1 header files]),[#include <xercesc/dom/DOM.hpp>])
 AC_TRY_LINK(
         [#include <xsec/utils/XSECPlatformUtils.hpp>],
         [XSECPlatformUtils::Initialise()],
         [AC_DEFINE(HAVE_LIBXSEC,1,[Define if XML-Sec library was found])],
-        [AC_MSG_ERROR([unable to link with XML-Sec])])
+        [AC_MSG_ERROR([unable to link with xml-security])])
 
 # OpenSAML settings
 AC_ARG_WITH(saml,
@@ -228,10 +231,10 @@ LIBS="-lsaml $LIBS"
 AC_TRY_LINK(
        [#include <saml/saml.h>
 #include <saml/version.h>],
-       [#if _OPENSAML_VERSION >= 10000
+       [#if _OPENSAML_VERSION >= 10100
 saml::SAMLConfig::getConfig();
 #else
-#error Need OpenSAML version 1.0 or higher
+#error Need OpenSAML version 1.1 or higher
 #endif],
         [AC_DEFINE(HAVE_SAML,1,[Define if saml library was found])],
         [AC_MSG_ERROR([unable to link with saml, or version too old])])
@@ -241,7 +244,7 @@ WANT_SUBDIRS="doc shib schemas configs shib-target shar siterefresh test xmlprov
 AC_CONFIG_FILES([Makefile doc/Makefile shib/Makefile schemas/Makefile \
                 configs/Makefile oncrpc/Makefile oncrpc/rpc/Makefile \
                 shib-target/Makefile shar/Makefile siterefresh/Makefile \
-                test/Makefile xmlproviders/Makefile])
+                test/Makefile xmlproviders/Makefile selinux/Makefile])
 
 
 # now deal with the rpc library, to see if we need to build our own
@@ -251,6 +254,49 @@ if test $NATIVE_RPC = "no"; then
 fi
 AM_CONDITIONAL(USE_OUR_ONCRPC,test "$NATIVE_RPC" = "no")
 
+#
+# Build NSAPI module?
+#
+AC_MSG_CHECKING(for NSAPI module option)
+AC_ARG_WITH(nsapi,
+       AC_HELP_STRING([--with-nsapi=DIR], [Build NSAPI module for Netscape/iPlanet/SunONE]),
+       [WANT_NSAPI=$withval],[WANT_NSAPI=no])
+AC_MSG_RESULT($WANT_NSAPI)
+
+if test "$WANT_NSAPI" != "no"; then
+  if test ! -d $WANT_NSAPI/bin ; then
+    AC_MSG_ERROR(Please specify the path to the root of your Netscape/iPlanet/SunONE server using --with-nsapi=DIR)
+  fi
+  AC_MSG_CHECKING(for NSAPI include files)
+  if test -d $WANT_NSAPI/include ; then
+    NSAPI_INCLUDE=$WANT_NSAPI/include
+    AC_MSG_RESULT(Netscape-Enterprise 3.x style)
+    AC_CHECK_HEADERS([$NSAPI_INCLUDE/nsapi.h])
+    NSAPI_INCLUDE="$NSAPI_INC_DIR -I$NSAPI_INCLUDE"
+  fi
+  if test -d $WANT_NSAPI/plugins/include ; then
+    test -n "$NSAPI_INCLUDE" && NSAPI_INC_DIR="-I$NSAPI_INCLUDE"
+    NSAPI_INCLUDE="$WANT_NSAPI/plugins/include"
+    AC_MSG_RESULT(iPlanet 4.x / SunONE 6.x style)
+    AC_CHECK_HEADERS([$NSAPI_INCLUDE/nsapi.h])
+    NSAPI_INCLUDE="$NSAPI_INC_DIR -I$NSAPI_INCLUDE"
+  fi
+  if test "$NSAPI_INCLUDE" = ""; then
+    AC_MSG_ERROR(Please check you have nsapi.h in either $WANT_NSAPI/include or $WANT_NSAPI/plugins/include)
+  fi
+fi
+
+AC_SUBST(NSAPI_INCLUDE)
+
+# always output the Makefile, even if you don't use it
+AC_CONFIG_FILES([nsapi_shib/Makefile])
+AM_CONDITIONAL(BUILD_NSAPI,test ! "$WANT_NSAPI" = "no")
+
+# add the NSAPI module to the list of wanted subdirs..
+if test ! "$WANT_NSAPI" = "no" ; then
+    WANT_SUBDIRS="$WANT_SUBDIRS nsapi_shib"
+fi
+
 
 # Apache 1.3 (mod_shib_13)
 #   --enable-apache-13