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)
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
36 # AC_HAVE_GCC_VERSION(4,0,0,0,
38 # AC_DEFINE(GCC_HASCLASSVISIBILITY,1,
39 # [Define to enable class visibility control in gcc.])
40 # GCC_CFLAGS="$GCC_CFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
41 # GCC_CXXFLAGS="$GCC_CXXFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
44 CXXFLAGS="$GCC_CXXFLAGS"
50 # Checks for typedefs, structures, and compiler characteristics.
54 # Checks for library functions.
55 AC_CHECK_FUNCS([strchr strdup strstr])
58 AC_PATH_PROG(CURL_CONFIG,curl-config)
60 AC_HELP_STRING([--with-curl=PATH], [where curl-config is installed]),
62 CURL_CONFIG="${with_curl}"
63 if ! test -f "${CURL_CONFIG}" ; then
64 CURL_CONFIG="${with_curl}/bin/curl-config"
67 if test -f "${CURL_CONFIG}" ; then
68 LDFLAGS="`${CURL_CONFIG} --libs` $LDFLAGS"
69 CPPFLAGS="`${CURL_CONFIG} --cflags` $CPPFLAGS"
71 AC_MSG_ERROR([curl-config not found, may need to use --with-curl option])
73 AC_CHECK_HEADER([curl/curl.h],,AC_MSG_ERROR([unable to find libcurl header files]))
74 AC_CHECK_LIB([curl],[curl_global_init],,AC_MSG_ERROR([unable to link with libcurl]))
75 AC_MSG_CHECKING([for CURLOPT_SSL_CTX_FUNCTION in curl.h])
76 AC_EGREP_HEADER([CURLOPT_SSL_CTX_FUNCTION], [curl/curl.h],
78 [AC_MSG_ERROR([need libcurl that supports CURLOPT_SSL_CTX_FUNCTION])])
87 AC_PATH_PROG(LOG4CPP_CONFIG,log4cpp-config)
89 AC_HELP_STRING([--with-log4cpp=PATH], [where log4cpp-config is installed]),
91 LOG4CPP_CONFIG="${with_log4cpp}"
92 if ! test -f "${LOG4CPP_CONFIG}" ; then
93 LOG4CPP_CONFIG="${with_log4cpp}/bin/log4cpp-config"
96 if test -f "${LOG4CPP_CONFIG}"; then
97 LDFLAGS="`${LOG4CPP_CONFIG} --libs` $LDFLAGS"
98 CPPFLAGS="`${LOG4CPP_CONFIG} --cflags` $CPPFLAGS"
100 AC_MSG_ERROR([log4cpp-config not found, may need to use --with-log4cpp option])
101 LIBS="-llog4cpp $LIBS"
103 AC_CHECK_HEADER([log4cpp/Category.hh],,AC_MSG_ERROR([unable to find log4cpp header files]))
104 AC_CHECK_HEADER([log4cpp/PropertyConfigurator.hh],,AC_MSG_ERROR([you need at least log4cpp 0.3.x]))
106 [#include <log4cpp/Category.hh>],
107 [log4cpp::Category::getInstance("foo")],
108 [AC_DEFINE(HAVE_LIBLOG4CPP,1,[Define if log4cpp library was found])],
109 [AC_MSG_ERROR([unable to link with log4cpp])])
113 AC_HELP_STRING([--with-xerces=PATH], [where xerces-c is installed]),
114 [if test x_$with_xerces != x_/usr; then
115 LDFLAGS="-L${with_xerces}/lib $LDFLAGS"
116 CPPFLAGS="-I${with_xerces}/include $CPPFLAGS"
118 LIBS="-lxerces-c $LIBS"
119 AC_CHECK_HEADER([xercesc/dom/DOM.hpp],,AC_MSG_ERROR([unable to find xerces header files]))
120 AC_MSG_CHECKING([Xerces version])
122 [AC_LANG_PROGRAM([#include <xercesc/util/XercesVersion.hpp>],
123 [#if _XERCES_VERSION != 20600
126 #error cannot use version 2.6.0
129 [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])])
131 [#include <xercesc/util/PlatformUtils.hpp>],
132 [xercesc::XMLPlatformUtils::Initialize()],
133 [AC_DEFINE(HAVE_LIBXERCESC,1,[Define if Xerces-C library was found])],
134 [AC_MSG_ERROR([unable to link with Xerces])])
137 # XML-Security settings
139 AC_HELP_STRING([--with-xmlsec=PATH], [where xmlsec is installed]),
140 [if test x_$with_xmlsec != x_/usr; then
141 LDFLAGS="-L${with_xmlsec}/lib $LDFLAGS"
142 CPPFLAGS="-I${with_xmlsec}/include $CPPFLAGS"
144 LIBS="-lxml-security-c $LIBS"
145 AC_CHECK_HEADER([xsec/utils/XSECPlatformUtils.hpp],,AC_MSG_ERROR([unable to find xmlsec header files]))
147 [#include <xsec/utils/XSECPlatformUtils.hpp>],
148 [XSECPlatformUtils::Initialise()],
149 [AC_DEFINE(HAVE_LIBXSEC,1,[Define if XML-Sec library was found])],
150 [AC_MSG_ERROR([unable to link with xmlsec library])]
153 # XML-Tooling settings
154 AC_ARG_WITH(xmltooling,
155 AC_HELP_STRING([--with-xmltooling=PATH], [where xmltooling is installed]),
156 [if test x_$with_xmltooling != x_/usr; then
157 LDFLAGS="-L${with_xmltooling}/lib $LDFLAGS"
158 CPPFLAGS="-I${with_xmltooling}/include $CPPFLAGS"
160 LIBS="-lxmltooling $LIBS"
161 AC_CHECK_HEADER([xmltooling/XMLToolingConfig.h],,AC_MSG_ERROR([unable to find xmltooling header files]))
163 [#include <xmltooling/XMLToolingConfig.h>],
164 [xmltooling::XMLToolingConfig::getConfig().init()],
165 [AC_DEFINE(HAVE_LIBXMLTOOLING,1,[Define if XML-Tooling library was found])],
166 [AC_MSG_ERROR([unable to link with xmltooling library])]
169 # Does the STL in use help or screw us?
172 [std::basic_string<unsigned short> foo; foo=foo+(unsigned short)65],
173 [AC_DEFINE(HAVE_GOOD_STL,1,
174 [Define if you have an STL implementation that supports useful string specialization.])],
177 # Check for unit test support
178 CXXTEST="/usr/bin/cxxtestgen.pl"
181 AC_HELP_STRING([--with-cxxtest=PATH], [where cxxtest is installed]),
182 [if test x_$with_cxxtest != x_/usr; then
183 CXXTEST="${with_cxxtest}/cxxtestgen.pl"
184 CXXTESTFLAGS="-I${with_cxxtest}"
186 if ! test -f "${CXXTEST}"; then
187 AC_MSG_WARN([cxxtestgen not found, won't build unit tests])
191 AC_SUBST(CXXTESTFLAGS)
192 AM_CONDITIONAL(BUILD_UNITTEST,test -f ${CXXTEST})
194 LIBTOOL="$LIBTOOL --silent"
197 AC_OUTPUT(Makefile saml/Makefile samltest/Makefile schemas/Makefile)