2 AC_INIT([xmltooling], [1.0], [mace-opensaml-users@internet2.edu], [xmltooling])
\r
3 AM_CONFIG_HEADER(config.h)
\r
4 AM_CONFIG_HEADER(xmltooling/config_pub.h)
\r
5 AM_INIT_AUTOMAKE([xmltooling], [1.0])
\r
7 sinclude(acx_pthread.m4)
\r
10 AC_HELP_STRING(--enable-debug, [Have GCC compile with symbols (Default = no)]),
\r
11 enable_debug=$enableval, enable_debug=no)
\r
13 if test "$enable_debug" = "yes" ; then
\r
14 GCC_CFLAGS="$CFLAGS -g -D_DEBUG"
\r
15 GCC_CXXFLAGS="$CXXFLAGS -g -D_DEBUG"
\r
17 GCC_CFLAGS="$CFLAGS -O2 -DNDEBUG"
\r
18 GCC_CXXFLAGS="$CXXFLAGS -O2 -DNDEBUG"
\r
21 AC_PROG_CC([gcc gcc3 cc])
\r
22 AC_PROG_CXX([g++ g++3 c++ CC])
\r
24 if test "$GCC" = "yes" ; then
\r
25 CFLAGS="$GCC_CFLAGS"
\r
26 CXXFLAGS="$GCC_CXXFLAGS"
\r
40 # checks for pthreads
\r
41 ACX_PTHREAD([enable_threads="pthread"],[enable_threads="no"])
\r
42 if test $enable_threads != "pthread"; then
\r
43 AC_MSG_ERROR([unable to find pthreads, currently this is required])
\r
45 AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.])
\r
46 LIBS="$PTHREAD_LIBS $LIBS"
\r
47 CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
\r
48 CXXFLAGS="$PTHREAD_CFLAGS $CXXFLAGS"
\r
51 # Checks for typedefs, structures, and compiler characteristics.
\r
57 # Checks for library functions.
\r
59 AC_CHECK_FUNCS([strchr strdup strstr gmtime_r timegm])
\r
60 AC_CHECK_HEADERS([dlfcn.h])
\r
63 AC_PATH_PROG(PKG_CONFIG, pkg-config)
\r
64 if test "x$PKG_CONFIG" = x || test "x$PKG_CONFIG" = "xno" ; then
\r
65 AC_ARG_WITH(openssl,
\r
66 AC_HELP_STRING([--with-openssl=PATH], [where openssl is installed]),
\r
67 [if test x_$with_openssl != x_/usr; then
\r
68 SSLLIBS="-L${with_openssl}/lib"
\r
69 SSLFLAGS="-I${with_openssl}/include"
\r
71 SSLLIBS="$SSLLIBS -lssl -lcrypto"
\r
73 SSLLIBS="`$PKG_CONFIG --libs openssl`"
\r
74 SSLFLAGS="`$PKG_CONFIG --cflags openssl`"
\r
76 AC_MSG_CHECKING(for OpenSSL libraries)
\r
77 AC_MSG_RESULT($SSLLIBS)
\r
78 LIBS="$LIBS $SSLLIBS"
\r
79 AC_MSG_CHECKING(for OpenSSL cflags)
\r
80 AC_MSG_RESULT($SSLFLAGS)
\r
81 CPPFLAGS="$SSLFLAGS $CPPFLAGS"
\r
83 AC_CHECK_HEADER([openssl/ssl.h],,
\r
84 AC_MSG_ERROR([unable to find openssl header files]))
\r
85 AC_MSG_CHECKING(for ERR_load_CRYPTO_string)
\r
86 AC_TRY_LINK_FUNC([ERR_load_CRYPTO_strings],,
\r
87 AC_MSG_ERROR([unable to link with openssl libraries]))
\r
89 AC_MSG_CHECKING(for SSL_library_init)
\r
90 AC_TRY_LINK_FUNC([SSL_library_init],,
\r
91 AC_MSG_ERROR([unable to link with openssl libraries]))
\r
95 AC_PATH_PROG(CURL_CONFIG,curl-config)
\r
97 AC_HELP_STRING([--with-curl=PATH], [where libcurl is installed]),
\r
98 [CURL_CONFIG="${with_curl}/bin/curl-config"])
\r
99 if test -f "${CURL_CONFIG}"; then
\r
100 LDFLAGS="`${CURL_CONFIG} --libs` $LDFLAGS"
\r
101 CPPFLAGS="`${CURL_CONFIG} --cflags` $CPPFLAGS"
\r
103 AC_MSG_WARN([curl-config not found, guessing at libcurl build settings])
\r
105 AC_CHECK_HEADER([curl/curl.h],,AC_MSG_ERROR([unable to find libcurl header files]))
\r
106 AC_CHECK_LIB([curl],[curl_global_init],,AC_MSG_ERROR([unable to link with libcurl]))
\r
107 AC_MSG_CHECKING([for CURLOPT_SSL_CTX_FUNCTION in curl.h])
\r
108 AC_EGREP_HEADER([CURLOPT_SSL_CTX_FUNCTION], [curl/curl.h],
\r
109 [AC_MSG_RESULT(yes)],
\r
110 [AC_MSG_ERROR([need libcurl that supports CURLOPT_SSL_CTX_FUNCTION])])
\r
115 AC_PATH_PROG(LOG4CPP_CONFIG,log4cpp-config)
\r
116 AC_ARG_WITH(log4cpp,
\r
117 AC_HELP_STRING([--with-log4cpp=PATH], [where log4cpp is installed]),
\r
118 [LOG4CPP_CONFIG="${with_log4cpp}/bin/log4cpp-config"])
\r
119 if test -f "${LOG4CPP_CONFIG}"; then
\r
120 LDFLAGS="`${LOG4CPP_CONFIG} --libs` $LDFLAGS"
\r
121 CPPFLAGS="`${LOG4CPP_CONFIG} --cflags` $CPPFLAGS"
\r
123 AC_MSG_WARN([log4cpp-config not found, guessing at log4cpp build settings])
\r
124 LIBS="-llog4cpp $LIBS"
\r
126 AC_CHECK_HEADER([log4cpp/Category.hh],,AC_MSG_ERROR([unable to find log4cpp header files]))
\r
127 AC_CHECK_HEADER([log4cpp/PropertyConfigurator.hh],,AC_MSG_ERROR([you need at least log4cpp 0.3.x]))
\r
129 [#include <log4cpp/Category.hh>],
\r
130 [log4cpp::Category::getInstance("foo")],
\r
131 [AC_DEFINE(HAVE_LIBLOG4CPP,1,[Define if log4cpp library was found])],
\r
132 [AC_MSG_ERROR([unable to link with log4cpp])])
\r
135 AC_ARG_WITH(xerces,
\r
136 AC_HELP_STRING([--with-xerces=PATH], [where xerces-c is installed]),
\r
137 [if test x_$with_xerces != x_/usr; then
\r
138 LDFLAGS="-L${with_xerces}/lib $LDFLAGS"
\r
139 CPPFLAGS="-I${with_xerces}/include $CPPFLAGS"
\r
141 LIBS="-lxerces-c $LIBS"
\r
142 AC_CHECK_HEADER([xercesc/dom/DOM.hpp],,
\r
143 AC_MSG_ERROR([unable to find xerces header files]))
\r
144 AC_MSG_CHECKING([Xerces version])
\r
146 [AC_LANG_PROGRAM([#include <xercesc/util/XercesVersion.hpp>],
\r
147 [#if _XERCES_VERSION != 20600
\r
150 #error cannot use version 2.6.0
\r
152 [AC_MSG_RESULT(OK)],
\r
153 [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])])
\r
155 [#include <xercesc/util/PlatformUtils.hpp>],
\r
156 [xercesc::XMLPlatformUtils::Initialize()],
\r
157 [AC_DEFINE(HAVE_LIBXERCESC,1,[Define if Xerces-C library was found])],
\r
158 [AC_MSG_ERROR([unable to link with Xerces])])
\r
161 # XML-Security settings
\r
162 AC_ARG_WITH(xmlsec,
\r
163 AC_HELP_STRING([--with-xmlsec=PATH], [where xmlsec is installed]),
\r
164 [if test x_$with_xmlsec != x_/usr; then
\r
165 LDFLAGS="-L${with_xmlsec}/lib $LDFLAGS"
\r
166 CPPFLAGS="-I${with_xmlsec}/include $CPPFLAGS"
\r
168 LIBS="-lxml-security-c $LIBS"
\r
169 AC_CHECK_HEADER([xsec/utils/XSECPlatformUtils.hpp],,AC_MSG_ERROR([unable to find xsec header files]))
\r
171 [#include <xsec/utils/XSECPlatformUtils.hpp>],
\r
172 [XSECPlatformUtils::Initialise()],
\r
173 [AC_DEFINE(HAVE_LIBXSEC,1,[Define if XML-Sec library was found])],
\r
174 [AC_MSG_ERROR([unable to link with XML-Sec])])
\r
176 # Does the STL in use help or screw us?
\r
178 [#include <string>],
\r
179 [std::basic_string<unsigned short> foo; foo=foo+(unsigned short)65],
\r
180 [AC_DEFINE(HAVE_GOOD_STL,1,
\r
181 [Define if you have an STL implementation that supports useful string specialization.])],
\r
184 # Check for unit test support
\r
185 CXXTEST="/usr/bin/cxxtestgen.pl"
\r
187 AC_ARG_WITH(cxxtest,
\r
188 AC_HELP_STRING([--with-cxxtest=PATH], [where cxxtest is installed]),
\r
189 [if test x_$with_xerces != x_/usr; then
\r
190 CXXTEST="${with_cxxtest}/cxxtestgen.pl"
\r
191 CXXTESTFLAGS="-I${with_cxxtest}"
\r
193 if ! test -f "${CXXTEST}"; then
\r
194 AC_MSG_WARN([cxxtestgen not found, won't build unit tests])
\r
198 AC_SUBST(CXXTESTFLAGS)
\r
199 AM_CONDITIONAL(BUILD_UNITTEST,test -f ${CXXTEST})
\r
202 AC_OUTPUT(Makefile xmltooling/Makefile schemas/Makefile)
\r