2 AC_INIT([shibboleth], [2.3], [shibboleth-users@internet2.edu], [shibboleth])
3 AM_CONFIG_HEADER(config.h)
4 AM_INIT_AUTOMAKE([shibboleth],[2.3])
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"
67 # Checks for typedefs, structures, and compiler characteristics.
72 # Checks for library functions.
75 AC_CHECK_FUNCS([strchr strdup strstr timegm gmtime_r strtok_r strcasecmp])
78 ACX_PTHREAD([enable_threads="pthread"],[enable_threads="no"])
79 if test $enable_threads != "pthread"; then
80 AC_MSG_ERROR([unable to find pthreads, currently this is required])
82 AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.])
83 LIBS="$PTHREAD_LIBS $LIBS"
84 CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
85 CXXFLAGS="$PTHREAD_CFLAGS $CXXFLAGS"
90 AC_HELP_STRING([--with-openssl=PATH], [where openssl is installed]),
91 [if test x_$with_openssl != x_/usr; then
92 SSLFLAGS="-I${with_openssl}/include"
95 if test "x$SSLFLAGS" = "x" ; then
96 AC_PATH_PROG(PKG_CONFIG, pkg-config)
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_ERROR([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"
257 LITE_LIBS="-lxmltooling-lite"
258 XMLSEC_LIBS="-lxmltooling"
259 AC_CHECK_HEADER([xmltooling/base.h],,
260 AC_MSG_ERROR([unable to find xmltooling header files]))
263 # save and append master libs
265 LIBS="$XMLSEC_LIBS $LIBS"
268 [#include <xmltooling/io/HTTPResponse.h>],
269 [xmltooling::HTTPResponse::sanitizeURL("http://test")],
270 [AC_DEFINE(HAVE_XMLTOOLING,1,[Define if xmltooling library was found])],
271 [AC_MSG_ERROR([unable to link with XMLTooling, or version was too old])])
273 # restore master libs
276 # Establish location of xmltooling catalog.
278 if test "x$with_xmltooling" = "x" ; then
279 with_xmltooling="/usr"
281 if test -f $with_xmltooling/share/xml/xmltooling/catalog.xml ; then
282 XMLTOOLINGXMLDIR="$with_xmltooling"
283 elif test -f $with_xerces/share/xml/xmltooling/catalog.xml ; then
284 XMLTOOLINGXMLDIR="$with_xerces"
285 elif test -f $with_log4shib/share/xml/xmltooling/catalog.xml ; then
286 XMLTOOLINGXMLDIR="$with_log4shib"
288 if test "x$XMLTOOLINGXMLDIR" = "x" ; then
289 AC_MSG_ERROR([xmltooling XML catalog not found, may need to use --with-xmltooling option])
291 XMLTOOLINGXMLDIR="$XMLTOOLINGXMLDIR/share/xml/xmltooling"
292 AC_SUBST(XMLTOOLINGXMLDIR)
294 # XML-Security settings
296 AC_HELP_STRING([--with-xmlsec=PATH], [where xmlsec is installed]),,
299 if test x_$with_xmlsec != x_/usr; then
300 LDFLAGS="-L${with_xmlsec}/lib $LDFLAGS"
301 CPPFLAGS="-I${with_xmlsec}/include $CPPFLAGS"
303 XMLSEC_LIBS="-lxml-security-c $XMLSEC_LIBS"
305 # save and append master libs
307 LIBS="$XMLSEC_LIBS $LIBS"
309 AC_CHECK_HEADER([xsec/utils/XSECPlatformUtils.hpp],,AC_MSG_ERROR([unable to find XML-Security header files]))
310 AC_MSG_CHECKING([XML-Security version])
312 [AC_LANG_PROGRAM([#include <xsec/utils/XSECPlatformUtils.hpp>],
313 [#if XSEC_VERSION_MAJOR > 1 || (XSEC_VERSION_MAJOR == 1 && XSEC_VERSION_MEDIUM > 3)
316 #error need version 1.4.0 or later
319 [AC_MSG_FAILURE([XML-Security version 1.4.0 or greater is required.])])
321 [#include <xsec/utils/XSECPlatformUtils.hpp>],
322 [XSECPlatformUtils::Initialise()],,
323 [AC_MSG_ERROR([unable to link with XML-Security])])
325 # restore master libs
330 AC_HELP_STRING([--with-saml=PATH], [where saml is installed]),
331 [if test x_$with_saml != x_/usr; then
332 LDFLAGS="-L${with_saml}/lib $LDFLAGS"
333 CPPFLAGS="-I${with_saml}/include $CPPFLAGS"
335 XMLSEC_LIBS="-lsaml $XMLSEC_LIBS"
337 # save and append master libs
339 LIBS="$XMLSEC_LIBS $LIBS"
341 AC_CHECK_HEADER([saml/saml2/metadata/Metadata.h],,
342 AC_MSG_ERROR([unable to find OpenSAML header files]))
344 [#include <saml/SAMLConfig.h>
345 #include <saml/version.h>],
346 [#if _OPENSAML_VERSION >= 20200
347 opensaml::SAMLConfig::getConfig();
349 #error Need OpenSAML version 2.2 or higher
351 [AC_DEFINE(HAVE_SAML,1,[Define if saml library was found])],
352 [AC_MSG_ERROR([unable to link with OpenSAML, or version was too old])])
354 # restore master libs
357 # Establish location of opensaml catalogs.
359 if test "x$with_saml" = "x" ; then
362 if test -f $with_saml/share/xml/opensaml/saml20-catalog.xml ; then
363 OPENSAMLXMLDIR="$with_saml"
364 elif test -f $with_xmltooling/share/xml/opensaml/saml20-catalog.xml ; then
365 OPENSAMLXMLDIR="$with_xmltooling"
366 elif test -f $with_xerces/share/xml/opensaml/saml20-catalog.xml ; then
367 OPENSAMLXMLDIR="$with_xerces"
368 elif test -f $with_log4shib/share/xml/opensaml/saml20-catalog.xml ; then
369 OPENSAMLXMLDIR="$with_log4shib"
371 if test "x$OPENSAMLXMLDIR" = "x" ; then
372 AC_MSG_ERROR([opensaml XML catalogs not found, may need to use --with-saml option])
374 OPENSAMLXMLDIR="$OPENSAMLXMLDIR/share/xml/opensaml"
375 AC_SUBST(OPENSAMLXMLDIR)
378 AC_SUBST(XMLSEC_LIBS)
380 AC_CONFIG_FILES([shibboleth.spec pkginfo Portfile])
382 # output the underlying makefiles
383 WANT_SUBDIRS="doc schemas configs shibsp shibd util"
384 AC_CONFIG_FILES([Makefile doc/Makefile schemas/Makefile \
385 configs/Makefile shibsp/Makefile shibd/Makefile \
386 util/Makefile selinux/Makefile])
389 AC_CONFIG_FILES([adfs/Makefile])
390 AC_ARG_ENABLE([adfs],
391 AC_HELP_STRING([--disable-adfs], [don't build the ADFS module]),
392 [adfs_enabled=$enableval], [adfs_enabled=yes])
393 if test "x$adfs_enabled" = "x" ; then
396 AC_MSG_CHECKING(whether to build the ADFS module)
397 if test "$adfs_enabled" = "no" ; then
401 WANT_SUBDIRS="$WANT_SUBDIRS adfs"
406 # Build NSAPI module?
408 AC_MSG_CHECKING(for NSAPI module option)
410 AC_HELP_STRING([--with-nsapi=DIR], [Build NSAPI module for Netscape/iPlanet/SunONE]),
411 [WANT_NSAPI=$withval],[WANT_NSAPI=no])
412 AC_MSG_RESULT($WANT_NSAPI)
414 if test "$WANT_NSAPI" != "no"; then
415 if test ! -d $WANT_NSAPI/bin ; then
416 AC_MSG_ERROR(Please specify the path to the root of your Netscape/iPlanet/SunONE server using --with-nsapi=DIR)
418 AC_MSG_CHECKING(for NSAPI include files)
419 if test -d $WANT_NSAPI/include ; then
420 NSAPI_INCLUDE=$WANT_NSAPI/include
421 AC_MSG_RESULT(Netscape-Enterprise 3.x style)
422 AC_CHECK_HEADERS([$NSAPI_INCLUDE/nsapi.h],,,[#define XP_UNIX])
423 NSAPI_INCLUDE="$NSAPI_INC_DIR -I$NSAPI_INCLUDE"
425 if test -d $WANT_NSAPI/plugins/include ; then
426 test -n "$NSAPI_INCLUDE" && NSAPI_INC_DIR="-I$NSAPI_INCLUDE"
427 NSAPI_INCLUDE="$WANT_NSAPI/plugins/include"
428 AC_MSG_RESULT(iPlanet 4.x / SunONE 6.x style)
429 AC_CHECK_HEADERS([$NSAPI_INCLUDE/nsapi.h],,,[#define XP_UNIX])
430 NSAPI_INCLUDE="$NSAPI_INC_DIR -I$NSAPI_INCLUDE"
432 if test "$NSAPI_INCLUDE" = ""; then
433 AC_MSG_ERROR(Please check you have nsapi.h in either $WANT_NSAPI/include or $WANT_NSAPI/plugins/include)
437 AC_SUBST(NSAPI_INCLUDE)
439 # always output the Makefile, even if you don't use it
440 AC_CONFIG_FILES([nsapi_shib/Makefile])
441 AM_CONDITIONAL(BUILD_NSAPI,test ! "$WANT_NSAPI" = "no")
443 # add the NSAPI module to the list of wanted subdirs..
444 if test ! "$WANT_NSAPI" = "no" ; then
445 WANT_SUBDIRS="$WANT_SUBDIRS nsapi_shib"
450 # Build FastCGI support?
452 AC_MSG_CHECKING(for FastCGI support)
454 AC_HELP_STRING([--with-fastcgi=DIR], [Build FastCGI support]),
455 [WANT_FASTCGI=$withval],[WANT_FASTCGI=no])
456 AC_MSG_RESULT($WANT_FASTCGI)
458 if test "$WANT_FASTCGI" != "no"; then
459 if test "$WANT_FASTCGI" != "yes"; then
460 if test x_$WANT_FASTCGI != x_/usr; then
461 FASTCGI_INCLUDE="-I$WANT_FASTCGI/include"
462 FASTCGI_LDFLAGS="-L$WANT_FASTCGI/lib"
465 AC_CHECK_HEADER([fcgio.h],,
466 AC_MSG_ERROR([unable to find FastCGI header files]))
467 FASTCGI_LIBS="-lfcgi -lfcgi++"
470 AC_SUBST(FASTCGI_INCLUDE)
471 AC_SUBST(FASTCGI_LDFLAGS)
472 AC_SUBST(FASTCGI_LIBS)
474 # always output the Makefile, even if you don't use it
475 AC_CONFIG_FILES([fastcgi/Makefile])
476 AM_CONDITIONAL(BUILD_FASTCGI,test ! "$WANT_FASTCGI" = "no")
478 if test ! "$WANT_FASTCGI" = "no" ; then
479 WANT_SUBDIRS="$WANT_SUBDIRS fastcgi"
483 # Build Memcached support?
485 AC_MSG_CHECKING(for Memcached support)
486 AC_ARG_WITH(memcached,
487 AC_HELP_STRING([--with-memcached=DIR], [Build Memcached support]),
488 [WANT_MEMCACHED=$withval],[WANT_MEMCACHED=no])
489 AC_MSG_RESULT($WANT_MEMCACHED)
491 if test "$WANT_MEMCACHED" != "no"; then
492 if test "$WANT_MEMCACHED" != "yes"; then
493 if test x_$WANT_MEMCACHED != x_/usr; then
494 MEMCACHED_INCLUDE="-I$WANT_MEMCACHED/include"
495 MEMCACHED_LDFLAGS="-L$WANT_MEMCACHED/lib"
498 AC_CHECK_HEADER([libmemcached/memcached.h],,
499 AC_MSG_ERROR([unable to find Memcached header files]))
500 MEMCACHED_LIBS="-lmemcached"
503 AC_SUBST(MEMCACHED_INCLUDE)
504 AC_SUBST(MEMCACHED_LDFLAGS)
505 AC_SUBST(MEMCACHED_LIBS)
507 # always output the Makefile, even if you don't use it
508 AC_CONFIG_FILES([memcache-store/Makefile])
509 AM_CONDITIONAL(BUILD_MEMCACHED,test ! "$WANT_MEMCACHED" = "no")
511 if test ! "$WANT_MEMCACHED" = "no" ; then
512 WANT_SUBDIRS="$WANT_SUBDIRS memcache-store"
517 # If no --enable-apache-xx specified
518 # find a default and fake the specific parameters
521 # simple macro to peek at an enable or a with
523 if test "[${[$1]_][$2]+set}" = set; then
524 peekval="${[$1]_[$2]}"
529 AC_MSG_CHECKING(if default apache needed)
531 Peek(enable,apache_13,need_default=no)
532 Peek(enable,apache_20,need_default=no)
533 Peek(enable,apache_22,need_default=no)
534 AC_MSG_RESULT($need_default)
536 if test "$need_default" = "yes"; then
537 # find an apxs, then the httpd
539 Peek(with,apxs,xs="$peekval")
540 Peek(with,apxs2,xs="$peekval")
541 Peek(with,apxs22,xs="$peekval")
542 if test "x$xs" = "x"; then
543 AC_PATH_PROGS(xs, apxs2 apxs,
544 AC_MSG_ERROR(No apxs, no apache found. Try --with-apxs),
545 [/usr/local/apache2/bin:/usr/local/apache/bin:/usr/sbin:$PATH])
547 # ask the daemon for the version and set parameters
548 AC_MSG_CHECKING(default apache version)
549 httpd="`$xs -q SBINDIR`/`$xs -q TARGET`"
550 if test "x$httpd" != "x" && test -f $httpd ; then
551 v=`$httpd -v|$SED -n -e 's/.*Apache\/\.*//p'`
553 1.3*) [enable_apache_13]=yes
557 2.0*) [enable_apache_20]=yes
561 2.2*) [enable_apache_22]=yes
565 *) AC_MSG_ERROR(unusable apache versions: $v. Try setting --with-apxs)
568 AC_MSG_RESULT(cannot determine version. Try setting --with-apxs)
572 # Apache 1.3 (mod_shib_13)
574 # --with-apxs (DSO build, the normal way, uses apxs to derive build flags)
576 AC_ARG_ENABLE(apache-13,
577 AC_HELP_STRING([--enable-apache-13], [enable the Apache 1.3 module]),
578 [ if test "x$enableval" = "x" ; then
581 WANT_APACHE_13="$enableval"
583 ],[ WANT_APACHE_13=no ])
584 AC_MSG_CHECKING(whether to build Apache 1.3 module)
585 if test "$WANT_APACHE_13" != yes && test "$WANT_APACHE_13" != no ; then
588 AC_MSG_RESULT($WANT_APACHE_13)
590 if test "$WANT_APACHE_13" = "yes" ; then
592 AC_HELP_STRING([--with-apxs=FILE], [Specifies where to find the Apache 1.3 apxs script.]),
594 AC_MSG_CHECKING(for user-specified apxs name/location)
595 if test "$withval" != "no" ; then
596 if test "$withval" != "yes"; then
598 AC_MSG_RESULT("$withval")
603 AC_PATH_PROG(APXS, apxs, no)
604 if test "$APXS" = "no" ; then
605 for i in /usr/sbin /usr/local/apache/bin ; do
606 if test "$APXS" = "no" && test -f "$i/apxs"; then
613 AC_MSG_CHECKING([to see if apxs was located])
614 if test ! -f "$APXS" ; then
616 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.])
621 # extract settings we need from APXS -q
622 APXS_CC="`$APXS -q CC`"
623 APXS_CFLAGS="`$APXS -q CFLAGS` `$APXS -q CFLAGS_SHLIB`"
624 APXS_INCLUDE="`$APXS -q INCLUDEDIR`"
627 AC_SUBST(APXS_CFLAGS)
628 AC_SUBST(APXS_INCLUDE)
631 # Apache 2.0 (mod_shib_20)
633 # --with-apxs2 (DSO build, the normal way, uses apxs to derive build flags)
634 # --with-apr (DSO build, APR development package installed separately)
635 # --with-apu (DSO build, APR-UTIL development package installed separately)
637 AC_ARG_ENABLE(apache-20,
638 AC_HELP_STRING([--enable-apache-20], [enable the Apache 2.0 module]),
639 [ if test "x$enableval" = "x" ; then
642 WANT_APACHE_20="$enableval"
644 ],[ WANT_APACHE_20=no ])
645 AC_MSG_CHECKING(whether to build Apache 2.0 module)
646 if test "$WANT_APACHE_20" != yes && test "$WANT_APACHE_20" != no ; then
649 AC_MSG_RESULT($WANT_APACHE_20)
651 if test "$WANT_APACHE_20" = "yes" ; then
653 AC_HELP_STRING([--with-apxs2=FILE], [Specifies where to find the Apache 2.0 apxs script.]),
655 AC_MSG_CHECKING(for user-specified Apache2 apxs name/location)
656 if test "$withval" != "no" ; then
657 if test "$withval" != "yes"; then
659 AC_MSG_RESULT("$withval")
664 AC_PATH_PROG(APXS2, apxs2, no)
665 if test "$APXS2" = "no" ; then
666 AC_PATH_PROG(APXS2, apxs, no)
668 if test "$APXS2" = "no" ; then
669 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
670 if test "$APXS2" = "no" && test -f "$i/apxs2" ; then
674 if test "$APXS2" = "no" ; then
675 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
676 if test "$APXS2" = "no" && test -f "$i/apxs" ; then
684 AC_MSG_CHECKING([to see if Apache2 apxs was located])
685 if test ! -f "$APXS2" ; then
687 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.])
689 AC_MSG_RESULT($APXS2)
694 AC_HELP_STRING([--with-apr=PATH], [where apr-config is installed]),
696 AC_MSG_CHECKING(for user-specified apr-config name/location)
697 if test "$withval" != "no" ; then
698 if test "$withval" != "yes"; then
700 AC_MSG_RESULT("$withval")
705 AC_PATH_PROG(APR_CONFIG, apr-config,,[`$APXS2 -q SBINDIR`]:[$PATH])
707 if test -f "${APR_CONFIG}"; then
708 APR_CFLAGS="`${APR_CONFIG} --cflags` `${APR_CONFIG} --cppflags` `${APR_CONFIG} --includes`"
710 AC_MSG_ERROR([Unable to locate apr-config, may need --with-apr option.])
715 AC_HELP_STRING([--with-apu=PATH], [where apu-config is installed]),
717 AC_MSG_CHECKING(for user-specified apu-config name/location)
718 if test "$withval" != "no" ; then
719 if test "$withval" != "yes"; then
721 AC_MSG_RESULT("$withval")
726 AC_PATH_PROG(APU_CONFIG, apu-config,,[`$APXS2 -q SBINDIR`]:[$PATH])
728 if test -f "${APU_CONFIG}"; then
729 APU_CFLAGS="`${APU_CONFIG} --includes`"
731 AC_MSG_ERROR([Unable to locate apu-config, may need --with-apu option.])
734 # extract settings we need from APXS2 -q
735 APXS2_CC="`$APXS2 -q CC`"
736 APXS2_CFLAGS="`$APXS2 -q CPPFLAGS` `$APXS2 -q CFLAGS` $APU_CFLAGS"
737 APXS2_INCLUDE="`$APXS2 -q INCLUDEDIR`"
740 AC_SUBST(APXS2_CFLAGS)
741 AC_SUBST(APXS2_INCLUDE)
744 # Apache 2.2 (mod_shib_22)
746 # --with-apxs22 (DSO build, the normal way, uses apxs to derive build flags)
747 # --with-apr1 (DSO build, APR development package installed separately)
748 # --with-apu1 (DSO build, APR-UTIL development package installed separately)
750 AC_ARG_ENABLE(apache-22,
751 AC_HELP_STRING([--enable-apache-22], [enable the Apache 2.2 module]),
752 [ if test "x$enableval" = "x" ; then
755 WANT_APACHE_22="$enableval"
757 ],[ WANT_APACHE_22=no ])
758 AC_MSG_CHECKING(whether to build Apache 2.2 module)
759 if test "$WANT_APACHE_22" != yes && test "$WANT_APACHE_22" != no ; then
762 AC_MSG_RESULT($WANT_APACHE_22)
764 if test "$WANT_APACHE_22" = "yes" ; then
766 AC_HELP_STRING([--with-apxs22=FILE], [Specifies where to find the Apache 2.2 apxs script.]),
768 AC_MSG_CHECKING(for user-specified Apache2.2 apxs name/location)
769 if test "$withval" != "no" ; then
770 if test "$withval" != "yes"; then
772 AC_MSG_RESULT("$withval")
777 AC_PATH_PROG(APXS22, apxs2, no)
778 if test "$APXS22" = "no" ; then
779 AC_PATH_PROG(APXS22, apxs, no)
781 if test "$APXS22" = "no" ; then
782 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
783 if test "$APXS22" = "no" && test -f "$i/apxs2" ; then
787 if test "$APXS22" = "no" ; then
788 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
789 if test "$APXS22" = "no" && test -f "$i/apxs" ; then
797 AC_MSG_CHECKING([to see if Apache2.2 apxs was located])
798 if test ! -f "$APXS22" ; then
800 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.])
802 AC_MSG_RESULT($APXS22)
807 AC_HELP_STRING([--with-apr1=PATH], [where apr-1-config is installed]),
809 AC_MSG_CHECKING(for user-specified apr-1-config name/location)
810 if test "$withval" != "no" ; then
811 if test "$withval" != "yes"; then
813 AC_MSG_RESULT("$withval")
818 AC_PATH_PROG(APR1_CONFIG, apr-1-config,,[`$APXS22 -q SBINDIR`]:[$PATH])
820 if test -f "${APR1_CONFIG}"; then
821 APR1_CFLAGS="`${APR1_CONFIG} --cflags` `${APR1_CONFIG} --cppflags` `${APR1_CONFIG} --includes`"
823 AC_MSG_ERROR([Unable to locate apr-1-config, may need --with-apr1 option.])
828 AC_HELP_STRING([--with-apu1=PATH], [where apu-1-config is installed]),
830 AC_MSG_CHECKING(for user-specified apu-1-config name/location)
831 if test "$withval" != "no" ; then
832 if test "$withval" != "yes"; then
834 AC_MSG_RESULT("$withval")
839 AC_PATH_PROG(APU1_CONFIG, apu-1-config,,[`$APXS22 -q SBINDIR`]:[$PATH])
841 if test -f "${APU1_CONFIG}"; then
842 APU1_CFLAGS="`${APU1_CONFIG} --includes`"
844 AC_MSG_ERROR([Unable to locate apu-1-config, may need --with-apu1 option.])
847 # extract settings we need from APXS22 -q
848 APXS22_CC="`$APXS22 -q CC`"
849 APXS22_CFLAGS="`$APXS22 -q CPPFLAGS` `$APXS22 -q CFLAGS` $APR1_CFLAGS $APU1_CFLAGS"
850 APXS22_INCLUDE="`$APXS22 -q INCLUDEDIR`"
853 AC_SUBST(APXS22_CFLAGS)
854 AC_SUBST(APXS22_INCLUDE)
856 # always output the Makefile, even if you don't use it
857 AC_CONFIG_FILES([apache/Makefile])
858 AM_CONDITIONAL(BUILD_AP13,test "$WANT_APACHE_13" = "yes")
859 AM_CONDITIONAL(BUILD_AP20,test "$WANT_APACHE_20" = "yes")
860 AM_CONDITIONAL(BUILD_AP22,test "$WANT_APACHE_22" = "yes")
862 # add the apache module to the list of wanted subdirs..
863 if test "$WANT_APACHE_13" = "yes" || test "$WANT_APACHE_20" = "yes" || test "$WANT_APACHE_22" = "yes" ; then
864 WANT_SUBDIRS="$WANT_SUBDIRS apache"
869 # Implement the checks of the ODBC Storage Service
871 # 1) Assume the user wants ODBC; if it's not found then just continue without
872 # 2) If the user specifically requested odbc, look for it and ERROR if not found
873 # 3) If the user specifically requested no odbc, don't build it.
876 AC_CONFIG_FILES([odbc-store/Makefile])
878 # determine whether we should enable the odbc ccache
879 AC_ARG_ENABLE([odbc],
880 AC_HELP_STRING([--disable-odbc], [disable the ODBC Storage Service]),
881 [odbc_enabled=$enableval], [odbc_enabled=default])
883 if test "x$odbc_enabled" = "x" ; then
887 # Are we trying to build ODBC?
888 AC_MSG_CHECKING(whether to build the ODBC storage service)
889 if test "$odbc_enabled" = "yes" ; then
892 elif test "$odbc_enabled" = "default" ; then
894 AC_MSG_RESULT([yes, if it can be found])
900 # If we're trying to build ODBC, try to find the odbc_config program.
901 if test "$build_odbc" = "yes" ; then
904 AC_HELP_STRING([--with-odbc=PATH], [directory where odbc is installed]),
905 [if test "$with_odbc" = no ; then
906 AC_MSG_ERROR([Try running --disable-odbc instead.])
907 elif test "$with_odbc" != yes ; then
908 odbc_dir="$with_odbc/bin"
909 if test "$with_odbc" != /usr ; then
910 ODBC_CFLAGS="-I$with_odbc/include"
911 ODBC_LIBS="-L$with_odbc/lib"
915 AC_PATH_PROG(ODBC_CONFIG, odbc_config, no, $odbc_dir $PATH )
916 if test "$ODBC_CONFIG" = no ; then
917 AC_MSG_WARN([Cannot find odbc_config, will try to guess settings.])
918 ODBC_LIBS="$ODBC_LIBS -lodbc"
920 ODBC_CFLAGS=`$ODBC_CONFIG --cflags`
921 ODBC_LIBS=`$ODBC_CONFIG --libs`
924 save_CPPFLAGS="$CPPFLAGS"
925 CPPFLAGS="$CPPFLAGS $ODBC_CFLAGS"
927 AC_CHECK_HEADER([sql.h], [have_sql_h=yes], [have_sql_h=no])
928 if test "$have_sql_h" = no -a "$odbc_enabled" = "yes" ; then
929 AC_MSG_ERROR(unable to find ODBC header files)
932 if test "$have_sql_h" = yes ; then
934 LIBS="$LIBS $ODBC_LIBS"
935 AC_MSG_CHECKING(if we can link againt ODBC)
940 [SQLSetEnvAttr(SQL_NULL_HANDLE, SQL_ATTR_CONNECTION_POOLING, (void*)SQL_CP_ONE_PER_HENV, 0)],
941 [have_odbc_libs=yes],
945 if test "$have_odbc_libs" = no ; then
946 if test "$odbc_enabled" = "yes" ; then
947 AC_MSG_ERROR([unable to link with ODBC Library])
949 AC_MSG_RESULT(no, skipping ODBC)
954 CPPFLAGS="$save_CPPFLAGS"
957 # if have_odbc_libs=yes then go ahead with building ODBC
958 if test "$have_odbc_libs" = yes ; then
959 # this AC_MSG_RESULT is from above!
961 WANT_SUBDIRS="$WANT_SUBDIRS odbc-store"
962 AC_SUBST(ODBC_CFLAGS)
967 AC_SUBST(WANT_SUBDIRS)
969 if test -n "$APXS_CC" && test "$APXS_CC" != "$CC" ; then
970 echo "=================================================================="
971 echo "WARNING: You have chosen to compile Apache-1.3 modules with a different"
972 echo " compiler than the one used to compile Apache."
974 echo " Current compiler: $CC"
975 echo " Apache's compiler: $APXS_CC"
977 echo "This could cause problems."
978 echo "=================================================================="
981 if test -n "$APXS2_CC" && test "$APXS2_CC" != "$CC" ; then
982 echo "=================================================================="
983 echo "WARNING: You have chosen to compile Apache-2.0 modules with a different"
984 echo " compiler than the one used to compile Apache."
986 echo " Current compiler: $CC"
987 echo " Apache's compiler: $APXS2_CC"
989 echo "This could cause problems."
990 echo "=================================================================="
993 if test -n "$APXS22_CC" && test "$APXS22_CC" != "$CC" ; then
994 echo "=================================================================="
995 echo "WARNING: You have chosen to compile Apache-2.2 modules with a different"
996 echo " compiler than the one used to compile Apache."
998 echo " Current compiler: $CC"
999 echo " Apache's compiler: $APXS22_CC"
1001 echo "This could cause problems."
1002 echo "=================================================================="
1005 LIBTOOL="$LIBTOOL --silent"