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`"
288 # Establish location of xmltooling catalog.
290 if test "x$with_xmltooling" = "x" ; then
291 with_xmltooling="/usr"
293 if test -f $with_xmltooling/share/xml/xmltooling$XMLTOOLINGVER/catalog.xml ; then
294 XMLTOOLINGXMLDIR="$with_xmltooling"
295 elif test -f $with_xerces/share/xml/xmltooling$XMLTOOLINGVER/catalog.xml ; then
296 XMLTOOLINGXMLDIR="$with_xerces"
297 elif test -f $with_log4shib/share/xml/xmltooling$XMLTOOLINGVER/catalog.xml ; then
298 XMLTOOLINGXMLDIR="$with_log4shib"
300 if test "x$XMLTOOLINGXMLDIR" = "x" ; then
301 AC_MSG_ERROR([xmltooling XML catalog not found, may need to use --with-xmltooling option])
303 XMLTOOLINGXMLDIR="$XMLTOOLINGXMLDIR/share/xml/xmltooling$XMLTOOLINGVER"
304 AC_SUBST(XMLTOOLINGXMLDIR)
306 # XML-Security settings
308 AC_HELP_STRING([--with-xmlsec=PATH], [where xmlsec is installed]),,
311 if test x_$with_xmlsec != x_/usr; then
312 LDFLAGS="-L${with_xmlsec}/lib $LDFLAGS"
313 CPPFLAGS="-I${with_xmlsec}/include $CPPFLAGS"
315 XMLSEC_LIBS="-lxml-security-c $XMLSEC_LIBS"
317 # save and append master libs
319 LIBS="$XMLSEC_LIBS $LIBS"
321 AC_CHECK_HEADER([xsec/utils/XSECPlatformUtils.hpp],,AC_MSG_ERROR([unable to find XML-Security header files]))
322 AC_MSG_CHECKING([XML-Security version])
324 [AC_LANG_PROGRAM([#include <xsec/utils/XSECPlatformUtils.hpp>],
325 [#if XSEC_VERSION_MAJOR > 1 || (XSEC_VERSION_MAJOR == 1 && XSEC_VERSION_MEDIUM > 3)
328 #error need version 1.4.0 or later
331 [AC_MSG_FAILURE([XML-Security version 1.4.0 or greater is required.])])
333 [#include <xsec/utils/XSECPlatformUtils.hpp>],
334 [XSECPlatformUtils::Initialise()],,
335 [AC_MSG_ERROR([unable to link with XML-Security])])
337 # restore master libs
342 AC_HELP_STRING([--with-saml=PATH], [where saml is installed]),
343 [if test x_$with_saml != x_/usr; then
344 LDFLAGS="-L${with_saml}/lib $LDFLAGS"
345 CPPFLAGS="-I${with_saml}/include $CPPFLAGS"
347 XMLSEC_LIBS="-lsaml $XMLSEC_LIBS"
349 # save and append master libs
351 LIBS="$XMLSEC_LIBS $LIBS"
353 AC_CHECK_HEADER([saml/saml2/metadata/Metadata.h],,
354 AC_MSG_ERROR([unable to find OpenSAML header files]))
356 [#include <saml/SAMLConfig.h>
357 #include <saml/version.h>],
358 [#if _OPENSAML_VERSION >= 20200
359 opensaml::SAMLConfig::getConfig();
361 #error Need OpenSAML version 2.2 or higher
363 [AC_DEFINE(HAVE_SAML,1,[Define if saml library was found])],
364 [AC_MSG_ERROR([unable to link with OpenSAML, or version was too old])])
366 # restore master libs
369 # Determine opensaml version.
372 AC_HELP_STRING([--with-samlver=VERSION], [opensaml version, normally derived via pkg-config]),
373 [OPENSAMLVER="-$with_samlver"],
374 [if test "x$PKG_CONFIG" != "x" && test "x$PKG_CONFIG" != "xno" ; then
375 if pkg-config opensaml ; then
376 OPENSAMLVER="-`$PKG_CONFIG --modversion opensaml`"
380 # Establish location of opensaml catalogs.
382 if test "x$with_saml" = "x" ; then
385 if test -f $with_saml/share/xml/opensaml$OPENSAMLVER/saml20-catalog.xml ; then
386 OPENSAMLXMLDIR="$with_saml"
387 elif test -f $with_xmltooling/share/xml/opensaml$OPENSAMLVER/saml20-catalog.xml ; then
388 OPENSAMLXMLDIR="$with_xmltooling"
389 elif test -f $with_xerces/share/xml/opensaml$OPENSAMLVER/saml20-catalog.xml ; then
390 OPENSAMLXMLDIR="$with_xerces"
391 elif test -f $with_log4shib/share/xml/opensaml$OPENSAMLVER/saml20-catalog.xml ; then
392 OPENSAMLXMLDIR="$with_log4shib"
394 if test "x$OPENSAMLXMLDIR" = "x" ; then
395 AC_MSG_ERROR([opensaml XML catalogs not found, may need to use --with-saml option])
397 OPENSAMLXMLDIR="$OPENSAMLXMLDIR/share/xml/opensaml$OPENSAMLVER"
398 AC_SUBST(OPENSAMLXMLDIR)
401 AC_SUBST(XMLSEC_LIBS)
403 AC_CONFIG_FILES([shibboleth.spec pkginfo Portfile])
405 # output the underlying makefiles
406 WANT_SUBDIRS="doc schemas configs shibsp shibd util"
407 AC_CONFIG_FILES([Makefile doc/Makefile schemas/Makefile \
408 configs/Makefile shibsp/Makefile shibd/Makefile \
409 util/Makefile selinux/Makefile])
412 AC_CONFIG_FILES([adfs/Makefile])
413 AC_ARG_ENABLE([adfs],
414 AC_HELP_STRING([--disable-adfs], [don't build the ADFS module]),
415 [adfs_enabled=$enableval], [adfs_enabled=yes])
416 if test "x$adfs_enabled" = "x" ; then
419 AC_MSG_CHECKING(whether to build the ADFS module)
420 if test "$adfs_enabled" = "no" ; then
424 WANT_SUBDIRS="$WANT_SUBDIRS adfs"
429 # Build NSAPI module?
431 AC_MSG_CHECKING(for NSAPI module option)
433 AC_HELP_STRING([--with-nsapi=DIR], [Build NSAPI module for Netscape/iPlanet/SunONE]),
434 [WANT_NSAPI=$withval],[WANT_NSAPI=no])
435 AC_MSG_RESULT($WANT_NSAPI)
437 if test "$WANT_NSAPI" != "no"; then
438 if test ! -d $WANT_NSAPI/bin ; then
439 AC_MSG_ERROR(Please specify the path to the root of your Netscape/iPlanet/SunONE server using --with-nsapi=DIR)
441 AC_MSG_CHECKING(for NSAPI include files)
442 if test -d $WANT_NSAPI/include ; then
443 NSAPI_INCLUDE=$WANT_NSAPI/include
444 AC_MSG_RESULT(Netscape-Enterprise 3.x style)
445 AC_CHECK_HEADERS([$NSAPI_INCLUDE/nsapi.h],,,[#define XP_UNIX])
446 NSAPI_INCLUDE="$NSAPI_INC_DIR -I$NSAPI_INCLUDE"
448 if test -d $WANT_NSAPI/plugins/include ; then
449 test -n "$NSAPI_INCLUDE" && NSAPI_INC_DIR="-I$NSAPI_INCLUDE"
450 NSAPI_INCLUDE="$WANT_NSAPI/plugins/include"
451 AC_MSG_RESULT(iPlanet 4.x / SunONE 6.x style)
452 AC_CHECK_HEADERS([$NSAPI_INCLUDE/nsapi.h],,,[#define XP_UNIX])
453 NSAPI_INCLUDE="$NSAPI_INC_DIR -I$NSAPI_INCLUDE"
455 if test "$NSAPI_INCLUDE" = ""; then
456 AC_MSG_ERROR(Please check you have nsapi.h in either $WANT_NSAPI/include or $WANT_NSAPI/plugins/include)
460 AC_SUBST(NSAPI_INCLUDE)
462 # always output the Makefile, even if you don't use it
463 AC_CONFIG_FILES([nsapi_shib/Makefile])
464 AM_CONDITIONAL(BUILD_NSAPI,test ! "$WANT_NSAPI" = "no")
466 # add the NSAPI module to the list of wanted subdirs..
467 if test ! "$WANT_NSAPI" = "no" ; then
468 WANT_SUBDIRS="$WANT_SUBDIRS nsapi_shib"
473 # Build FastCGI support?
475 AC_MSG_CHECKING(for FastCGI support)
477 AC_HELP_STRING([--with-fastcgi=DIR], [Build FastCGI support]),
478 [WANT_FASTCGI=$withval],[WANT_FASTCGI=no])
479 AC_MSG_RESULT($WANT_FASTCGI)
481 if test "$WANT_FASTCGI" != "no"; then
482 if test "$WANT_FASTCGI" != "yes"; then
483 if test x_$WANT_FASTCGI != x_/usr; then
484 FASTCGI_INCLUDE="-I$WANT_FASTCGI/include"
485 FASTCGI_LDFLAGS="-L$WANT_FASTCGI/lib"
488 AC_CHECK_HEADER([fcgio.h],,
489 AC_MSG_ERROR([unable to find FastCGI header files]))
490 FASTCGI_LIBS="-lfcgi -lfcgi++"
493 AC_SUBST(FASTCGI_INCLUDE)
494 AC_SUBST(FASTCGI_LDFLAGS)
495 AC_SUBST(FASTCGI_LIBS)
497 # always output the Makefile, even if you don't use it
498 AC_CONFIG_FILES([fastcgi/Makefile])
499 AM_CONDITIONAL(BUILD_FASTCGI,test ! "$WANT_FASTCGI" = "no")
501 if test ! "$WANT_FASTCGI" = "no" ; then
502 WANT_SUBDIRS="$WANT_SUBDIRS fastcgi"
506 # Build Memcached support?
508 AC_MSG_CHECKING(for Memcached support)
509 AC_ARG_WITH(memcached,
510 AC_HELP_STRING([--with-memcached=DIR], [Build Memcached support]),
511 [WANT_MEMCACHED=$withval],[WANT_MEMCACHED=no])
512 AC_MSG_RESULT($WANT_MEMCACHED)
514 if test "$WANT_MEMCACHED" != "no"; then
515 if test "$WANT_MEMCACHED" != "yes"; then
516 if test x_$WANT_MEMCACHED != x_/usr; then
517 MEMCACHED_INCLUDE="-I$WANT_MEMCACHED/include"
518 MEMCACHED_LDFLAGS="-L$WANT_MEMCACHED/lib"
521 AC_CHECK_HEADER([libmemcached/memcached.h],,
522 AC_MSG_ERROR([unable to find Memcached header files]))
523 MEMCACHED_LIBS="-lmemcached"
526 AC_SUBST(MEMCACHED_INCLUDE)
527 AC_SUBST(MEMCACHED_LDFLAGS)
528 AC_SUBST(MEMCACHED_LIBS)
530 # always output the Makefile, even if you don't use it
531 AC_CONFIG_FILES([memcache-store/Makefile])
532 AM_CONDITIONAL(BUILD_MEMCACHED,test ! "$WANT_MEMCACHED" = "no")
534 if test ! "$WANT_MEMCACHED" = "no" ; then
535 WANT_SUBDIRS="$WANT_SUBDIRS memcache-store"
540 # If no --enable-apache-xx specified
541 # find a default and fake the specific parameters
544 # simple macro to peek at an enable or a with
546 if test "[${[$1]_][$2]+set}" = set; then
547 peekval="${[$1]_[$2]}"
552 AC_MSG_CHECKING(if default apache needed)
554 Peek(enable,apache_13,need_default=no)
555 Peek(enable,apache_20,need_default=no)
556 Peek(enable,apache_22,need_default=no)
557 AC_MSG_RESULT($need_default)
559 if test "$need_default" = "yes"; then
560 # find an apxs, then the httpd
562 Peek(with,apxs,xs="$peekval")
563 Peek(with,apxs2,xs="$peekval")
564 Peek(with,apxs22,xs="$peekval")
565 if test "x$xs" = "x"; then
566 AC_PATH_PROGS(xs, apxs2 apxs,
567 AC_MSG_ERROR(No apxs, no apache found. Try --with-apxs),
568 [/usr/local/apache2/bin:/usr/local/apache/bin:/usr/sbin:$PATH])
570 # ask the daemon for the version and set parameters
571 AC_MSG_CHECKING(default apache version)
572 httpd="`$xs -q SBINDIR`/`$xs -q TARGET`"
573 if test "x$httpd" != "x" && test -f $httpd ; then
574 v=`$httpd -v|$SED -n -e 's/.*Apache\/\.*//p'`
576 1.3*) [enable_apache_13]=yes
580 2.0*) [enable_apache_20]=yes
584 2.2*) [enable_apache_22]=yes
588 *) AC_MSG_ERROR(unusable apache versions: $v. Try setting --with-apxs)
591 AC_MSG_RESULT(cannot determine version. Try setting --with-apxs)
595 # Apache 1.3 (mod_shib_13)
597 # --with-apxs (DSO build, the normal way, uses apxs to derive build flags)
599 AC_ARG_ENABLE(apache-13,
600 AC_HELP_STRING([--enable-apache-13], [enable the Apache 1.3 module]),
601 [ if test "x$enableval" = "x" ; then
604 WANT_APACHE_13="$enableval"
606 ],[ WANT_APACHE_13=no ])
607 AC_MSG_CHECKING(whether to build Apache 1.3 module)
608 if test "$WANT_APACHE_13" != yes && test "$WANT_APACHE_13" != no ; then
611 AC_MSG_RESULT($WANT_APACHE_13)
613 if test "$WANT_APACHE_13" = "yes" ; then
615 AC_HELP_STRING([--with-apxs=FILE], [Specifies where to find the Apache 1.3 apxs script.]),
617 AC_MSG_CHECKING(for user-specified apxs name/location)
618 if test "$withval" != "no" ; then
619 if test "$withval" != "yes"; then
621 AC_MSG_RESULT("$withval")
626 AC_PATH_PROG(APXS, apxs, no)
627 if test "$APXS" = "no" ; then
628 for i in /usr/sbin /usr/local/apache/bin ; do
629 if test "$APXS" = "no" && test -f "$i/apxs"; then
636 AC_MSG_CHECKING([to see if apxs was located])
637 if test ! -f "$APXS" ; then
639 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.])
644 # extract settings we need from APXS -q
645 APXS_CC="`$APXS -q CC`"
646 APXS_CFLAGS="`$APXS -q CFLAGS` `$APXS -q CFLAGS_SHLIB`"
647 APXS_INCLUDE="`$APXS -q INCLUDEDIR`"
650 AC_SUBST(APXS_CFLAGS)
651 AC_SUBST(APXS_INCLUDE)
654 # Apache 2.0 (mod_shib_20)
656 # --with-apxs2 (DSO build, the normal way, uses apxs to derive build flags)
657 # --with-apr (DSO build, APR development package installed separately)
658 # --with-apu (DSO build, APR-UTIL development package installed separately)
660 AC_ARG_ENABLE(apache-20,
661 AC_HELP_STRING([--enable-apache-20], [enable the Apache 2.0 module]),
662 [ if test "x$enableval" = "x" ; then
665 WANT_APACHE_20="$enableval"
667 ],[ WANT_APACHE_20=no ])
668 AC_MSG_CHECKING(whether to build Apache 2.0 module)
669 if test "$WANT_APACHE_20" != yes && test "$WANT_APACHE_20" != no ; then
672 AC_MSG_RESULT($WANT_APACHE_20)
674 if test "$WANT_APACHE_20" = "yes" ; then
676 AC_HELP_STRING([--with-apxs2=FILE], [Specifies where to find the Apache 2.0 apxs script.]),
678 AC_MSG_CHECKING(for user-specified Apache2 apxs name/location)
679 if test "$withval" != "no" ; then
680 if test "$withval" != "yes"; then
682 AC_MSG_RESULT("$withval")
687 AC_PATH_PROG(APXS2, apxs2, no)
688 if test "$APXS2" = "no" ; then
689 AC_PATH_PROG(APXS2, apxs, no)
691 if test "$APXS2" = "no" ; then
692 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
693 if test "$APXS2" = "no" && test -f "$i/apxs2" ; then
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/apxs" ; then
707 AC_MSG_CHECKING([to see if Apache2 apxs was located])
708 if test ! -f "$APXS2" ; then
710 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.])
712 AC_MSG_RESULT($APXS2)
717 AC_HELP_STRING([--with-apr=PATH], [where apr-config is installed]),
719 AC_MSG_CHECKING(for user-specified apr-config name/location)
720 if test "$withval" != "no" ; then
721 if test "$withval" != "yes"; then
723 AC_MSG_RESULT("$withval")
728 AC_PATH_PROG(APR_CONFIG, apr-config,,[`$APXS2 -q SBINDIR`]:[$PATH])
730 if test -f "${APR_CONFIG}"; then
731 APR_CFLAGS="`${APR_CONFIG} --cflags` `${APR_CONFIG} --cppflags` `${APR_CONFIG} --includes`"
733 AC_MSG_ERROR([Unable to locate apr-config, may need --with-apr option.])
738 AC_HELP_STRING([--with-apu=PATH], [where apu-config is installed]),
740 AC_MSG_CHECKING(for user-specified apu-config name/location)
741 if test "$withval" != "no" ; then
742 if test "$withval" != "yes"; then
744 AC_MSG_RESULT("$withval")
749 AC_PATH_PROG(APU_CONFIG, apu-config,,[`$APXS2 -q SBINDIR`]:[$PATH])
751 if test -f "${APU_CONFIG}"; then
752 APU_CFLAGS="`${APU_CONFIG} --includes`"
754 AC_MSG_ERROR([Unable to locate apu-config, may need --with-apu option.])
757 # extract settings we need from APXS2 -q
758 APXS2_CC="`$APXS2 -q CC`"
759 APXS2_CFLAGS="`$APXS2 -q CPPFLAGS` `$APXS2 -q CFLAGS` $APU_CFLAGS"
760 APXS2_INCLUDE="`$APXS2 -q INCLUDEDIR`"
763 AC_SUBST(APXS2_CFLAGS)
764 AC_SUBST(APXS2_INCLUDE)
767 # Apache 2.2 (mod_shib_22)
769 # --with-apxs22 (DSO build, the normal way, uses apxs to derive build flags)
770 # --with-apr1 (DSO build, APR development package installed separately)
771 # --with-apu1 (DSO build, APR-UTIL development package installed separately)
773 AC_ARG_ENABLE(apache-22,
774 AC_HELP_STRING([--enable-apache-22], [enable the Apache 2.2 module]),
775 [ if test "x$enableval" = "x" ; then
778 WANT_APACHE_22="$enableval"
780 ],[ WANT_APACHE_22=no ])
781 AC_MSG_CHECKING(whether to build Apache 2.2 module)
782 if test "$WANT_APACHE_22" != yes && test "$WANT_APACHE_22" != no ; then
785 AC_MSG_RESULT($WANT_APACHE_22)
787 if test "$WANT_APACHE_22" = "yes" ; then
789 AC_HELP_STRING([--with-apxs22=FILE], [Specifies where to find the Apache 2.2 apxs script.]),
791 AC_MSG_CHECKING(for user-specified Apache2.2 apxs name/location)
792 if test "$withval" != "no" ; then
793 if test "$withval" != "yes"; then
795 AC_MSG_RESULT("$withval")
800 AC_PATH_PROG(APXS22, apxs2, no)
801 if test "$APXS22" = "no" ; then
802 AC_PATH_PROG(APXS22, apxs, no)
804 if test "$APXS22" = "no" ; then
805 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
806 if test "$APXS22" = "no" && test -f "$i/apxs2" ; then
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/apxs" ; then
820 AC_MSG_CHECKING([to see if Apache2.2 apxs was located])
821 if test ! -f "$APXS22" ; then
823 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.])
825 AC_MSG_RESULT($APXS22)
830 AC_HELP_STRING([--with-apr1=PATH], [where apr-1-config is installed]),
832 AC_MSG_CHECKING(for user-specified apr-1-config name/location)
833 if test "$withval" != "no" ; then
834 if test "$withval" != "yes"; then
836 AC_MSG_RESULT("$withval")
841 AC_PATH_PROG(APR1_CONFIG, apr-1-config,,[`$APXS22 -q SBINDIR`]:[$PATH])
843 if test -f "${APR1_CONFIG}"; then
844 APR1_CFLAGS="`${APR1_CONFIG} --cflags` `${APR1_CONFIG} --cppflags` `${APR1_CONFIG} --includes`"
846 AC_MSG_ERROR([Unable to locate apr-1-config, may need --with-apr1 option.])
851 AC_HELP_STRING([--with-apu1=PATH], [where apu-1-config is installed]),
853 AC_MSG_CHECKING(for user-specified apu-1-config name/location)
854 if test "$withval" != "no" ; then
855 if test "$withval" != "yes"; then
857 AC_MSG_RESULT("$withval")
862 AC_PATH_PROG(APU1_CONFIG, apu-1-config,,[`$APXS22 -q SBINDIR`]:[$PATH])
864 if test -f "${APU1_CONFIG}"; then
865 APU1_CFLAGS="`${APU1_CONFIG} --includes`"
867 AC_MSG_ERROR([Unable to locate apu-1-config, may need --with-apu1 option.])
870 # extract settings we need from APXS22 -q
871 APXS22_CC="`$APXS22 -q CC`"
872 APXS22_CFLAGS="`$APXS22 -q CPPFLAGS` `$APXS22 -q CFLAGS` $APR1_CFLAGS $APU1_CFLAGS"
873 APXS22_INCLUDE="`$APXS22 -q INCLUDEDIR`"
876 AC_SUBST(APXS22_CFLAGS)
877 AC_SUBST(APXS22_INCLUDE)
879 # always output the Makefile, even if you don't use it
880 AC_CONFIG_FILES([apache/Makefile])
881 AM_CONDITIONAL(BUILD_AP13,test "$WANT_APACHE_13" = "yes")
882 AM_CONDITIONAL(BUILD_AP20,test "$WANT_APACHE_20" = "yes")
883 AM_CONDITIONAL(BUILD_AP22,test "$WANT_APACHE_22" = "yes")
885 # add the apache module to the list of wanted subdirs..
886 if test "$WANT_APACHE_13" = "yes" || test "$WANT_APACHE_20" = "yes" || test "$WANT_APACHE_22" = "yes" ; then
887 WANT_SUBDIRS="$WANT_SUBDIRS apache"
892 # Implement the checks of the ODBC Storage Service
894 # 1) Assume the user wants ODBC; if it's not found then just continue without
895 # 2) If the user specifically requested odbc, look for it and ERROR if not found
896 # 3) If the user specifically requested no odbc, don't build it.
899 AC_CONFIG_FILES([odbc-store/Makefile])
901 # determine whether we should enable the odbc ccache
902 AC_ARG_ENABLE([odbc],
903 AC_HELP_STRING([--disable-odbc], [disable the ODBC Storage Service]),
904 [odbc_enabled=$enableval], [odbc_enabled=default])
906 if test "x$odbc_enabled" = "x" ; then
910 # Are we trying to build ODBC?
911 AC_MSG_CHECKING(whether to build the ODBC storage service)
912 if test "$odbc_enabled" = "yes" ; then
915 elif test "$odbc_enabled" = "default" ; then
917 AC_MSG_RESULT([yes, if it can be found])
923 # If we're trying to build ODBC, try to find the odbc_config program.
924 if test "$build_odbc" = "yes" ; then
927 AC_HELP_STRING([--with-odbc=PATH], [directory where odbc is installed]),
928 [if test "$with_odbc" = no ; then
929 AC_MSG_ERROR([Try running --disable-odbc instead.])
930 elif test "$with_odbc" != yes ; then
931 odbc_dir="$with_odbc/bin"
932 if test "$with_odbc" != /usr ; then
933 ODBC_CFLAGS="-I$with_odbc/include"
934 ODBC_LIBS="-L$with_odbc/lib"
938 AC_PATH_PROG(ODBC_CONFIG, odbc_config, no, $odbc_dir $PATH )
939 if test "$ODBC_CONFIG" = no ; then
940 AC_MSG_WARN([Cannot find odbc_config, will try to guess settings.])
941 ODBC_LIBS="$ODBC_LIBS -lodbc"
943 ODBC_CFLAGS=`$ODBC_CONFIG --cflags`
944 ODBC_LIBS=`$ODBC_CONFIG --libs`
947 save_CPPFLAGS="$CPPFLAGS"
948 CPPFLAGS="$CPPFLAGS $ODBC_CFLAGS"
950 AC_CHECK_HEADER([sql.h], [have_sql_h=yes], [have_sql_h=no])
951 if test "$have_sql_h" = no -a "$odbc_enabled" = "yes" ; then
952 AC_MSG_ERROR(unable to find ODBC header files)
955 if test "$have_sql_h" = yes ; then
957 LIBS="$LIBS $ODBC_LIBS"
958 AC_MSG_CHECKING(if we can link againt ODBC)
963 [SQLSetEnvAttr(SQL_NULL_HANDLE, SQL_ATTR_CONNECTION_POOLING, (void*)SQL_CP_ONE_PER_HENV, 0)],
964 [have_odbc_libs=yes],
968 if test "$have_odbc_libs" = no ; then
969 if test "$odbc_enabled" = "yes" ; then
970 AC_MSG_ERROR([unable to link with ODBC Library])
972 AC_MSG_RESULT(no, skipping ODBC)
977 CPPFLAGS="$save_CPPFLAGS"
980 # if have_odbc_libs=yes then go ahead with building ODBC
981 if test "$have_odbc_libs" = yes ; then
982 # this AC_MSG_RESULT is from above!
984 WANT_SUBDIRS="$WANT_SUBDIRS odbc-store"
985 AC_SUBST(ODBC_CFLAGS)
990 AC_SUBST(WANT_SUBDIRS)
992 if test -n "$APXS_CC" && test "$APXS_CC" != "$CC" ; then
993 echo "=================================================================="
994 echo "WARNING: You have chosen to compile Apache-1.3 modules with a different"
995 echo " compiler than the one used to compile Apache."
997 echo " Current compiler: $CC"
998 echo " Apache's compiler: $APXS_CC"
1000 echo "This could cause problems."
1001 echo "=================================================================="
1004 if test -n "$APXS2_CC" && test "$APXS2_CC" != "$CC" ; then
1005 echo "=================================================================="
1006 echo "WARNING: You have chosen to compile Apache-2.0 modules with a different"
1007 echo " compiler than the one used to compile Apache."
1009 echo " Current compiler: $CC"
1010 echo " Apache's compiler: $APXS2_CC"
1012 echo "This could cause problems."
1013 echo "=================================================================="
1016 if test -n "$APXS22_CC" && test "$APXS22_CC" != "$CC" ; then
1017 echo "=================================================================="
1018 echo "WARNING: You have chosen to compile Apache-2.2 modules with a different"
1019 echo " compiler than the one used to compile Apache."
1021 echo " Current compiler: $CC"
1022 echo " Apache's compiler: $APXS22_CC"
1024 echo "This could cause problems."
1025 echo "=================================================================="
1028 LIBTOOL="$LIBTOOL --silent"