2 AC_INIT([shibboleth], [2.4], [shibboleth-users@internet2.edu], [shibboleth])
3 AM_CONFIG_HEADER(config.h)
4 AM_INIT_AUTOMAKE([shibboleth],[2.4])
7 sinclude(acx_pthread.m4)
18 DX_INIT_DOXYGEN(shibboleth, doxygen.cfg, doc/api)
22 AC_HELP_STRING(--enable-debug, [Have GCC compile with symbols (Default = no)
24 enable_debug=$enableval, enable_debug=no)
26 if test "$enable_debug" = "yes" ; then
27 GCC_CFLAGS="$CFLAGS -g -D_DEBUG"
28 GCC_CXXFLAGS="$CXXFLAGS -g -D_DEBUG"
30 GCC_CFLAGS="$CFLAGS -O2 -DNDEBUG"
31 GCC_CXXFLAGS="$CXXFLAGS -O2 -DNDEBUG"
34 AC_PROG_CC([gcc gcc3 cc])
35 AC_PROG_CXX([g++ g++3 c++ CC])
38 if test "$GCC" = "yes" ; then
39 # AC_HAVE_GCC_VERSION(4,0,0,0,
41 # AC_DEFINE(GCC_HASCLASSVISIBILITY,1,
42 # [Define to enable class visibility control in gcc.])
43 # GCC_CFLAGS="$GCC_CFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
44 # GCC_CXXFLAGS="$GCC_CXXFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
46 CFLAGS="-Wall $GCC_CFLAGS"
47 CXXFLAGS="-Wall $GCC_CXXFLAGS"
49 # Fix for Sun Workshop compiler in debug mode, may be Sun case #6360993
50 case "${host_cpu}-${host_os}" in
52 if test "$CXX" = "CC" ; then
53 CXXFLAGS="$CXXFLAGS -Qoption ccfe -stabs=no%dfltlit+no%dflthlp"
57 CXXFLAGS="$CXXFLAGS -D_POSIX_PII_SOCKET"
64 AC_PATH_PROG(PKG_CONFIG, pkg-config)
68 # Checks for typedefs, structures, and compiler characteristics.
73 # Checks for library functions.
76 AC_CHECK_FUNCS([strchr strdup strstr timegm gmtime_r strtok_r strcasecmp])
79 ACX_PTHREAD([enable_threads="pthread"],[enable_threads="no"])
80 if test $enable_threads != "pthread"; then
81 AC_MSG_ERROR([unable to find pthreads, currently this is required])
83 AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.])
84 LIBS="$PTHREAD_LIBS $LIBS"
85 CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
86 CXXFLAGS="$PTHREAD_CFLAGS $CXXFLAGS"
91 AC_HELP_STRING([--with-openssl=PATH], [where openssl is installed]),
92 [if test x_$with_openssl != x_/usr; then
93 SSLFLAGS="-I${with_openssl}/include"
96 if test "x$SSLFLAGS" = "x" ; then
97 if test "x$PKG_CONFIG" != x && test "x$PKG_CONFIG" != "xno" ; then
98 if pkg-config openssl ; then
99 SSLFLAGS="`$PKG_CONFIG --cflags openssl`"
101 AC_MSG_WARN([OpenSSL not supported by pkg-config, try --with-openssl instead])
106 AC_MSG_CHECKING(for OpenSSL cflags)
107 AC_MSG_RESULT($SSLFLAGS)
108 CPPFLAGS="$SSLFLAGS $CPPFLAGS"
110 AC_CHECK_HEADER([openssl/x509.h],,
111 AC_MSG_ERROR([unable to find openssl header files]))
119 # Thank you Solaris, really.
120 AC_MSG_CHECKING(for ctime_r)
121 if test -z "$ac_cv_ctime_args"; then
127 ctime_r(&clock, buf);
128 ], ac_cv_ctime_args=2)
135 ctime_r(&clock, buf, 26);
136 ], ac_cv_ctime_args=3)
138 if test -z "$ac_cv_ctime_args"; then
141 if test "$ac_cv_ctime_args" = 2; then
142 AC_DEFINE(HAVE_CTIME_R_2,1,[Define if ctime_r is present with 2 parameters.])
143 elif test "$ac_cv_ctime_args" = 3; then
144 AC_DEFINE(HAVE_CTIME_R_3,1,[Define if ctime_r is present with 3 parameters.])
146 AC_MSG_RESULT([yes, and it takes $ac_cv_ctime_args arguments])
149 # log4shib settings (favor this version over the log4cpp code)
150 AC_PATH_PROG(LOG4SHIB_CONFIG,log4shib-config)
151 AC_ARG_WITH(log4shib,
152 AC_HELP_STRING([--with-log4shib=PATH], [where log4shib-config is installed]),
154 LOG4SHIB_CONFIG="${with_log4shib}"
155 if ! test -f "${LOG4SHIB_CONFIG}" ; then
156 LOG4SHIB_CONFIG="${with_log4shib}/bin/log4shib-config"
159 if test -f "${LOG4SHIB_CONFIG}"; then
160 LDFLAGS="`${LOG4SHIB_CONFIG} --libs` $LDFLAGS"
161 CPPFLAGS="`${LOG4SHIB_CONFIG} --cflags` $CPPFLAGS"
162 AC_CHECK_HEADER([log4shib/CategoryStream.hh],,AC_MSG_ERROR([unable to find log4shib header files]))
164 [#include <log4shib/Category.hh>
165 #include <log4shib/CategoryStream.hh>],
166 [log4shib::Category::getInstance("foo").errorStream() << log4shib::eol],
167 [AC_DEFINE(SHIBSP_LOG4SHIB,1,[Define if log4shib library is used.])],
168 [AC_MSG_ERROR([unable to link with log4shib])])
170 AC_MSG_WARN([log4shib-config not found, may need to use --with-log4shib option])
171 AC_MSG_WARN([will look for original log4cpp library])
174 AC_PATH_PROG(LOG4CPP_CONFIG,log4cpp-config)
176 AC_HELP_STRING([--with-log4cpp=PATH], [where log4cpp-config is installed]),
178 LOG4CPP_CONFIG="${with_log4cpp}"
179 if ! test -f "${LOG4CPP_CONFIG}" ; then
180 LOG4CPP_CONFIG="${with_log4cpp}/bin/log4cpp-config"
183 if test -f "${LOG4CPP_CONFIG}"; then
184 AC_MSG_WARN([will try to use log4cpp, note that most non-Internet2 supplied versions are not thread-safe])
185 LDFLAGS="`${LOG4CPP_CONFIG} --libs` $LDFLAGS"
186 CPPFLAGS="`${LOG4CPP_CONFIG} --cflags` $CPPFLAGS"
187 AC_CHECK_HEADER([log4cpp/CategoryStream.hh],,AC_MSG_ERROR([unable to find log4cpp header files]))
189 [#include <log4cpp/Category.hh>
190 #include <log4cpp/CategoryStream.hh>],
191 [log4cpp::Category::getInstance("foo").errorStream() << log4cpp::eol],
192 [AC_DEFINE(SHIBSP_LOG4CPP,1,[Define if log4cpp library is used.])],
193 [AC_MSG_ERROR([unable to link with log4cpp, need version 1.0 or later])])
195 AC_MSG_ERROR([log4cpp-config not found, may need to use --with-log4cpp option])
201 AC_HELP_STRING([--with-xerces=PATH], [where xerces-c is installed]),
202 [if test x_$with_xerces != x_/usr; then
203 LDFLAGS="-L${with_xerces}/lib $LDFLAGS"
204 CPPFLAGS="-I${with_xerces}/include $CPPFLAGS"
206 LIBS="-lxerces-c $LIBS"
207 AC_CHECK_HEADER([xercesc/dom/DOM.hpp],,
208 AC_MSG_ERROR([unable to find xerces header files]))
209 AC_MSG_CHECKING([Xerces version])
211 [AC_LANG_PROGRAM([#include <xercesc/util/XercesVersion.hpp>],
212 [#if _XERCES_VERSION != 20600
215 #error cannot use version 2.6.0
218 [AC_MSG_FAILURE([Xerces-C v2.6.0 has bugs that inhibit use with signed XML, please use a newer version])])
220 [#include <xercesc/util/PlatformUtils.hpp>],
221 [xercesc::XMLPlatformUtils::Initialize()],
222 [AC_DEFINE(HAVE_LIBXERCESC,1,[Define if Xerces-C library was found])],
223 [AC_MSG_ERROR([unable to link with Xerces])])
225 AC_MSG_CHECKING([whether Xerces XMLString::release(XMLByte**) exists])
226 AC_TRY_COMPILE([#include <xercesc/util/XMLString.hpp>],
227 [using namespace XERCES_CPP_NAMESPACE;
229 XMLString::release(&buf);
231 [AC_MSG_RESULT([yes])]
232 [AC_DEFINE([SHIBSP_XERCESC_HAS_XMLBYTE_RELEASE], [1], [Define to 1 if Xerces XMLString includes XMLByte release.])],
233 [AC_MSG_RESULT([no])])
235 AC_MSG_CHECKING([whether Xerces DOMNodeFilter API returns a short])
236 AC_TRY_COMPILE([#include <xercesc/dom/DOM.hpp>],
237 [using namespace XERCES_CPP_NAMESPACE;
238 class Blocker : public DOMNodeFilter {
240 short acceptNode(const DOMNode* node) const {
241 return FILTER_REJECT;
244 static Blocker g_Blocker;
246 [AC_MSG_RESULT([yes])]
247 [AC_DEFINE([SHIBSP_XERCESC_SHORT_ACCEPTNODE], [1], [Define to 1 if Xerces DOMNodeFilter API returns a short.])],
248 [AC_MSG_RESULT([no])])
250 #XML-Tooling settings
251 AC_ARG_WITH(xmltooling,
252 AC_HELP_STRING([--with-xmltooling=PATH], [where xmltooling-c is installed]),
253 [if test x_$with_xmltooling != x_/usr; then
254 LDFLAGS="-L${with_xmltooling}/lib $LDFLAGS"
255 CPPFLAGS="-I${with_xmltooling}/include $CPPFLAGS"
256 export PKG_CONFIG_PATH="${with_xmltooling}/lib/pkgconfig"
258 LITE_LIBS="-lxmltooling-lite"
259 XMLSEC_LIBS="-lxmltooling"
260 AC_CHECK_HEADER([xmltooling/base.h],,
261 AC_MSG_ERROR([unable to find xmltooling header files]))
264 # save and append master libs
266 LIBS="$XMLSEC_LIBS $LIBS"
269 [#include <xmltooling/io/HTTPResponse.h>],
270 [xmltooling::HTTPResponse::sanitizeURL("http://test")],
271 [AC_DEFINE(HAVE_XMLTOOLING,1,[Define if xmltooling library was found])],
272 [AC_MSG_ERROR([unable to link with XMLTooling, or version was too old])])
274 # restore master libs
277 # Determine xmltooling version.
279 AC_ARG_WITH(xmltoolingver,
280 AC_HELP_STRING([--with-xmltoolingver=VERSION], [xmltooling version, normally derived via pkg-config]),
281 [XMLTOOLINGVER="-$with_xmltoolingver"],
282 [if test "x$PKG_CONFIG" != "x" && test "x$PKG_CONFIG" != "xno" ; then
283 if pkg-config xmltooling ; then
284 XMLTOOLINGVER="-`$PKG_CONFIG --modversion xmltooling`"
287 if test "x$XMLTOOLINGVER" = "x" ; then
288 AC_MSG_WARN([pkgconfig not usable, assuming unversioned xmltooling schemas, may need --with-xmltoolingver])
291 # Establish location of xmltooling catalog.
293 if test "x$with_xmltooling" = "x" ; then
294 with_xmltooling="/usr"
296 if test -f $with_xmltooling/share/xml/xmltooling$XMLTOOLINGVER/catalog.xml ; then
297 XMLTOOLINGXMLDIR="$with_xmltooling"
298 elif test -f $with_xerces/share/xml/xmltooling$XMLTOOLINGVER/catalog.xml ; then
299 XMLTOOLINGXMLDIR="$with_xerces"
300 elif test -f $with_log4shib/share/xml/xmltooling$XMLTOOLINGVER/catalog.xml ; then
301 XMLTOOLINGXMLDIR="$with_log4shib"
303 if test "x$XMLTOOLINGXMLDIR" = "x" ; then
304 AC_MSG_ERROR([xmltooling XML catalog not found, may need to use --with-xmltooling or --with-xmltoolingver options])
306 XMLTOOLINGXMLDIR="$XMLTOOLINGXMLDIR/share/xml/xmltooling$XMLTOOLINGVER"
307 AC_SUBST(XMLTOOLINGXMLDIR)
309 # XML-Security settings
311 AC_HELP_STRING([--with-xmlsec=PATH], [where xmlsec is installed]),,
314 if test x_$with_xmlsec != x_/usr; then
315 LDFLAGS="-L${with_xmlsec}/lib $LDFLAGS"
316 CPPFLAGS="-I${with_xmlsec}/include $CPPFLAGS"
318 XMLSEC_LIBS="-lxml-security-c $XMLSEC_LIBS"
320 # save and append master libs
322 LIBS="$XMLSEC_LIBS $LIBS"
324 AC_CHECK_HEADER([xsec/utils/XSECPlatformUtils.hpp],,AC_MSG_ERROR([unable to find XML-Security header files]))
325 AC_MSG_CHECKING([XML-Security version])
327 [AC_LANG_PROGRAM([#include <xsec/utils/XSECPlatformUtils.hpp>],
328 [#if XSEC_VERSION_MAJOR > 1 || (XSEC_VERSION_MAJOR == 1 && XSEC_VERSION_MEDIUM > 3)
331 #error need version 1.4.0 or later
334 [AC_MSG_FAILURE([XML-Security version 1.4.0 or greater is required.])])
336 [#include <xsec/utils/XSECPlatformUtils.hpp>],
337 [XSECPlatformUtils::Initialise()],,
338 [AC_MSG_ERROR([unable to link with XML-Security])])
340 # restore master libs
345 AC_HELP_STRING([--with-saml=PATH], [where saml is installed]),
346 [if test x_$with_saml != x_/usr; then
347 LDFLAGS="-L${with_saml}/lib $LDFLAGS"
348 CPPFLAGS="-I${with_saml}/include $CPPFLAGS"
350 XMLSEC_LIBS="-lsaml $XMLSEC_LIBS"
352 # save and append master libs
354 LIBS="$XMLSEC_LIBS $LIBS"
356 AC_CHECK_HEADER([saml/saml2/metadata/Metadata.h],,
357 AC_MSG_ERROR([unable to find OpenSAML header files]))
359 [#include <saml/SAMLConfig.h>
360 #include <saml/version.h>],
361 [#if _OPENSAML_VERSION >= 20200
362 opensaml::SAMLConfig::getConfig();
364 #error Need OpenSAML version 2.2 or higher
366 [AC_DEFINE(HAVE_SAML,1,[Define if saml library was found])],
367 [AC_MSG_ERROR([unable to link with OpenSAML, or version was too old])])
369 # restore master libs
372 # Determine opensaml version.
375 AC_HELP_STRING([--with-samlver=VERSION], [opensaml version, normally derived via pkg-config]),
376 [OPENSAMLVER="-$with_samlver"],
377 [if test "x$PKG_CONFIG" != "x" && test "x$PKG_CONFIG" != "xno" ; then
378 if pkg-config opensaml ; then
379 OPENSAMLVER="-`$PKG_CONFIG --modversion opensaml`"
382 if test "x$OPENSAMLVER" = "x" ; then
383 AC_MSG_WARN([pkgconfig not usable, assuming unversioned opensaml schemas, may need --with-samlver])
386 # Establish location of opensaml catalogs.
388 if test "x$with_saml" = "x" ; then
391 if test -f $with_saml/share/xml/opensaml$OPENSAMLVER/saml20-catalog.xml ; then
392 OPENSAMLXMLDIR="$with_saml"
393 elif test -f $with_xmltooling/share/xml/opensaml$OPENSAMLVER/saml20-catalog.xml ; then
394 OPENSAMLXMLDIR="$with_xmltooling"
395 elif test -f $with_xerces/share/xml/opensaml$OPENSAMLVER/saml20-catalog.xml ; then
396 OPENSAMLXMLDIR="$with_xerces"
397 elif test -f $with_log4shib/share/xml/opensaml$OPENSAMLVER/saml20-catalog.xml ; then
398 OPENSAMLXMLDIR="$with_log4shib"
400 if test "x$OPENSAMLXMLDIR" = "x" ; then
401 AC_MSG_ERROR([opensaml XML catalogs not found, may need to use --with-saml or --with-samlver options])
403 OPENSAMLXMLDIR="$OPENSAMLXMLDIR/share/xml/opensaml$OPENSAMLVER"
404 AC_SUBST(OPENSAMLXMLDIR)
407 AC_SUBST(XMLSEC_LIBS)
409 AC_CONFIG_FILES([shibboleth.spec pkginfo Portfile])
411 # output the underlying makefiles
412 WANT_SUBDIRS="doc schemas configs shibsp shibd util"
413 AC_CONFIG_FILES([Makefile doc/Makefile schemas/Makefile \
414 configs/Makefile shibsp/Makefile shibd/Makefile \
415 util/Makefile selinux/Makefile])
418 AC_CONFIG_FILES([adfs/Makefile])
419 AC_ARG_ENABLE([adfs],
420 AC_HELP_STRING([--disable-adfs], [don't build the ADFS module]),
421 [adfs_enabled=$enableval], [adfs_enabled=yes])
422 if test "x$adfs_enabled" = "x" ; then
425 AC_MSG_CHECKING(whether to build the ADFS module)
426 if test "$adfs_enabled" = "no" ; then
430 WANT_SUBDIRS="$WANT_SUBDIRS adfs"
435 # Build NSAPI module?
437 AC_MSG_CHECKING(for NSAPI module option)
439 AC_HELP_STRING([--with-nsapi=DIR], [Build NSAPI module for Netscape/iPlanet/SunONE]),
440 [WANT_NSAPI=$withval],[WANT_NSAPI=no])
441 AC_MSG_RESULT($WANT_NSAPI)
443 if test "$WANT_NSAPI" != "no"; then
444 if test ! -d $WANT_NSAPI/bin ; then
445 AC_MSG_ERROR(Please specify the path to the root of your Netscape/iPlanet/SunONE server using --with-nsapi=DIR)
447 AC_MSG_CHECKING(for NSAPI include files)
448 if test -d $WANT_NSAPI/include ; then
449 NSAPI_INCLUDE=$WANT_NSAPI/include
450 AC_MSG_RESULT(Netscape-Enterprise 3.x style)
451 AC_CHECK_HEADERS([$NSAPI_INCLUDE/nsapi.h],,,[#define XP_UNIX])
452 NSAPI_INCLUDE="$NSAPI_INC_DIR -I$NSAPI_INCLUDE"
454 if test -d $WANT_NSAPI/plugins/include ; then
455 test -n "$NSAPI_INCLUDE" && NSAPI_INC_DIR="-I$NSAPI_INCLUDE"
456 NSAPI_INCLUDE="$WANT_NSAPI/plugins/include"
457 AC_MSG_RESULT(iPlanet 4.x / SunONE 6.x style)
458 AC_CHECK_HEADERS([$NSAPI_INCLUDE/nsapi.h],,,[#define XP_UNIX])
459 NSAPI_INCLUDE="$NSAPI_INC_DIR -I$NSAPI_INCLUDE"
461 if test "$NSAPI_INCLUDE" = ""; then
462 AC_MSG_ERROR(Please check you have nsapi.h in either $WANT_NSAPI/include or $WANT_NSAPI/plugins/include)
466 AC_SUBST(NSAPI_INCLUDE)
468 # always output the Makefile, even if you don't use it
469 AC_CONFIG_FILES([nsapi_shib/Makefile])
470 AM_CONDITIONAL(BUILD_NSAPI,test ! "$WANT_NSAPI" = "no")
472 # add the NSAPI module to the list of wanted subdirs..
473 if test ! "$WANT_NSAPI" = "no" ; then
474 WANT_SUBDIRS="$WANT_SUBDIRS nsapi_shib"
479 # Build FastCGI support?
481 AC_MSG_CHECKING(for FastCGI support)
483 AC_HELP_STRING([--with-fastcgi=DIR], [Build FastCGI support]),
484 [WANT_FASTCGI=$withval],[WANT_FASTCGI=no])
485 AC_MSG_RESULT($WANT_FASTCGI)
487 if test "$WANT_FASTCGI" != "no"; then
488 if test "$WANT_FASTCGI" != "yes"; then
489 if test x_$WANT_FASTCGI != x_/usr; then
490 FASTCGI_INCLUDE="-I$WANT_FASTCGI/include"
491 FASTCGI_LDFLAGS="-L$WANT_FASTCGI/lib"
494 AC_CHECK_HEADER([fcgio.h],,
495 AC_MSG_ERROR([unable to find FastCGI header files]))
496 FASTCGI_LIBS="-lfcgi -lfcgi++"
499 AC_SUBST(FASTCGI_INCLUDE)
500 AC_SUBST(FASTCGI_LDFLAGS)
501 AC_SUBST(FASTCGI_LIBS)
503 # always output the Makefile, even if you don't use it
504 AC_CONFIG_FILES([fastcgi/Makefile])
505 AM_CONDITIONAL(BUILD_FASTCGI,test ! "$WANT_FASTCGI" = "no")
507 if test ! "$WANT_FASTCGI" = "no" ; then
508 WANT_SUBDIRS="$WANT_SUBDIRS fastcgi"
512 # Build Memcached support?
514 AC_MSG_CHECKING(for Memcached support)
515 AC_ARG_WITH(memcached,
516 AC_HELP_STRING([--with-memcached=DIR], [Build Memcached support]),
517 [WANT_MEMCACHED=$withval],[WANT_MEMCACHED=no])
518 AC_MSG_RESULT($WANT_MEMCACHED)
520 if test "$WANT_MEMCACHED" != "no"; then
521 if test "$WANT_MEMCACHED" != "yes"; then
522 if test x_$WANT_MEMCACHED != x_/usr; then
523 MEMCACHED_INCLUDE="-I$WANT_MEMCACHED/include"
524 MEMCACHED_LDFLAGS="-L$WANT_MEMCACHED/lib"
527 AC_CHECK_HEADER([libmemcached/memcached.h],,
528 AC_MSG_ERROR([unable to find Memcached header files]))
529 MEMCACHED_LIBS="-lmemcached"
532 AC_SUBST(MEMCACHED_INCLUDE)
533 AC_SUBST(MEMCACHED_LDFLAGS)
534 AC_SUBST(MEMCACHED_LIBS)
536 # always output the Makefile, even if you don't use it
537 AC_CONFIG_FILES([memcache-store/Makefile])
538 AM_CONDITIONAL(BUILD_MEMCACHED,test ! "$WANT_MEMCACHED" = "no")
540 if test ! "$WANT_MEMCACHED" = "no" ; then
541 WANT_SUBDIRS="$WANT_SUBDIRS memcache-store"
546 # If no --enable-apache-xx specified
547 # find a default and fake the specific parameters
550 # simple macro to peek at an enable or a with
552 if test "[${[$1]_][$2]+set}" = set; then
553 peekval="${[$1]_[$2]}"
558 AC_MSG_CHECKING(if default apache needed)
560 Peek(enable,apache_13,need_default=no)
561 Peek(enable,apache_20,need_default=no)
562 Peek(enable,apache_22,need_default=no)
563 AC_MSG_RESULT($need_default)
565 if test "$need_default" = "yes"; then
566 # find an apxs, then the httpd
568 Peek(with,apxs,xs="$peekval")
569 Peek(with,apxs2,xs="$peekval")
570 Peek(with,apxs22,xs="$peekval")
571 if test "x$xs" = "x"; then
572 AC_PATH_PROGS(xs, apxs2 apxs,
573 AC_MSG_ERROR(No apxs, no apache found. Try --with-apxs),
574 [/usr/local/apache2/bin:/usr/local/apache/bin:/usr/sbin:$PATH])
576 # ask the daemon for the version and set parameters
577 AC_MSG_CHECKING(default apache version)
578 httpd="`$xs -q SBINDIR`/`$xs -q TARGET`"
579 if test "x$httpd" != "x" && test -f $httpd ; then
580 v=`$httpd -v|$SED -n -e 's/.*Apache\/\.*//p'`
582 1.3*) [enable_apache_13]=yes
586 2.0*) [enable_apache_20]=yes
590 2.2*) [enable_apache_22]=yes
594 *) AC_MSG_ERROR(unusable apache versions: $v. Try setting --with-apxs)
597 AC_MSG_RESULT(cannot determine version. Try setting --with-apxs)
601 # Apache 1.3 (mod_shib_13)
603 # --with-apxs (DSO build, the normal way, uses apxs to derive build flags)
605 AC_ARG_ENABLE(apache-13,
606 AC_HELP_STRING([--enable-apache-13], [enable the Apache 1.3 module]),
607 [ if test "x$enableval" = "x" ; then
610 WANT_APACHE_13="$enableval"
612 ],[ WANT_APACHE_13=no ])
613 AC_MSG_CHECKING(whether to build Apache 1.3 module)
614 if test "$WANT_APACHE_13" != yes && test "$WANT_APACHE_13" != no ; then
617 AC_MSG_RESULT($WANT_APACHE_13)
619 if test "$WANT_APACHE_13" = "yes" ; then
621 AC_HELP_STRING([--with-apxs=FILE], [Specifies where to find the Apache 1.3 apxs script.]),
623 AC_MSG_CHECKING(for user-specified apxs name/location)
624 if test "$withval" != "no" ; then
625 if test "$withval" != "yes"; then
627 AC_MSG_RESULT("$withval")
632 AC_PATH_PROG(APXS, apxs, no)
633 if test "$APXS" = "no" ; then
634 for i in /usr/sbin /usr/local/apache/bin ; do
635 if test "$APXS" = "no" && test -f "$i/apxs"; then
642 AC_MSG_CHECKING([to see if apxs was located])
643 if test ! -f "$APXS" ; then
645 AC_MSG_ERROR([Unable to locate apxs script. An Apache development package may be missing from your server, or you may need to use the --with-apxs option.])
650 # extract settings we need from APXS -q
651 APXS_CC="`$APXS -q CC`"
652 APXS_CFLAGS="`$APXS -q CFLAGS` `$APXS -q CFLAGS_SHLIB`"
653 APXS_INCLUDE="`$APXS -q INCLUDEDIR`"
656 AC_SUBST(APXS_CFLAGS)
657 AC_SUBST(APXS_INCLUDE)
660 # Apache 2.0 (mod_shib_20)
662 # --with-apxs2 (DSO build, the normal way, uses apxs to derive build flags)
663 # --with-apr (DSO build, APR development package installed separately)
664 # --with-apu (DSO build, APR-UTIL development package installed separately)
666 AC_ARG_ENABLE(apache-20,
667 AC_HELP_STRING([--enable-apache-20], [enable the Apache 2.0 module]),
668 [ if test "x$enableval" = "x" ; then
671 WANT_APACHE_20="$enableval"
673 ],[ WANT_APACHE_20=no ])
674 AC_MSG_CHECKING(whether to build Apache 2.0 module)
675 if test "$WANT_APACHE_20" != yes && test "$WANT_APACHE_20" != no ; then
678 AC_MSG_RESULT($WANT_APACHE_20)
680 if test "$WANT_APACHE_20" = "yes" ; then
682 AC_HELP_STRING([--with-apxs2=FILE], [Specifies where to find the Apache 2.0 apxs script.]),
684 AC_MSG_CHECKING(for user-specified Apache2 apxs name/location)
685 if test "$withval" != "no" ; then
686 if test "$withval" != "yes"; then
688 AC_MSG_RESULT("$withval")
693 AC_PATH_PROG(APXS2, apxs2, no)
694 if test "$APXS2" = "no" ; then
695 AC_PATH_PROG(APXS2, apxs, no)
697 if test "$APXS2" = "no" ; then
698 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
699 if test "$APXS2" = "no" && test -f "$i/apxs2" ; then
703 if test "$APXS2" = "no" ; then
704 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
705 if test "$APXS2" = "no" && test -f "$i/apxs" ; then
713 AC_MSG_CHECKING([to see if Apache2 apxs was located])
714 if test ! -f "$APXS2" ; then
716 AC_MSG_ERROR([Unable to locate Apache2 apxs script. An Apache development package may be missing from your server, or you may need to use the --with-apxs2 option.])
718 AC_MSG_RESULT($APXS2)
723 AC_HELP_STRING([--with-apr=PATH], [where apr-config is installed]),
725 AC_MSG_CHECKING(for user-specified apr-config name/location)
726 if test "$withval" != "no" ; then
727 if test "$withval" != "yes"; then
729 AC_MSG_RESULT("$withval")
734 AC_PATH_PROG(APR_CONFIG, apr-config,,[`$APXS2 -q SBINDIR`]:[$PATH])
736 if test -f "${APR_CONFIG}"; then
737 APR_CFLAGS="`${APR_CONFIG} --cflags` `${APR_CONFIG} --cppflags` `${APR_CONFIG} --includes`"
739 AC_MSG_ERROR([Unable to locate apr-config, may need --with-apr option.])
744 AC_HELP_STRING([--with-apu=PATH], [where apu-config is installed]),
746 AC_MSG_CHECKING(for user-specified apu-config name/location)
747 if test "$withval" != "no" ; then
748 if test "$withval" != "yes"; then
750 AC_MSG_RESULT("$withval")
755 AC_PATH_PROG(APU_CONFIG, apu-config,,[`$APXS2 -q SBINDIR`]:[$PATH])
757 if test -f "${APU_CONFIG}"; then
758 APU_CFLAGS="`${APU_CONFIG} --includes`"
760 AC_MSG_ERROR([Unable to locate apu-config, may need --with-apu option.])
763 # extract settings we need from APXS2 -q
764 APXS2_CC="`$APXS2 -q CC`"
765 APXS2_CFLAGS="`$APXS2 -q CPPFLAGS` `$APXS2 -q CFLAGS` $APU_CFLAGS"
766 APXS2_INCLUDE="`$APXS2 -q INCLUDEDIR`"
769 AC_SUBST(APXS2_CFLAGS)
770 AC_SUBST(APXS2_INCLUDE)
773 # Apache 2.2 (mod_shib_22)
775 # --with-apxs22 (DSO build, the normal way, uses apxs to derive build flags)
776 # --with-apr1 (DSO build, APR development package installed separately)
777 # --with-apu1 (DSO build, APR-UTIL development package installed separately)
779 AC_ARG_ENABLE(apache-22,
780 AC_HELP_STRING([--enable-apache-22], [enable the Apache 2.2 module]),
781 [ if test "x$enableval" = "x" ; then
784 WANT_APACHE_22="$enableval"
786 ],[ WANT_APACHE_22=no ])
787 AC_MSG_CHECKING(whether to build Apache 2.2 module)
788 if test "$WANT_APACHE_22" != yes && test "$WANT_APACHE_22" != no ; then
791 AC_MSG_RESULT($WANT_APACHE_22)
793 if test "$WANT_APACHE_22" = "yes" ; then
795 AC_HELP_STRING([--with-apxs22=FILE], [Specifies where to find the Apache 2.2 apxs script.]),
797 AC_MSG_CHECKING(for user-specified Apache2.2 apxs name/location)
798 if test "$withval" != "no" ; then
799 if test "$withval" != "yes"; then
801 AC_MSG_RESULT("$withval")
806 AC_PATH_PROG(APXS22, apxs2, no)
807 if test "$APXS22" = "no" ; then
808 AC_PATH_PROG(APXS22, apxs, no)
810 if test "$APXS22" = "no" ; then
811 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
812 if test "$APXS22" = "no" && test -f "$i/apxs2" ; then
816 if test "$APXS22" = "no" ; then
817 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
818 if test "$APXS22" = "no" && test -f "$i/apxs" ; then
826 AC_MSG_CHECKING([to see if Apache2.2 apxs was located])
827 if test ! -f "$APXS22" ; then
829 AC_MSG_ERROR([Unable to locate Apache2.2 apxs script. An Apache development package may be missing from your server, or you may need to use the --with-apxs22 option.])
831 AC_MSG_RESULT($APXS22)
836 AC_HELP_STRING([--with-apr1=PATH], [where apr-1-config is installed]),
838 AC_MSG_CHECKING(for user-specified apr-1-config name/location)
839 if test "$withval" != "no" ; then
840 if test "$withval" != "yes"; then
842 AC_MSG_RESULT("$withval")
847 AC_PATH_PROG(APR1_CONFIG, apr-1-config,,[`$APXS22 -q SBINDIR`]:[$PATH])
849 if test -f "${APR1_CONFIG}"; then
850 APR1_CFLAGS="`${APR1_CONFIG} --cflags` `${APR1_CONFIG} --cppflags` `${APR1_CONFIG} --includes`"
852 AC_MSG_ERROR([Unable to locate apr-1-config, may need --with-apr1 option.])
857 AC_HELP_STRING([--with-apu1=PATH], [where apu-1-config is installed]),
859 AC_MSG_CHECKING(for user-specified apu-1-config name/location)
860 if test "$withval" != "no" ; then
861 if test "$withval" != "yes"; then
863 AC_MSG_RESULT("$withval")
868 AC_PATH_PROG(APU1_CONFIG, apu-1-config,,[`$APXS22 -q SBINDIR`]:[$PATH])
870 if test -f "${APU1_CONFIG}"; then
871 APU1_CFLAGS="`${APU1_CONFIG} --includes`"
873 AC_MSG_ERROR([Unable to locate apu-1-config, may need --with-apu1 option.])
876 # extract settings we need from APXS22 -q
877 APXS22_CC="`$APXS22 -q CC`"
878 APXS22_CFLAGS="`$APXS22 -q CPPFLAGS` `$APXS22 -q CFLAGS` $APR1_CFLAGS $APU1_CFLAGS"
879 APXS22_INCLUDE="`$APXS22 -q INCLUDEDIR`"
882 AC_SUBST(APXS22_CFLAGS)
883 AC_SUBST(APXS22_INCLUDE)
885 # always output the Makefile, even if you don't use it
886 AC_CONFIG_FILES([apache/Makefile])
887 AM_CONDITIONAL(BUILD_AP13,test "$WANT_APACHE_13" = "yes")
888 AM_CONDITIONAL(BUILD_AP20,test "$WANT_APACHE_20" = "yes")
889 AM_CONDITIONAL(BUILD_AP22,test "$WANT_APACHE_22" = "yes")
891 # add the apache module to the list of wanted subdirs..
892 if test "$WANT_APACHE_13" = "yes" || test "$WANT_APACHE_20" = "yes" || test "$WANT_APACHE_22" = "yes" ; then
893 WANT_SUBDIRS="$WANT_SUBDIRS apache"
898 # Implement the checks of the ODBC Storage Service
900 # 1) Assume the user wants ODBC; if it's not found then just continue without
901 # 2) If the user specifically requested odbc, look for it and ERROR if not found
902 # 3) If the user specifically requested no odbc, don't build it.
905 AC_CONFIG_FILES([odbc-store/Makefile])
907 # determine whether we should enable the odbc ccache
908 AC_ARG_ENABLE([odbc],
909 AC_HELP_STRING([--disable-odbc], [disable the ODBC Storage Service]),
910 [odbc_enabled=$enableval], [odbc_enabled=default])
912 if test "x$odbc_enabled" = "x" ; then
916 # Are we trying to build ODBC?
917 AC_MSG_CHECKING(whether to build the ODBC storage service)
918 if test "$odbc_enabled" = "yes" ; then
921 elif test "$odbc_enabled" = "default" ; then
923 AC_MSG_RESULT([yes, if it can be found])
929 # If we're trying to build ODBC, try to find the odbc_config program.
930 if test "$build_odbc" = "yes" ; then
933 AC_HELP_STRING([--with-odbc=PATH], [directory where odbc is installed]),
934 [if test "$with_odbc" = no ; then
935 AC_MSG_ERROR([Try running --disable-odbc instead.])
936 elif test "$with_odbc" != yes ; then
937 odbc_dir="$with_odbc/bin"
938 if test "$with_odbc" != /usr ; then
939 ODBC_CFLAGS="-I$with_odbc/include"
940 ODBC_LIBS="-L$with_odbc/lib"
944 AC_PATH_PROG(ODBC_CONFIG, odbc_config, no, $odbc_dir $PATH )
945 if test "$ODBC_CONFIG" = no ; then
946 AC_MSG_WARN([Cannot find odbc_config, will try to guess settings.])
947 ODBC_LIBS="$ODBC_LIBS -lodbc"
949 ODBC_CFLAGS=`$ODBC_CONFIG --cflags`
950 ODBC_LIBS=`$ODBC_CONFIG --libs`
953 save_CPPFLAGS="$CPPFLAGS"
954 CPPFLAGS="$CPPFLAGS $ODBC_CFLAGS"
956 AC_CHECK_HEADER([sql.h], [have_sql_h=yes], [have_sql_h=no])
957 if test "$have_sql_h" = no -a "$odbc_enabled" = "yes" ; then
958 AC_MSG_ERROR(unable to find ODBC header files)
961 if test "$have_sql_h" = yes ; then
963 LIBS="$LIBS $ODBC_LIBS"
964 AC_MSG_CHECKING(if we can link againt ODBC)
969 [SQLSetEnvAttr(SQL_NULL_HANDLE, SQL_ATTR_CONNECTION_POOLING, (void*)SQL_CP_ONE_PER_HENV, 0)],
970 [have_odbc_libs=yes],
974 if test "$have_odbc_libs" = no ; then
975 if test "$odbc_enabled" = "yes" ; then
976 AC_MSG_ERROR([unable to link with ODBC Library])
978 AC_MSG_RESULT(no, skipping ODBC)
983 CPPFLAGS="$save_CPPFLAGS"
986 # if have_odbc_libs=yes then go ahead with building ODBC
987 if test "$have_odbc_libs" = yes ; then
988 # this AC_MSG_RESULT is from above!
990 WANT_SUBDIRS="$WANT_SUBDIRS odbc-store"
991 AC_SUBST(ODBC_CFLAGS)
996 AC_SUBST(WANT_SUBDIRS)
998 if test -n "$APXS_CC" && test "$APXS_CC" != "$CC" ; then
999 echo "=================================================================="
1000 echo "WARNING: You have chosen to compile Apache-1.3 modules with a different"
1001 echo " compiler than the one used to compile Apache."
1003 echo " Current compiler: $CC"
1004 echo " Apache's compiler: $APXS_CC"
1006 echo "This could cause problems."
1007 echo "=================================================================="
1010 if test -n "$APXS2_CC" && test "$APXS2_CC" != "$CC" ; then
1011 echo "=================================================================="
1012 echo "WARNING: You have chosen to compile Apache-2.0 modules with a different"
1013 echo " compiler than the one used to compile Apache."
1015 echo " Current compiler: $CC"
1016 echo " Apache's compiler: $APXS2_CC"
1018 echo "This could cause problems."
1019 echo "=================================================================="
1022 if test -n "$APXS22_CC" && test "$APXS22_CC" != "$CC" ; then
1023 echo "=================================================================="
1024 echo "WARNING: You have chosen to compile Apache-2.2 modules with a different"
1025 echo " compiler than the one used to compile Apache."
1027 echo " Current compiler: $CC"
1028 echo " Apache's compiler: $APXS22_CC"
1030 echo "This could cause problems."
1031 echo "=================================================================="
1034 LIBTOOL="$LIBTOOL --silent"