2 AC_INIT([xmltooling], [1.0], [mace-opensaml-users@internet2.edu], [xmltooling])
3 AM_CONFIG_HEADER(config.h)
4 AM_CONFIG_HEADER(xmltooling/config_pub.h)
5 AM_INIT_AUTOMAKE([xmltooling], [1.0])
18 DX_INIT_DOXYGEN(xmltooling, doxygen.cfg, doc/api)
21 AC_HELP_STRING(--enable-debug, [Have GCC compile with symbols (Default = no)]),
22 enable_debug=$enableval, enable_debug=no)
24 if test "$enable_debug" = "yes" ; then
25 GCC_CFLAGS="$CFLAGS -Wall -g -D_DEBUG"
26 GCC_CXXFLAGS="$CXXFLAGS -Wall -g -D_DEBUG"
28 GCC_CFLAGS="$CFLAGS -Wall -O2 -DNDEBUG"
29 GCC_CXXFLAGS="$CXXFLAGS -Wall -O2 -DNDEBUG"
32 AC_PROG_CC([gcc gcc3 cc])
33 AC_PROG_CXX([g++ g++3 c++ CC])
35 if test "$GCC" = "yes" ; then
37 CXXFLAGS="$GCC_CXXFLAGS"
51 # Checks for typedefs, structures, and compiler characteristics.
55 # Checks for library functions.
56 AC_CHECK_FUNCS([strchr strdup strstr])
57 AC_CHECK_HEADERS([dlfcn.h])
58 AC_CHECK_FUNC(dlclose, , [ AC_CHECK_LIB(dl, dlopen) ])
63 AC_PATH_PROG(LOG4CPP_CONFIG,log4cpp-config)
65 AC_HELP_STRING([--with-log4cpp=PATH], [where log4cpp is installed]),
66 [LOG4CPP_CONFIG="${with_log4cpp}/bin/log4cpp-config"])
67 if test -f "${LOG4CPP_CONFIG}"; then
68 LDFLAGS="`${LOG4CPP_CONFIG} --libs` $LDFLAGS"
69 CPPFLAGS="`${LOG4CPP_CONFIG} --cflags` $CPPFLAGS"
71 AC_MSG_WARN([log4cpp-config not found, guessing at log4cpp build settings])
72 LIBS="-llog4cpp $LIBS"
74 AC_CHECK_HEADER([log4cpp/Category.hh],,AC_MSG_ERROR([unable to find log4cpp header files]))
75 AC_CHECK_HEADER([log4cpp/PropertyConfigurator.hh],,AC_MSG_ERROR([you need at least log4cpp 0.3.x]))
77 [#include <log4cpp/Category.hh>],
78 [log4cpp::Category::getInstance("foo")],
79 [AC_DEFINE(HAVE_LIBLOG4CPP,1,[Define if log4cpp library was found])],
80 [AC_MSG_ERROR([unable to link with log4cpp])])
84 AC_HELP_STRING([--with-xerces=PATH], [where xerces-c is installed]),
85 [if test x_$with_xerces != x_/usr; then
86 LDFLAGS="-L${with_xerces}/lib $LDFLAGS"
87 CPPFLAGS="-I${with_xerces}/include $CPPFLAGS"
89 LIBS="-lxerces-c $LIBS"
90 AC_CHECK_HEADER([xercesc/dom/DOM.hpp],,AC_MSG_ERROR([unable to find xerces header files]))
91 AC_MSG_CHECKING([Xerces version])
93 [AC_LANG_PROGRAM([#include <xercesc/util/XercesVersion.hpp>],
94 [#if _XERCES_VERSION != 20600
97 #error cannot use version 2.6.0
100 [AC_MSG_FAILURE([Xerces-C v2.6.0 has bugs that inhibit use with signed XML, please use special 2.6.1 tarball provided by Shibboleth Project])])
102 [#include <xercesc/util/PlatformUtils.hpp>],
103 [xercesc::XMLPlatformUtils::Initialize()],
104 [AC_DEFINE(HAVE_LIBXERCESC,1,[Define if Xerces-C library was found])],
105 [AC_MSG_ERROR([unable to link with Xerces])])
108 # XML-Security settings
110 AC_HELP_STRING([--with-xmlsec=PATH], [where xmlsec is installed]),,
113 if test x_$with_xmlsec != x_no; then
114 if test x_$with_xmlsec != x_/usr; then
115 LDFLAGS="-L${with_xmlsec}/lib $LDFLAGS"
116 CPPFLAGS="-I${with_xmlsec}/include $CPPFLAGS"
118 LIBS="-lxml-security-c $LIBS"
119 AC_CHECK_HEADER([xsec/utils/XSECPlatformUtils.hpp],,AC_MSG_ERROR([unable to find XML-Security header files]))
120 AC_MSG_CHECKING([XML-Security version])
122 [AC_LANG_PROGRAM([#include <xsec/utils/XSECPlatformUtils.hpp>],
123 [#if XSEC_VERSION_MAJOR > 1 || XSEC_VERSION_MEDIUM >2
126 #error need version 1.3 or later
129 [AC_MSG_FAILURE([XML-Security version 1.3 or greater is required.])])
131 [#include <xsec/utils/XSECPlatformUtils.hpp>],
132 [XSECPlatformUtils::Initialise()],,
133 [AC_MSG_ERROR([unable to link with XML-Sec])])
135 AC_MSG_WARN([xmlsec disabled, building without signature/encryption support])
136 AC_DEFINE(XMLTOOLING_NO_XMLSEC,1,
137 [Define if you wish to disable XML-Security-dependent features.])
139 AM_CONDITIONAL(BUILD_XMLSEC,test x_$with_xmlsec != x_no)
141 # Does the STL in use help or screw us?
144 [std::basic_string<unsigned short> foo; foo=foo+(unsigned short)65],
145 [AC_DEFINE(HAVE_GOOD_STL,1,
146 [Define if you have an STL implementation that supports useful string specialization.])],
149 # Check for unit test support
150 CXXTEST="/usr/bin/cxxtestgen.pl"
153 AC_HELP_STRING([--with-cxxtest=PATH], [where cxxtest is installed]),
154 [if test x_$with_cxxtest != x_/usr; then
155 CXXTEST="${with_cxxtest}/cxxtestgen.pl"
156 CXXTESTFLAGS="-I${with_cxxtest}"
158 if ! test -f "${CXXTEST}"; then
159 AC_MSG_WARN([cxxtestgen not found, won't build unit tests])
163 AC_SUBST(CXXTESTFLAGS)
164 AM_CONDITIONAL(BUILD_UNITTEST,test -f ${CXXTEST})
166 LIBTOOL="$LIBTOOL --silent"
169 AC_OUTPUT(Makefile xmltooling/Makefile xmltoolingtest/Makefile schemas/Makefile)