2 AC_INIT([shibboleth-resolver], [0.1], [shibboleth-users@internet2.edu], [shibboleth-resolver])
\r
3 AM_CONFIG_HEADER(config.h)
\r
4 AM_INIT_AUTOMAKE([shibboleth-resolver],[0.1])
\r
6 sinclude(acx_pthread.m4)
\r
9 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
25 if test "$GCC" = "yes" ; then
\r
26 # AC_HAVE_GCC_VERSION(4,0,0,0,
\r
28 # AC_DEFINE(GCC_HASCLASSVISIBILITY,1,
\r
29 # [Define to enable class visibility control in gcc.])
\r
30 # GCC_CFLAGS="$GCC_CFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
\r
31 # GCC_CXXFLAGS="$GCC_CXXFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
\r
33 CFLAGS="-Wall $GCC_CFLAGS"
\r
34 CXXFLAGS="-Wall $GCC_CXXFLAGS"
\r
36 # Fix for Sun Workshop compiler in debug mode, may be Sun case #6360993
\r
37 case "${host_cpu}-${host_os}" in
\r
39 if test "$CXX" = "CC" ; then
\r
40 CXXFLAGS="$CXXFLAGS -Qoption ccfe -stabs=no%dfltlit+no%dflthlp"
\r
44 CXXFLAGS="$CXXFLAGS -D_POSIX_PII_SOCKET"
\r
54 # Checks for typedefs, structures, and compiler characteristics.
\r
59 # Checks for library functions.
\r
60 AC_CHECK_FUNCS([strcasecmp])
\r
62 # checks for pthreads
\r
63 ACX_PTHREAD([enable_threads="pthread"],[enable_threads="no"])
\r
64 if test $enable_threads != "pthread"; then
\r
65 AC_MSG_ERROR([unable to find pthreads, currently this is required])
\r
67 AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.])
\r
68 LIBS="$PTHREAD_LIBS $LIBS"
\r
69 CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
\r
70 CXXFLAGS="$PTHREAD_CFLAGS $CXXFLAGS"
\r
79 # log4shib settings (favor this version over the log4cpp code)
\r
80 AC_PATH_PROG(LOG4SHIB_CONFIG,log4shib-config)
\r
81 AC_ARG_WITH(log4shib,
\r
82 AC_HELP_STRING([--with-log4shib=PATH], [where log4shib-config is installed]),
\r
84 LOG4SHIB_CONFIG="${with_log4shib}"
\r
85 if ! test -f "${LOG4SHIB_CONFIG}" ; then
\r
86 LOG4SHIB_CONFIG="${with_log4shib}/bin/log4shib-config"
\r
89 if test -f "${LOG4SHIB_CONFIG}"; then
\r
90 LDFLAGS="`${LOG4SHIB_CONFIG} --libs` $LDFLAGS"
\r
91 CPPFLAGS="`${LOG4SHIB_CONFIG} --cflags` $CPPFLAGS"
\r
92 AC_CHECK_HEADER([log4shib/CategoryStream.hh],,AC_MSG_ERROR([unable to find log4shib header files]))
\r
94 [#include <log4shib/Category.hh>
\r
95 #include <log4shib/CategoryStream.hh>],
\r
96 [log4shib::Category::getInstance("foo").errorStream() << log4shib::eol],
\r
97 [AC_DEFINE(SHIBRESOLVER_LOG4SHIB,1,[Define if log4shib library is used.])],
\r
98 [AC_MSG_ERROR([unable to link with log4shib])])
\r
100 AC_MSG_WARN([log4shib-config not found, may need to use --with-log4shib option])
\r
101 AC_MSG_WARN([will look for original log4cpp library])
\r
104 AC_PATH_PROG(LOG4CPP_CONFIG,log4cpp-config)
\r
105 AC_ARG_WITH(log4cpp,
\r
106 AC_HELP_STRING([--with-log4cpp=PATH], [where log4cpp-config is installed]),
\r
108 LOG4CPP_CONFIG="${with_log4cpp}"
\r
109 if ! test -f "${LOG4CPP_CONFIG}" ; then
\r
110 LOG4CPP_CONFIG="${with_log4cpp}/bin/log4cpp-config"
\r
113 if test -f "${LOG4CPP_CONFIG}"; then
\r
114 AC_MSG_WARN([will try to use log4cpp, note that most non-Internet2 supplied versions are not thread-safe])
\r
115 LDFLAGS="`${LOG4CPP_CONFIG} --libs` $LDFLAGS"
\r
116 CPPFLAGS="`${LOG4CPP_CONFIG} --cflags` $CPPFLAGS"
\r
117 AC_CHECK_HEADER([log4cpp/CategoryStream.hh],,AC_MSG_ERROR([unable to find log4cpp header files]))
\r
119 [#include <log4cpp/Category.hh>
\r
120 #include <log4cpp/CategoryStream.hh>],
\r
121 [log4cpp::Category::getInstance("foo").errorStream() << log4cpp::eol],
\r
122 [AC_DEFINE(SHIBRESOLVER_LOG4CPP,1,[Define if log4cpp library is used.])],
\r
123 [AC_MSG_ERROR([unable to link with log4cpp, need version 1.0 or later])])
\r
125 AC_MSG_ERROR([log4cpp-config not found, may need to use --with-log4cpp option])
\r
130 AC_ARG_WITH(xerces,
\r
131 AC_HELP_STRING([--with-xerces=PATH], [where xerces-c is installed]),
\r
132 [if test x_$with_xerces != x_/usr; then
\r
133 LDFLAGS="-L${with_xerces}/lib $LDFLAGS"
\r
134 CPPFLAGS="-I${with_xerces}/include $CPPFLAGS"
\r
136 LIBS="-lxerces-c $LIBS"
\r
137 AC_CHECK_HEADER([xercesc/dom/DOM.hpp],,
\r
138 AC_MSG_ERROR([unable to find xerces header files]))
\r
139 AC_MSG_CHECKING([Xerces version])
\r
141 [AC_LANG_PROGRAM([#include <xercesc/util/XercesVersion.hpp>],
\r
142 [#if _XERCES_VERSION != 20600
\r
145 #error cannot use version 2.6.0
\r
147 [AC_MSG_RESULT(OK)],
\r
148 [AC_MSG_FAILURE([Xerces-C v2.6.0 has bugs that inhibit use with signed XML, please use a newer version])])
\r
150 [#include <xercesc/util/PlatformUtils.hpp>],
\r
151 [xercesc::XMLPlatformUtils::Initialize()],
\r
152 [AC_DEFINE(HAVE_LIBXERCESC,1,[Define if Xerces-C library was found])],
\r
153 [AC_MSG_ERROR([unable to link with Xerces])])
\r
156 #XML-Tooling settings
\r
157 AC_ARG_WITH(xmltooling,
\r
158 AC_HELP_STRING([--with-xmltooling=PATH], [where xmltooling-c is installed]),
\r
159 [if test x_$with_xmltooling != x_/usr; then
\r
160 LDFLAGS="-L${with_xmltooling}/lib $LDFLAGS"
\r
161 CPPFLAGS="-I${with_xmltooling}/include $CPPFLAGS"
\r
163 LITE_LIBS="-lxmltooling-lite"
\r
164 XMLSEC_LIBS="-lxmltooling"
\r
165 AC_CHECK_HEADER([xmltooling/base.h],,
\r
166 AC_MSG_ERROR([unable to find xmltooling header files]))
\r
168 # XML-Security settings
\r
169 AC_ARG_WITH(xmlsec,
\r
170 AC_HELP_STRING([--with-xmlsec=PATH], [where xmlsec is installed]),,
\r
171 [with_xmlsec=/usr])
\r
173 if test x_$with_xmlsec != x_/usr; then
\r
174 LDFLAGS="-L${with_xmlsec}/lib $LDFLAGS"
\r
175 CPPFLAGS="-I${with_xmlsec}/include $CPPFLAGS"
\r
177 XMLSEC_LIBS="-lxml-security-c $XMLSEC_LIBS"
\r
179 # save and append master libs
\r
181 LIBS="$XMLSEC_LIBS $LIBS"
\r
183 AC_CHECK_HEADER([xsec/utils/XSECPlatformUtils.hpp],,AC_MSG_ERROR([unable to find XML-Security header files]))
\r
184 AC_MSG_CHECKING([XML-Security version])
\r
186 [AC_LANG_PROGRAM([#include <xsec/utils/XSECPlatformUtils.hpp>],
\r
187 [#if XSEC_VERSION_MAJOR > 1 || (XSEC_VERSION_MAJOR == 1 && XSEC_VERSION_MEDIUM > 3)
\r
190 #error need version 1.4.0 or later
\r
192 [AC_MSG_RESULT(OK)],
\r
193 [AC_MSG_FAILURE([XML-Security version 1.4.0 or greater is required.])])
\r
195 [#include <xsec/utils/XSECPlatformUtils.hpp>],
\r
196 [XSECPlatformUtils::Initialise()],,
\r
197 [AC_MSG_ERROR([unable to link with XML-Security])])
\r
199 # restore master libs
\r
202 # OpenSAML settings
\r
204 AC_HELP_STRING([--with-saml=PATH], [where saml is installed]),
\r
205 [if test x_$with_saml != x_/usr; then
\r
206 LDFLAGS="-L${with_saml}/lib $LDFLAGS"
\r
207 CPPFLAGS="-I${with_saml}/include $CPPFLAGS"
\r
209 XMLSEC_LIBS="-lsaml $XMLSEC_LIBS"
\r
211 # save and append master libs
\r
213 LIBS="$XMLSEC_LIBS $LIBS"
\r
215 AC_CHECK_HEADER([saml/saml2/metadata/Metadata.h],,
\r
216 AC_MSG_ERROR([unable to find OpenSAML header files]))
\r
218 [#include <saml/SAMLConfig.h>],
\r
219 [opensaml::SAMLConfig::getConfig()],
\r
220 [AC_DEFINE(HAVE_SAML,1,[Define if saml library was found])],
\r
221 [AC_MSG_ERROR([unable to link with OpenSAML])])
\r
223 # restore master libs
\r
226 # Shibboleth SP settings
\r
227 AC_ARG_WITH(shibsp,
\r
228 AC_HELP_STRING([--with-shibsp=PATH], [where Shibboleth SP is installed]),
\r
229 [if test x_$with_shibsp != x_/usr; then
\r
230 LDFLAGS="-L${with_shibsp}/lib $LDFLAGS"
\r
231 CPPFLAGS="-I${with_shibsp}/include $CPPFLAGS"
\r
233 LITE_LIBS="-lshibsp-lite $LITE_LIBS"
\r
234 XMLSEC_LIBS="-lshibsp $XMLSEC_LIBS"
\r
236 # save and append master libs
\r
238 LIBS="$XMLSEC_LIBS $LIBS"
\r
240 AC_CHECK_HEADER([shibsp/SPConfig.h],,
\r
241 AC_MSG_ERROR([unable to find Shibboleth SP header files]))
\r
243 [#include <shibsp/SPConfig.h>],
\r
244 [shibsp::SPConfig::getConfig()],
\r
245 [AC_DEFINE(HAVE_SHIBSP,1,[Define if Shibboleth SP library was found])],
\r
246 [AC_MSG_ERROR([unable to link with Shibboleth SP])])
\r
248 # restore master libs
\r
251 AC_SUBST(LITE_LIBS)
\r
252 AC_SUBST(XMLSEC_LIBS)
\r
254 AC_CONFIG_FILES([resolver.spec Portfile])
\r
256 # output the underlying makefiles
\r
257 AC_CONFIG_FILES([Makefile doc/Makefile src/Makefile])
\r
259 LIBTOOL="$LIBTOOL --silent"
\r