2 AC_INIT([opensaml], [2.0], [mace-opensaml-users@internet2.edu], [saml])
3 AM_CONFIG_HEADER(config.h)
4 #AM_CONFIG_HEADER(saml/config_pub.h)
5 AM_INIT_AUTOMAKE([opensaml], [2.0])
18 DX_INIT_DOXYGEN(opensaml, doxygen.cfg, doc/api)
22 AC_HELP_STRING(--enable-debug, [Have GCC compile with symbols (Default = no)]),
23 enable_debug=$enableval, enable_debug=no)
25 if test "$enable_debug" = "yes" ; then
26 GCC_CFLAGS="$CFLAGS -Wall -g -D_DEBUG"
27 GCC_CXXFLAGS="$CXXFLAGS -Wall -g -D_DEBUG"
29 GCC_CFLAGS="$CFLAGS -Wall -O2 -DNDEBUG"
30 GCC_CXXFLAGS="$CXXFLAGS -Wall -O2 -DNDEBUG"
33 AC_PROG_CC([gcc gcc3 cc])
34 AC_PROG_CXX([g++ g++3 c++ CC])
37 if test "$GCC" = "yes" ; then
38 # AC_HAVE_GCC_VERSION(4,0,0,0,
40 # AC_DEFINE(GCC_HASCLASSVISIBILITY,1,
41 # [Define to enable class visibility control in gcc.])
42 # GCC_CFLAGS="$GCC_CFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
43 # GCC_CXXFLAGS="$GCC_CXXFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
46 CXXFLAGS="$GCC_CXXFLAGS"
48 # Fix for Sun Workshop compiler in debug mode, may be Sun case #6360993
49 case "${host_cpu}-${host_os}" in
51 if test "$CXX" = "CC" ; then
52 CXXFLAGS="$CXXFLAGS -Qoption ccfe -stabs=no%dfltlit+no%dflthlp"
61 # Checks for typedefs, structures, and compiler characteristics.
65 # Checks for library functions.
66 AC_CHECK_FUNCS([strchr strdup strstr])
68 AC_CHECK_SIZEOF(time_t)
72 AC_HELP_STRING([--with-zlib=PATH], [where zlib is installed]),
74 if test -d "$withval"; then
75 CPPFLAGS="${CPPFLAGS} -I$withval/include"
76 LDFLAGS="${LDFLAGS} -L$withval/lib"
80 AC_CHECK_HEADER([zlib.h],,AC_MSG_ERROR([unable to find zlib header files]))
81 AC_CHECK_LIB([z],[deflateInit2_],,AC_MSG_ERROR([unable to link with zlib library]))
90 AC_PATH_PROG(LOG4CPP_CONFIG,log4cpp-config)
92 AC_HELP_STRING([--with-log4cpp=PATH], [where log4cpp-config is installed]),
94 LOG4CPP_CONFIG="${with_log4cpp}"
95 if ! test -f "${LOG4CPP_CONFIG}" ; then
96 LOG4CPP_CONFIG="${with_log4cpp}/bin/log4cpp-config"
99 if test -f "${LOG4CPP_CONFIG}"; then
100 LDFLAGS="`${LOG4CPP_CONFIG} --libs` $LDFLAGS"
101 CPPFLAGS="`${LOG4CPP_CONFIG} --cflags` $CPPFLAGS"
103 AC_MSG_ERROR([log4cpp-config not found, may need to use --with-log4cpp option])
104 LIBS="-llog4cpp $LIBS"
106 AC_CHECK_HEADER([log4cpp/Category.hh],,AC_MSG_ERROR([unable to find log4cpp header files]))
107 AC_CHECK_HEADER([log4cpp/PropertyConfigurator.hh],,AC_MSG_ERROR([you need at least log4cpp 0.3.x]))
109 [#include <log4cpp/Category.hh>],
110 [log4cpp::Category::getInstance("foo")],
111 [AC_DEFINE(HAVE_LIBLOG4CPP,1,[Define if log4cpp library was found])],
112 [AC_MSG_ERROR([unable to link with log4cpp])])
116 AC_HELP_STRING([--with-xerces=PATH], [where xerces-c is installed]),
117 [if test x_$with_xerces != x_/usr; then
118 LDFLAGS="-L${with_xerces}/lib $LDFLAGS"
119 CPPFLAGS="-I${with_xerces}/include $CPPFLAGS"
121 LIBS="-lxerces-c $LIBS"
122 AC_CHECK_HEADER([xercesc/dom/DOM.hpp],,AC_MSG_ERROR([unable to find xerces header files]))
123 AC_MSG_CHECKING([Xerces version])
125 [AC_LANG_PROGRAM([#include <xercesc/util/XercesVersion.hpp>],
126 [#if _XERCES_VERSION != 20600
129 #error cannot use version 2.6.0
132 [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])])
134 [#include <xercesc/util/PlatformUtils.hpp>],
135 [xercesc::XMLPlatformUtils::Initialize()],
136 [AC_DEFINE(HAVE_LIBXERCESC,1,[Define if Xerces-C library was found])],
137 [AC_MSG_ERROR([unable to link with Xerces])])
140 # XML-Security settings
142 AC_HELP_STRING([--with-xmlsec=PATH], [where xmlsec is installed]),
143 [if test x_$with_xmlsec != x_/usr; then
144 LDFLAGS="-L${with_xmlsec}/lib $LDFLAGS"
145 CPPFLAGS="-I${with_xmlsec}/include $CPPFLAGS"
147 LIBS="-lxml-security-c $LIBS"
148 AC_CHECK_HEADER([xsec/utils/XSECPlatformUtils.hpp],,AC_MSG_ERROR([unable to find xmlsec header files]))
149 AC_MSG_CHECKING([XML-Security version])
151 [AC_LANG_PROGRAM([#include <xsec/utils/XSECPlatformUtils.hpp>],
152 [#if XSEC_VERSION_MAJOR > 1 || (XSEC_VERSION_MAJOR == 1 && XSEC_VERSION_MEDIUM > 3) || (XSEC_VERSION_MAJOR == 1 && XSEC_VERSION_MEDIUM == 3 && XSEC_VERSION_MINOR > 0)
155 #error need version 1.3.1 or later
158 [AC_MSG_FAILURE([XML-Security version 1.3.1 or greater is required.])])
160 [#include <xsec/utils/XSECPlatformUtils.hpp>],
161 [XSECPlatformUtils::Initialise()],
162 [AC_DEFINE(HAVE_LIBXSEC,1,[Define if XML-Sec library was found])],
163 [AC_MSG_ERROR([unable to link with xmlsec library])]
166 # XML-Tooling settings
167 AC_ARG_WITH(xmltooling,
168 AC_HELP_STRING([--with-xmltooling=PATH], [where xmltooling is installed]),
169 [if test x_$with_xmltooling != x_/usr; then
170 LDFLAGS="-L${with_xmltooling}/lib $LDFLAGS"
171 CPPFLAGS="-I${with_xmltooling}/include $CPPFLAGS"
172 DX_INCLUDE="${with_xmltooling}/include"
174 LIBS="-lxmltooling $LIBS"
175 AC_CHECK_HEADER([xmltooling/XMLToolingConfig.h],,AC_MSG_ERROR([unable to find xmltooling header files]))
177 [#include <xmltooling/XMLToolingConfig.h>],
178 [xmltooling::XMLToolingConfig::getConfig().init()],
179 [AC_DEFINE(HAVE_LIBXMLTOOLING,1,[Define if XML-Tooling library was found])],
180 [AC_MSG_ERROR([unable to link with xmltooling library])]
183 # Does the STL in use help or screw us?
186 [std::basic_string<unsigned short> foo; foo=foo+(unsigned short)65],
187 [AC_DEFINE(HAVE_GOOD_STL,1,
188 [Define if you have an STL implementation that supports useful string specialization.])],
191 # Check for unit test support
192 CXXTEST="/usr/bin/cxxtestgen.pl"
195 AC_HELP_STRING([--with-cxxtest=PATH], [where cxxtest is installed]),
196 [if test x_$with_cxxtest != x_/usr; then
197 CXXTEST="${with_cxxtest}/cxxtestgen.pl"
198 CXXTESTFLAGS="-I${with_cxxtest}"
200 if ! test -f "${CXXTEST}"; then
201 AC_MSG_WARN([cxxtestgen not found, won't build unit tests])
205 AC_SUBST(CXXTESTFLAGS)
206 AM_CONDITIONAL(BUILD_UNITTEST,test -f ${CXXTEST})
209 LIBTOOL="$LIBTOOL --silent"
212 AC_OUTPUT(Makefile saml/Makefile samltest/Makefile schemas/Makefile)