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])
36 if test "$GCC" = "yes" ; then
37 # AC_HAVE_GCC_VERSION(4,0,0,0,
39 # AC_DEFINE(GCC_HASCLASSVISIBILITY,1,
40 # [Define to enable class visibility control in gcc.])
41 # GCC_CFLAGS="$GCC_CFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
42 # GCC_CXXFLAGS="$GCC_CXXFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
45 CXXFLAGS="$GCC_CXXFLAGS"
51 # Checks for typedefs, structures, and compiler characteristics.
55 # Checks for library functions.
56 AC_CHECK_FUNCS([strchr strdup strstr])
58 AC_CHECK_SIZEOF(time_t)
61 AC_PATH_PROG(CURL_CONFIG,curl-config)
63 AC_HELP_STRING([--with-curl=PATH], [where curl-config is installed]),
65 CURL_CONFIG="${with_curl}"
66 if ! test -f "${CURL_CONFIG}" ; then
67 CURL_CONFIG="${with_curl}/bin/curl-config"
70 if test -f "${CURL_CONFIG}" ; then
71 LDFLAGS="`${CURL_CONFIG} --libs` $LDFLAGS"
72 CPPFLAGS="`${CURL_CONFIG} --cflags` $CPPFLAGS"
74 AC_MSG_ERROR([curl-config not found, may need to use --with-curl option])
76 AC_CHECK_HEADER([curl/curl.h],,AC_MSG_ERROR([unable to find libcurl header files]))
77 AC_CHECK_LIB([curl],[curl_global_init],,AC_MSG_ERROR([unable to link with libcurl]))
78 AC_MSG_CHECKING([for CURLOPT_SSL_CTX_FUNCTION in curl.h])
79 AC_EGREP_HEADER([CURLOPT_SSL_CTX_FUNCTION], [curl/curl.h],
81 [AC_MSG_ERROR([need libcurl that supports CURLOPT_SSL_CTX_FUNCTION])])
85 AC_HELP_STRING([--with-zlib=PATH], [where zlib is installed]),
87 if test -d "$withval"; then
88 CPPFLAGS="${CPPFLAGS} -I$withval/include"
89 LDFLAGS="${LDFLAGS} -L$withval/lib"
93 AC_CHECK_HEADER(zlib.h,
94 AC_CHECK_LIB(z, deflateInit2, ,
95 AC_MSG_ERROR([zlib library not found, may need to use --with-zlib option])),
96 AC_MSG_ERROR([zlib headers not found, may need to use --with-zlib option]))
105 AC_PATH_PROG(LOG4CPP_CONFIG,log4cpp-config)
107 AC_HELP_STRING([--with-log4cpp=PATH], [where log4cpp-config is installed]),
109 LOG4CPP_CONFIG="${with_log4cpp}"
110 if ! test -f "${LOG4CPP_CONFIG}" ; then
111 LOG4CPP_CONFIG="${with_log4cpp}/bin/log4cpp-config"
114 if test -f "${LOG4CPP_CONFIG}"; then
115 LDFLAGS="`${LOG4CPP_CONFIG} --libs` $LDFLAGS"
116 CPPFLAGS="`${LOG4CPP_CONFIG} --cflags` $CPPFLAGS"
118 AC_MSG_ERROR([log4cpp-config not found, may need to use --with-log4cpp option])
119 LIBS="-llog4cpp $LIBS"
121 AC_CHECK_HEADER([log4cpp/Category.hh],,AC_MSG_ERROR([unable to find log4cpp header files]))
122 AC_CHECK_HEADER([log4cpp/PropertyConfigurator.hh],,AC_MSG_ERROR([you need at least log4cpp 0.3.x]))
124 [#include <log4cpp/Category.hh>],
125 [log4cpp::Category::getInstance("foo")],
126 [AC_DEFINE(HAVE_LIBLOG4CPP,1,[Define if log4cpp library was found])],
127 [AC_MSG_ERROR([unable to link with log4cpp])])
131 AC_HELP_STRING([--with-xerces=PATH], [where xerces-c is installed]),
132 [if test x_$with_xerces != x_/usr; then
133 LDFLAGS="-L${with_xerces}/lib $LDFLAGS"
134 CPPFLAGS="-I${with_xerces}/include $CPPFLAGS"
136 LIBS="-lxerces-c $LIBS"
137 AC_CHECK_HEADER([xercesc/dom/DOM.hpp],,AC_MSG_ERROR([unable to find xerces header files]))
138 AC_MSG_CHECKING([Xerces version])
140 [AC_LANG_PROGRAM([#include <xercesc/util/XercesVersion.hpp>],
141 [#if _XERCES_VERSION != 20600
144 #error cannot use version 2.6.0
147 [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])])
149 [#include <xercesc/util/PlatformUtils.hpp>],
150 [xercesc::XMLPlatformUtils::Initialize()],
151 [AC_DEFINE(HAVE_LIBXERCESC,1,[Define if Xerces-C library was found])],
152 [AC_MSG_ERROR([unable to link with Xerces])])
155 # XML-Security settings
157 AC_HELP_STRING([--with-xmlsec=PATH], [where xmlsec is installed]),
158 [if test x_$with_xmlsec != x_/usr; then
159 LDFLAGS="-L${with_xmlsec}/lib $LDFLAGS"
160 CPPFLAGS="-I${with_xmlsec}/include $CPPFLAGS"
162 LIBS="-lxml-security-c $LIBS"
163 AC_CHECK_HEADER([xsec/utils/XSECPlatformUtils.hpp],,AC_MSG_ERROR([unable to find xmlsec header files]))
165 [#include <xsec/utils/XSECPlatformUtils.hpp>],
166 [XSECPlatformUtils::Initialise()],
167 [AC_DEFINE(HAVE_LIBXSEC,1,[Define if XML-Sec library was found])],
168 [AC_MSG_ERROR([unable to link with xmlsec library])]
171 # XML-Tooling settings
172 AC_ARG_WITH(xmltooling,
173 AC_HELP_STRING([--with-xmltooling=PATH], [where xmltooling is installed]),
174 [if test x_$with_xmltooling != x_/usr; then
175 LDFLAGS="-L${with_xmltooling}/lib $LDFLAGS"
176 CPPFLAGS="-I${with_xmltooling}/include $CPPFLAGS"
177 DX_INCLUDE="${with_xmltooling}/include"
179 LIBS="-lxmltooling $LIBS"
180 AC_CHECK_HEADER([xmltooling/XMLToolingConfig.h],,AC_MSG_ERROR([unable to find xmltooling header files]))
182 [#include <xmltooling/XMLToolingConfig.h>],
183 [xmltooling::XMLToolingConfig::getConfig().init()],
184 [AC_DEFINE(HAVE_LIBXMLTOOLING,1,[Define if XML-Tooling library was found])],
185 [AC_MSG_ERROR([unable to link with xmltooling library])]
188 # Does the STL in use help or screw us?
191 [std::basic_string<unsigned short> foo; foo=foo+(unsigned short)65],
192 [AC_DEFINE(HAVE_GOOD_STL,1,
193 [Define if you have an STL implementation that supports useful string specialization.])],
196 # Check for unit test support
197 CXXTEST="/usr/bin/cxxtestgen.pl"
200 AC_HELP_STRING([--with-cxxtest=PATH], [where cxxtest is installed]),
201 [if test x_$with_cxxtest != x_/usr; then
202 CXXTEST="${with_cxxtest}/cxxtestgen.pl"
203 CXXTESTFLAGS="-I${with_cxxtest}"
205 if ! test -f "${CXXTEST}"; then
206 AC_MSG_WARN([cxxtestgen not found, won't build unit tests])
210 AC_SUBST(CXXTESTFLAGS)
211 AM_CONDITIONAL(BUILD_UNITTEST,test -f ${CXXTEST})
214 LIBTOOL="$LIBTOOL --silent"
217 AC_OUTPUT(Makefile saml/Makefile samltest/Makefile schemas/Makefile)