2 AC_INIT([shibboleth], [2.1], [shibboleth-users@internet2.edu], [shibboleth])
3 AM_CONFIG_HEADER(config.h)
4 AM_INIT_AUTOMAKE([shibboleth],[2.1])
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"
88 # Thank you Solaris, really.
89 AC_MSG_CHECKING(for ctime_r)
90 if test -z "$ac_cv_ctime_args"; then
97 ], ac_cv_ctime_args=2)
104 ctime_r(&clock, buf, 26);
105 ], ac_cv_ctime_args=3)
107 if test -z "$ac_cv_ctime_args"; then
110 if test "$ac_cv_ctime_args" = 2; then
111 AC_DEFINE(HAVE_CTIME_R_2,1,[Define if ctime_r is present with 2 parameters.])
112 elif test "$ac_cv_ctime_args" = 3; then
113 AC_DEFINE(HAVE_CTIME_R_3,1,[Define if ctime_r is present with 3 parameters.])
115 AC_MSG_RESULT([yes, and it takes $ac_cv_ctime_args arguments])
120 AC_HELP_STRING([--with-openssl=PATH], [where openssl is installed]),
121 [if test x_$with_openssl != x_/usr; then
122 SSLFLAGS="-I${with_openssl}/include"
125 if test "x$SSLFLAGS" = "x" ; then
126 AC_PATH_PROG(PKG_CONFIG, pkg-config)
127 if test "x$PKG_CONFIG" != x && test "x$PKG_CONFIG" != "xno" ; then
128 if pkg-config openssl ; then
129 SSLFLAGS="`$PKG_CONFIG --cflags openssl`"
131 AC_MSG_ERROR([OpenSSL not supported by pkg-config, try --with-openssl instead])
136 AC_MSG_CHECKING(for OpenSSL cflags)
137 AC_MSG_RESULT($SSLFLAGS)
138 CPPFLAGS="$SSLFLAGS $CPPFLAGS"
140 AC_CHECK_HEADER([openssl/x509.h],,
141 AC_MSG_ERROR([unable to find openssl header files]))
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])])
226 #XML-Tooling settings
227 AC_ARG_WITH(xmltooling,
228 AC_HELP_STRING([--with-xmltooling=PATH], [where xmltooling-c is installed]),
229 [if test x_$with_xmltooling != x_/usr; then
230 LDFLAGS="-L${with_xmltooling}/lib $LDFLAGS"
231 CPPFLAGS="-I${with_xmltooling}/include $CPPFLAGS"
233 LITE_LIBS="-lxmltooling-lite"
234 XMLSEC_LIBS="-lxmltooling"
235 AC_CHECK_HEADER([xmltooling/base.h],,
236 AC_MSG_ERROR([unable to find xmltooling header files]))
238 # Establish location of xmltooling catalog.
240 if test "x$with_xmltooling" = "x" ; then
241 with_xmltooling="/usr"
243 if test -f $with_xmltooling/share/xml/xmltooling/catalog.xml ; then
244 XMLTOOLINGXMLDIR="$with_xmltooling"
245 elif test -f $with_xerces/share/xml/xmltooling/catalog.xml ; then
246 XMLTOOLINGXMLDIR="$with_xerces"
247 elif test -f $with_log4shib/share/xml/xmltooling/catalog.xml ; then
248 XMLTOOLINGXMLDIR="$with_log4shib"
250 if test "x$XMLTOOLINGXMLDIR" = "x" ; then
251 AC_MSG_ERROR([xmltooling XML catalog not found, may need to use --with-xmltooling option])
253 XMLTOOLINGXMLDIR="$XMLTOOLINGXMLDIR/share/xml/xmltooling"
254 AC_SUBST(XMLTOOLINGXMLDIR)
256 # XML-Security settings
258 AC_HELP_STRING([--with-xmlsec=PATH], [where xmlsec is installed]),,
261 if test x_$with_xmlsec != x_/usr; then
262 LDFLAGS="-L${with_xmlsec}/lib $LDFLAGS"
263 CPPFLAGS="-I${with_xmlsec}/include $CPPFLAGS"
265 XMLSEC_LIBS="-lxml-security-c $XMLSEC_LIBS"
267 # save and append master libs
269 LIBS="$XMLSEC_LIBS $LIBS"
271 AC_CHECK_HEADER([xsec/utils/XSECPlatformUtils.hpp],,AC_MSG_ERROR([unable to find XML-Security header files]))
272 AC_MSG_CHECKING([XML-Security version])
274 [AC_LANG_PROGRAM([#include <xsec/utils/XSECPlatformUtils.hpp>],
275 [#if XSEC_VERSION_MAJOR > 1 || (XSEC_VERSION_MAJOR == 1 && XSEC_VERSION_MEDIUM > 3)
278 #error need version 1.4.0 or later
281 [AC_MSG_FAILURE([XML-Security version 1.4.0 or greater is required.])])
283 [#include <xsec/utils/XSECPlatformUtils.hpp>],
284 [XSECPlatformUtils::Initialise()],,
285 [AC_MSG_ERROR([unable to link with XML-Security])])
287 # restore master libs
292 AC_HELP_STRING([--with-saml=PATH], [where saml is installed]),
293 [if test x_$with_saml != x_/usr; then
294 LDFLAGS="-L${with_saml}/lib $LDFLAGS"
295 CPPFLAGS="-I${with_saml}/include $CPPFLAGS"
297 XMLSEC_LIBS="-lsaml $XMLSEC_LIBS"
299 # save and append master libs
301 LIBS="$XMLSEC_LIBS $LIBS"
303 AC_CHECK_HEADER([saml/saml2/metadata/Metadata.h],,
304 AC_MSG_ERROR([unable to find OpenSAML header files]))
306 [#include <saml/SAMLConfig.h>
307 #include <saml/version.h>],
308 [#if _OPENSAML_VERSION >= 20000
309 opensaml::SAMLConfig::getConfig();
311 #error Need OpenSAML version 2.0 or higher
313 [AC_DEFINE(HAVE_SAML,1,[Define if saml library was found])],
314 [AC_MSG_ERROR([unable to link with OpenSAML, or version was too old])])
316 # restore master libs
319 # Establish location of opensaml catalogs.
321 if test "x$with_saml" = "x" ; then
324 if test -f $with_saml/share/xml/opensaml/saml20-catalog.xml ; then
325 OPENSAMLXMLDIR="$with_saml"
326 elif test -f $with_xmltooling/share/xml/opensaml/saml20-catalog.xml ; then
327 OPENSAMLXMLDIR="$with_xmltooling"
328 elif test -f $with_xerces/share/xml/opensaml/saml20-catalog.xml ; then
329 OPENSAMLXMLDIR="$with_xerces"
330 elif test -f $with_log4shib/share/xml/opensaml/saml20-catalog.xml ; then
331 OPENSAMLXMLDIR="$with_log4shib"
333 if test "x$OPENSAMLXMLDIR" = "x" ; then
334 AC_MSG_ERROR([opensaml XML catalogs not found, may need to use --with-saml option])
336 OPENSAMLXMLDIR="$OPENSAMLXMLDIR/share/xml/opensaml"
337 AC_SUBST(OPENSAMLXMLDIR)
340 AC_SUBST(XMLSEC_LIBS)
342 # output the underlying makefiles
343 WANT_SUBDIRS="doc schemas configs shibsp shibd util"
344 AC_CONFIG_FILES([Makefile doc/Makefile schemas/Makefile \
345 configs/Makefile shibsp/Makefile shibd/Makefile \
346 util/Makefile selinux/Makefile])
349 AC_CONFIG_FILES([adfs/Makefile])
350 AC_ARG_ENABLE([adfs],
351 AC_HELP_STRING([--disable-adfs], [don't build the ADFS module]),
352 [adfs_enabled=$enableval], [adfs_enabled=yes])
353 if test "x$adfs_enabled" = "x" ; then
356 AC_MSG_CHECKING(whether to build the ADFS module)
357 if test "$adfs_enabled" = "no" ; then
361 WANT_SUBDIRS="$WANT_SUBDIRS adfs"
366 # Build NSAPI module?
368 AC_MSG_CHECKING(for NSAPI module option)
370 AC_HELP_STRING([--with-nsapi=DIR], [Build NSAPI module for Netscape/iPlanet/SunONE]),
371 [WANT_NSAPI=$withval],[WANT_NSAPI=no])
372 AC_MSG_RESULT($WANT_NSAPI)
374 if test "$WANT_NSAPI" != "no"; then
375 if test ! -d $WANT_NSAPI/bin ; then
376 AC_MSG_ERROR(Please specify the path to the root of your Netscape/iPlanet/SunONE server using --with-nsapi=DIR)
378 AC_MSG_CHECKING(for NSAPI include files)
379 if test -d $WANT_NSAPI/include ; then
380 NSAPI_INCLUDE=$WANT_NSAPI/include
381 AC_MSG_RESULT(Netscape-Enterprise 3.x style)
382 AC_CHECK_HEADERS([$NSAPI_INCLUDE/nsapi.h],,,[#define XP_UNIX])
383 NSAPI_INCLUDE="$NSAPI_INC_DIR -I$NSAPI_INCLUDE"
385 if test -d $WANT_NSAPI/plugins/include ; then
386 test -n "$NSAPI_INCLUDE" && NSAPI_INC_DIR="-I$NSAPI_INCLUDE"
387 NSAPI_INCLUDE="$WANT_NSAPI/plugins/include"
388 AC_MSG_RESULT(iPlanet 4.x / SunONE 6.x style)
389 AC_CHECK_HEADERS([$NSAPI_INCLUDE/nsapi.h],,,[#define XP_UNIX])
390 NSAPI_INCLUDE="$NSAPI_INC_DIR -I$NSAPI_INCLUDE"
392 if test "$NSAPI_INCLUDE" = ""; then
393 AC_MSG_ERROR(Please check you have nsapi.h in either $WANT_NSAPI/include or $WANT_NSAPI/plugins/include)
397 AC_SUBST(NSAPI_INCLUDE)
399 # always output the Makefile, even if you don't use it
400 AC_CONFIG_FILES([nsapi_shib/Makefile])
401 AM_CONDITIONAL(BUILD_NSAPI,test ! "$WANT_NSAPI" = "no")
403 # add the NSAPI module to the list of wanted subdirs..
404 if test ! "$WANT_NSAPI" = "no" ; then
405 WANT_SUBDIRS="$WANT_SUBDIRS nsapi_shib"
410 # Build FastCGI support?
412 AC_MSG_CHECKING(for FastCGI support)
414 AC_HELP_STRING([--with-fastcgi=DIR], [Build FastCGI support]),
415 [WANT_FASTCGI=$withval],[WANT_FASTCGI=no])
416 AC_MSG_RESULT($WANT_FASTCGI)
418 if test "$WANT_FASTCGI" != "no"; then
419 if test "$WANT_FASTCGI" != "yes"; then
420 if test x_$WANT_FASTCGI != x_/usr; then
421 FASTCGI_INCLUDE="-I$WANT_FASTCGI/include"
422 FASTCGI_LDFLAGS="-L$WANT_FASTCGI/lib"
425 AC_CHECK_HEADER([fcgio.h],,
426 AC_MSG_ERROR([unable to find FastCGI header files]))
427 FASTCGI_LIBS="-lfcgi -lfcgi++"
430 AC_SUBST(FASTCGI_INCLUDE)
431 AC_SUBST(FASTCGI_LDFLAGS)
432 AC_SUBST(FASTCGI_LIBS)
434 # always output the Makefile, even if you don't use it
435 AC_CONFIG_FILES([fastcgi/Makefile])
436 AM_CONDITIONAL(BUILD_FASTCGI,test ! "$WANT_FASTCGI" = "no")
438 if test ! "$WANT_FASTCGI" = "no" ; then
439 WANT_SUBDIRS="$WANT_SUBDIRS fastcgi"
443 # Build Memcached support?
445 AC_MSG_CHECKING(for Memcached support)
446 AC_ARG_WITH(memcached,
447 AC_HELP_STRING([--with-memcached=DIR], [Build Memcached support]),
448 [WANT_MEMCACHED=$withval],[WANT_MEMCACHED=no])
449 AC_MSG_RESULT($WANT_MEMCACHED)
451 if test "$WANT_MEMCACHED" != "no"; then
452 if test "$WANT_MEMCACHED" != "yes"; then
453 if test x_$WANT_MEMCACHED != x_/usr; then
454 MEMCACHED_INCLUDE="-I$WANT_MEMCACHED/include"
455 MEMCACHED_LDFLAGS="-L$WANT_MEMCACHED/lib"
458 AC_CHECK_HEADER([libmemcached/memcached.h],,
459 AC_MSG_ERROR([unable to find Memcached header files]))
460 MEMCACHED_LIBS="-lmemcached"
463 AC_SUBST(MEMCACHED_INCLUDE)
464 AC_SUBST(MEMCACHED_LDFLAGS)
465 AC_SUBST(MEMCACHED_LIBS)
467 # always output the Makefile, even if you don't use it
468 AC_CONFIG_FILES([memcache-store/Makefile])
469 AM_CONDITIONAL(BUILD_MEMCACHED,test ! "$WANT_MEMCACHED" = "no")
471 if test ! "$WANT_MEMCACHED" = "no" ; then
472 WANT_SUBDIRS="$WANT_SUBDIRS memcache-store"
477 # If no --enable-apache-xx specified
478 # find a default and fake the specific parameters
481 # simple macro to peek at an enable or a with
483 if test "[${[$1]_][$2]+set}" = set; then
484 peekval="${[$1]_[$2]}"
489 AC_MSG_CHECKING(if default apache needed)
491 Peek(enable,apache_13,need_default=no)
492 Peek(enable,apache_20,need_default=no)
493 Peek(enable,apache_22,need_default=no)
494 AC_MSG_RESULT($need_default)
496 if test "$need_default" = "yes"; then
497 # find an apxs, then the httpd
499 Peek(with,apxs,xs="$peekval")
500 Peek(with,apxs2,xs="$peekval")
501 Peek(with,apxs22,xs="$peekval")
502 if test "x$xs" = "x"; then
503 AC_PATH_PROGS(xs, apxs2 apxs,
504 AC_MSG_ERROR(No apxs, no apache found. Try --with-apxs),
505 [/usr/local/apache2/bin:/usr/local/apache/bin:/usr/sbin:$PATH])
507 # ask the daemon for the version and set parameters
508 AC_MSG_CHECKING(default apache version)
509 httpd="`$xs -q SBINDIR`/`$xs -q TARGET`"
510 if test "x$httpd" != "x" && test -f $httpd ; then
511 v=`$httpd -v|$SED -n -e 's/.*Apache\/\.*//p'`
513 1.3*) [enable_apache_13]=yes
517 2.0*) [enable_apache_20]=yes
521 2.2*) [enable_apache_22]=yes
525 *) AC_MSG_ERROR(unusable apache versions: $v. Try setting --with-apxs)
528 AC_MSG_RESULT(cannot determine version. Try setting --with-apxs)
532 # Apache 1.3 (mod_shib_13)
534 # --with-apxs (DSO build, the normal way, uses apxs to derive build flags)
536 AC_ARG_ENABLE(apache-13,
537 AC_HELP_STRING([--enable-apache-13], [enable the Apache 1.3 module]),
538 [ if test "x$enableval" = "x" ; then
541 WANT_APACHE_13="$enableval"
543 ],[ WANT_APACHE_13=no ])
544 AC_MSG_CHECKING(whether to build Apache 1.3 module)
545 if test "$WANT_APACHE_13" != yes && test "$WANT_APACHE_13" != no ; then
548 AC_MSG_RESULT($WANT_APACHE_13)
550 if test "$WANT_APACHE_13" = "yes" ; then
552 AC_HELP_STRING([--with-apxs=FILE], [Specifies where to find the Apache 1.3 apxs script.]),
554 AC_MSG_CHECKING(for user-specified apxs name/location)
555 if test "$withval" != "no" ; then
556 if test "$withval" != "yes"; then
558 AC_MSG_RESULT("$withval")
563 AC_PATH_PROG(APXS, apxs, no)
564 if test "$APXS" = "no" ; then
565 for i in /usr/sbin /usr/local/apache/bin ; do
566 if test "$APXS" = "no" && test -f "$i/apxs"; then
573 AC_MSG_CHECKING([to see if apxs was located])
574 if test ! -f "$APXS" ; then
576 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.])
581 # extract settings we need from APXS -q
582 APXS_CC="`$APXS -q CC`"
583 APXS_CFLAGS="`$APXS -q CFLAGS` `$APXS -q CFLAGS_SHLIB`"
584 APXS_INCLUDE="`$APXS -q INCLUDEDIR`"
587 AC_SUBST(APXS_CFLAGS)
588 AC_SUBST(APXS_INCLUDE)
591 # Apache 2.0 (mod_shib_20)
593 # --with-apxs2 (DSO build, the normal way, uses apxs to derive build flags)
594 # --with-apr (DSO build, APR development package installed separately)
596 AC_ARG_ENABLE(apache-20,
597 AC_HELP_STRING([--enable-apache-20], [enable the Apache 2.0 module]),
598 [ if test "x$enableval" = "x" ; then
601 WANT_APACHE_20="$enableval"
603 ],[ WANT_APACHE_20=no ])
604 AC_MSG_CHECKING(whether to build Apache 2.0 module)
605 if test "$WANT_APACHE_20" != yes && test "$WANT_APACHE_20" != no ; then
608 AC_MSG_RESULT($WANT_APACHE_20)
610 if test "$WANT_APACHE_20" = "yes" ; then
612 AC_HELP_STRING([--with-apxs2=FILE], [Specifies where to find the Apache 2.0 apxs script.]),
614 AC_MSG_CHECKING(for user-specified Apache2 apxs name/location)
615 if test "$withval" != "no" ; then
616 if test "$withval" != "yes"; then
618 AC_MSG_RESULT("$withval")
623 AC_PATH_PROG(APXS2, apxs2, no)
624 if test "$APXS2" = "no" ; then
625 AC_PATH_PROG(APXS2, apxs, no)
627 if test "$APXS2" = "no" ; then
628 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
629 if test "$APXS2" = "no" && test -f "$i/apxs2" ; then
633 if test "$APXS2" = "no" ; then
634 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
635 if test "$APXS2" = "no" && test -f "$i/apxs" ; then
643 AC_MSG_CHECKING([to see if Apache2 apxs was located])
644 if test ! -f "$APXS2" ; then
646 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.])
648 AC_MSG_RESULT($APXS2)
653 AC_HELP_STRING([--with-apr=PATH], [where apr-config is installed]),
655 AC_MSG_CHECKING(for user-specified apr-config name/location)
656 if test "$withval" != "no" ; then
657 if test "$withval" != "yes"; then
659 AC_MSG_RESULT("$withval")
664 AC_PATH_PROG(APR_CONFIG, apr-config,,[`$APXS2 -q SBINDIR`]:[$PATH])
666 if test -f "${APR_CONFIG}"; then
667 APR_CFLAGS="`${APR_CONFIG} --cflags` `${APR_CONFIG} --cppflags` `${APR_CONFIG} --includes`"
669 AC_MSG_ERROR([Unable to locate apr-config, may need --with-apr option.])
672 # extract settings we need from APXS2 -q
673 APXS2_CC="`$APXS2 -q CC`"
674 APXS2_CFLAGS="`$APXS2 -q CPPFLAGS` `$APXS2 -q CFLAGS` $APR_CFLAGS"
675 APXS2_INCLUDE="`$APXS2 -q INCLUDEDIR`"
678 AC_SUBST(APXS2_CFLAGS)
679 AC_SUBST(APXS2_INCLUDE)
682 # Apache 2.2 (mod_shib_22)
684 # --with-apxs22 (DSO build, the normal way, uses apxs to derive build flags)
685 # --with-apr1 (DSO build, APR development package installed separately)
687 AC_ARG_ENABLE(apache-22,
688 AC_HELP_STRING([--enable-apache-22], [enable the Apache 2.2 module]),
689 [ if test "x$enableval" = "x" ; then
692 WANT_APACHE_22="$enableval"
694 ],[ WANT_APACHE_22=no ])
695 AC_MSG_CHECKING(whether to build Apache 2.2 module)
696 if test "$WANT_APACHE_22" != yes && test "$WANT_APACHE_22" != no ; then
699 AC_MSG_RESULT($WANT_APACHE_22)
701 if test "$WANT_APACHE_22" = "yes" ; then
703 AC_HELP_STRING([--with-apxs22=FILE], [Specifies where to find the Apache 2.2 apxs script.]),
705 AC_MSG_CHECKING(for user-specified Apache2.2 apxs name/location)
706 if test "$withval" != "no" ; then
707 if test "$withval" != "yes"; then
709 AC_MSG_RESULT("$withval")
714 AC_PATH_PROG(APXS22, apxs2, no)
715 if test "$APXS22" = "no" ; then
716 AC_PATH_PROG(APXS22, apxs, no)
718 if test "$APXS22" = "no" ; then
719 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
720 if test "$APXS22" = "no" && test -f "$i/apxs2" ; then
724 if test "$APXS22" = "no" ; then
725 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
726 if test "$APXS22" = "no" && test -f "$i/apxs" ; then
734 AC_MSG_CHECKING([to see if Apache2.2 apxs was located])
735 if test ! -f "$APXS22" ; then
737 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.])
739 AC_MSG_RESULT($APXS22)
744 AC_HELP_STRING([--with-apr1=PATH], [where apr-1-config is installed]),
746 AC_MSG_CHECKING(for user-specified apr-1-config name/location)
747 if test "$withval" != "no" ; then
748 if test "$withval" != "yes"; then
750 AC_MSG_RESULT("$withval")
755 AC_PATH_PROG(APR1_CONFIG, apr-1-config,,[`$APXS22 -q SBINDIR`]:[$PATH])
757 if test -f "${APR1_CONFIG}"; then
758 APR1_CFLAGS="`${APR1_CONFIG} --cflags` `${APR1_CONFIG} --cppflags` `${APR1_CONFIG} --includes`"
760 AC_MSG_ERROR([Unable to locate apr-1-config, may need --with-apr1 option.])
763 # extract settings we need from APXS22 -q
764 APXS22_CC="`$APXS22 -q CC`"
765 APXS22_CFLAGS="`$APXS22 -q CPPFLAGS` `$APXS22 -q CFLAGS` $APR1_CFLAGS"
766 APXS22_INCLUDE="`$APXS22 -q INCLUDEDIR`"
769 AC_SUBST(APXS22_CFLAGS)
770 AC_SUBST(APXS22_INCLUDE)
772 # always output the Makefile, even if you don't use it
773 AC_CONFIG_FILES([apache/Makefile])
774 AM_CONDITIONAL(BUILD_AP13,test "$WANT_APACHE_13" = "yes")
775 AM_CONDITIONAL(BUILD_AP20,test "$WANT_APACHE_20" = "yes")
776 AM_CONDITIONAL(BUILD_AP22,test "$WANT_APACHE_22" = "yes")
778 # add the apache module to the list of wanted subdirs..
779 if test "$WANT_APACHE_13" = "yes" || test "$WANT_APACHE_20" = "yes" || test "$WANT_APACHE_22" = "yes" ; then
780 WANT_SUBDIRS="$WANT_SUBDIRS apache"
785 # Implement the checks of the ODBC Storage Service
787 # 1) Assume the user wants ODBC; if it's not found then just continue without
788 # 2) If the user specifically requested odbc, look for it and ERROR if not found
789 # 3) If the user specifically requested no odbc, don't build it.
792 AC_CONFIG_FILES([odbc-store/Makefile])
794 # determine whether we should enable the odbc ccache
795 AC_ARG_ENABLE([odbc],
796 AC_HELP_STRING([--disable-odbc], [disable the ODBC Storage Service]),
797 [odbc_enabled=$enableval], [odbc_enabled=default])
799 if test "x$odbc_enabled" = "x" ; then
803 # Are we trying to build ODBC?
804 AC_MSG_CHECKING(whether to build the ODBC storage service)
805 if test "$odbc_enabled" = "yes" ; then
808 elif test "$odbc_enabled" = "default" ; then
810 AC_MSG_RESULT([yes, if it can be found])
816 # If we're trying to build ODBC, try to find the odbc_config program.
817 if test "$build_odbc" = "yes" ; then
820 AC_HELP_STRING([--with-odbc=PATH], [directory where odbc is installed]),
821 [if test "$with_odbc" = no ; then
822 AC_MSG_ERROR([Try running --disable-odbc instead.])
823 elif test "$with_odbc" != yes ; then
824 odbc_dir="$with_odbc/bin"
825 if test "$with_odbc" != /usr ; then
826 ODBC_CFLAGS="-I$with_odbc/include"
827 ODBC_LIBS="-L$with_odbc/lib"
831 AC_PATH_PROG(ODBC_CONFIG, odbc_config, no, $odbc_dir $PATH )
832 if test "$ODBC_CONFIG" = no ; then
833 AC_MSG_WARN([Cannot find odbc_config, will try to guess settings.])
834 ODBC_LIBS="$ODBC_LIBS -lodbc"
836 ODBC_CFLAGS=`$ODBC_CONFIG --cflags`
837 ODBC_LIBS=`$ODBC_CONFIG --libs`
840 save_CPPFLAGS="$CPPFLAGS"
841 CPPFLAGS="$CPPFLAGS $ODBC_CFLAGS"
843 AC_CHECK_HEADER([sql.h], [have_sql_h=yes], [have_sql_h=no])
844 if test "$have_sql_h" = no -a "$odbc_enabled" = "yes" ; then
845 AC_MSG_ERROR(unable to find ODBC header files)
848 if test "$have_sql_h" = yes ; then
850 LIBS="$LIBS $ODBC_LIBS"
851 AC_MSG_CHECKING(if we can link againt ODBC)
856 [SQLSetEnvAttr(SQL_NULL_HANDLE, SQL_ATTR_CONNECTION_POOLING, (void*)SQL_CP_ONE_PER_HENV, 0)],
857 [have_odbc_libs=yes],
861 if test "$have_odbc_libs" = no ; then
862 if test "$odbc_enabled" = "yes" ; then
863 AC_MSG_ERROR([unable to link with ODBC Library])
865 AC_MSG_RESULT(no, skipping ODBC)
870 CPPFLAGS="$save_CPPFLAGS"
873 # if have_odbc_libs=yes then go ahead with building ODBC
874 if test "$have_odbc_libs" = yes ; then
875 # this AC_MSG_RESULT is from above!
877 WANT_SUBDIRS="$WANT_SUBDIRS odbc-store"
878 AC_SUBST(ODBC_CFLAGS)
883 AC_SUBST(WANT_SUBDIRS)
885 if test -n "$APXS_CC" && test "$APXS_CC" != "$CC" ; then
886 echo "=================================================================="
887 echo "WARNING: You have chosen to compile Apache-1.3 modules with a different"
888 echo " compiler than the one used to compile Apache."
890 echo " Current compiler: $CC"
891 echo " Apache's compiler: $APXS_CC"
893 echo "This could cause problems."
894 echo "=================================================================="
897 if test -n "$APXS2_CC" && test "$APXS2_CC" != "$CC" ; then
898 echo "=================================================================="
899 echo "WARNING: You have chosen to compile Apache-2.0 modules with a different"
900 echo " compiler than the one used to compile Apache."
902 echo " Current compiler: $CC"
903 echo " Apache's compiler: $APXS2_CC"
905 echo "This could cause problems."
906 echo "=================================================================="
909 if test -n "$APXS22_CC" && test "$APXS22_CC" != "$CC" ; then
910 echo "=================================================================="
911 echo "WARNING: You have chosen to compile Apache-2.2 modules with a different"
912 echo " compiler than the one used to compile Apache."
914 echo " Current compiler: $CC"
915 echo " Apache's compiler: $APXS22_CC"
917 echo "This could cause problems."
918 echo "=================================================================="
921 LIBTOOL="$LIBTOOL --silent"