2 AC_INIT([shibboleth], [2.0], [shibboleth-users@internet2.edu], [shibboleth])
3 AM_CONFIG_HEADER(config.h)
4 AM_INIT_AUTOMAKE([shibboleth],[2.0])
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"
64 # Checks for typedefs, structures, and compiler characteristics.
69 # Checks for library functions.
72 AC_CHECK_FUNCS([strchr strdup strstr timegm gmtime_r ctime_r strtok_r strcasecmp])
75 ACX_PTHREAD([enable_threads="pthread"],[enable_threads="no"])
76 if test $enable_threads != "pthread"; then
77 AC_MSG_ERROR([unable to find pthreads, currently this is required])
79 AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.])
80 LIBS="$PTHREAD_LIBS $LIBS"
81 CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
82 CXXFLAGS="$PTHREAD_CFLAGS $CXXFLAGS"
87 AC_HELP_STRING([--with-openssl=PATH], [where openssl is installed]),
88 [if test x_$with_openssl != x_/usr; then
89 SSLFLAGS="-I${with_openssl}/include"
92 if test "x$SSLFLAGS" = "x" ; then
93 AC_PATH_PROG(PKG_CONFIG, pkg-config)
94 if test "x$PKG_CONFIG" != x && test "x$PKG_CONFIG" != "xno" ; then
95 if pkg-config openssl ; then
96 SSLFLAGS="`$PKG_CONFIG --cflags openssl`"
98 AC_MSG_ERROR([OpenSSL not supported by pkg-config, try --with-openssl instead])
103 AC_MSG_CHECKING(for OpenSSL cflags)
104 AC_MSG_RESULT($SSLFLAGS)
105 CPPFLAGS="$SSLFLAGS $CPPFLAGS"
107 AC_CHECK_HEADER([openssl/x509.h],,
108 AC_MSG_ERROR([unable to find openssl header files]))
116 # log4shib settings (favor this version over the log4cpp code)
117 AC_PATH_PROG(LOG4SHIB_CONFIG,log4shib-config)
118 AC_ARG_WITH(log4shib,
119 AC_HELP_STRING([--with-log4shib=PATH], [where log4shib-config is installed]),
121 LOG4SHIB_CONFIG="${with_log4shib}"
122 if ! test -f "${LOG4SHIB_CONFIG}" ; then
123 LOG4SHIB_CONFIG="${with_log4shib}/bin/log4shib-config"
126 if test -f "${LOG4SHIB_CONFIG}"; then
127 LDFLAGS="`${LOG4SHIB_CONFIG} --libs` $LDFLAGS"
128 CPPFLAGS="`${LOG4SHIB_CONFIG} --cflags` $CPPFLAGS"
129 AC_CHECK_HEADER([log4shib/CategoryStream.hh],,AC_MSG_ERROR([unable to find log4shib header files]))
131 [#include <log4shib/Category.hh>
132 #include <log4shib/CategoryStream.hh>],
133 [log4shib::Category::getInstance("foo").errorStream() << log4shib::eol],
134 [AC_DEFINE(SHIBSP_LOG4SHIB,1,[Define if log4shib library is used.])],
135 [AC_MSG_ERROR([unable to link with log4shib])])
137 AC_MSG_WARN([log4shib-config not found, may need to use --with-log4shib option])
138 AC_MSG_WARN([will look for original log4cpp library])
141 AC_PATH_PROG(LOG4CPP_CONFIG,log4cpp-config)
143 AC_HELP_STRING([--with-log4cpp=PATH], [where log4cpp-config is installed]),
145 LOG4CPP_CONFIG="${with_log4cpp}"
146 if ! test -f "${LOG4CPP_CONFIG}" ; then
147 LOG4CPP_CONFIG="${with_log4cpp}/bin/log4cpp-config"
150 if test -f "${LOG4CPP_CONFIG}"; then
151 AC_MSG_WARN([will try to use log4cpp, note that most non-Internet2 supplied versions are not thread-safe])
152 LDFLAGS="`${LOG4CPP_CONFIG} --libs` $LDFLAGS"
153 CPPFLAGS="`${LOG4CPP_CONFIG} --cflags` $CPPFLAGS"
154 AC_CHECK_HEADER([log4cpp/CategoryStream.hh],,AC_MSG_ERROR([unable to find log4cpp header files]))
156 [#include <log4cpp/Category.hh>
157 #include <log4cpp/CategoryStream.hh>],
158 [log4cpp::Category::getInstance("foo").errorStream() << log4cpp::eol],
159 [AC_DEFINE(SHIBSP_LOG4CPP,1,[Define if log4cpp library is used.])],
160 [AC_MSG_ERROR([unable to link with log4cpp, need version 1.0 or later])])
162 AC_MSG_ERROR([log4cpp-config not found, may need to use --with-log4cpp option])
168 AC_HELP_STRING([--with-xerces=PATH], [where xerces-c is installed]),
169 [if test x_$with_xerces != x_/usr; then
170 LDFLAGS="-L${with_xerces}/lib $LDFLAGS"
171 CPPFLAGS="-I${with_xerces}/include $CPPFLAGS"
173 LIBS="-lxerces-c $LIBS"
174 AC_CHECK_HEADER([xercesc/dom/DOM.hpp],,
175 AC_MSG_ERROR([unable to find xerces header files]))
176 AC_MSG_CHECKING([Xerces version])
178 [AC_LANG_PROGRAM([#include <xercesc/util/XercesVersion.hpp>],
179 [#if _XERCES_VERSION != 20600
182 #error cannot use version 2.6.0
185 [AC_MSG_FAILURE([Xerces-C v2.6.0 has bugs that inhibit use with signed XML, please use a newer version])])
187 [#include <xercesc/util/PlatformUtils.hpp>],
188 [xercesc::XMLPlatformUtils::Initialize()],
189 [AC_DEFINE(HAVE_LIBXERCESC,1,[Define if Xerces-C library was found])],
190 [AC_MSG_ERROR([unable to link with Xerces])])
193 #XML-Tooling settings
194 AC_ARG_WITH(xmltooling,
195 AC_HELP_STRING([--with-xmltooling=PATH], [where xmltooling-c is installed]),
196 [if test x_$with_xmltooling != x_/usr; then
197 LDFLAGS="-L${with_xmltooling}/lib $LDFLAGS"
198 CPPFLAGS="-I${with_xmltooling}/include $CPPFLAGS"
200 LITE_LIBS="-lxmltooling-lite"
201 XMLSEC_LIBS="-lxmltooling"
202 AC_CHECK_HEADER([xmltooling/base.h],,
203 AC_MSG_ERROR([unable to find xmltooling header files]))
205 # Establish location of xmltooling catalog.
207 if test "x$with_xmltooling" = "x" ; then
208 with_xmltooling="/usr"
210 if test -f $with_xmltooling/share/xml/xmltooling/catalog.xml ; then
211 XMLTOOLINGXMLDIR="$with_xmltooling"
212 elif test -f $with_xerces/share/xml/xmltooling/catalog.xml ; then
213 XMLTOOLINGXMLDIR="$with_xerces"
214 elif test -f $with_log4shib/share/xml/xmltooling/catalog.xml ; then
215 XMLTOOLINGXMLDIR="$with_log4shib"
217 if test "x$XMLTOOLINGXMLDIR" = "x" ; then
218 AC_MSG_ERROR([xmltooling XML catalog not found, may need to use --with-xmltooling option])
220 XMLTOOLINGXMLDIR="$XMLTOOLINGXMLDIR/share/xml/xmltooling"
221 AC_SUBST(XMLTOOLINGXMLDIR)
223 # XML-Security settings
225 AC_HELP_STRING([--with-xmlsec=PATH], [where xmlsec is installed]),,
228 if test x_$with_xmlsec != x_/usr; then
229 LDFLAGS="-L${with_xmlsec}/lib $LDFLAGS"
230 CPPFLAGS="-I${with_xmlsec}/include $CPPFLAGS"
232 XMLSEC_LIBS="-lxml-security-c $XMLSEC_LIBS"
234 # save and append master libs
236 LIBS="$XMLSEC_LIBS $LIBS"
238 AC_CHECK_HEADER([xsec/utils/XSECPlatformUtils.hpp],,AC_MSG_ERROR([unable to find XML-Security header files]))
239 AC_MSG_CHECKING([XML-Security version])
241 [AC_LANG_PROGRAM([#include <xsec/utils/XSECPlatformUtils.hpp>],
242 [#if XSEC_VERSION_MAJOR > 1 || (XSEC_VERSION_MAJOR == 1 && XSEC_VERSION_MEDIUM > 3)
245 #error need version 1.4.0 or later
248 [AC_MSG_FAILURE([XML-Security version 1.4.0 or greater is required.])])
250 [#include <xsec/utils/XSECPlatformUtils.hpp>],
251 [XSECPlatformUtils::Initialise()],,
252 [AC_MSG_ERROR([unable to link with XML-Security])])
254 # restore master libs
259 AC_HELP_STRING([--with-saml=PATH], [where saml is installed]),
260 [if test x_$with_saml != x_/usr; then
261 LDFLAGS="-L${with_saml}/lib $LDFLAGS"
262 CPPFLAGS="-I${with_saml}/include $CPPFLAGS"
264 XMLSEC_LIBS="-lsaml $XMLSEC_LIBS"
266 # save and append master libs
268 LIBS="$XMLSEC_LIBS $LIBS"
270 AC_CHECK_HEADER([saml/saml2/metadata/Metadata.h],,
271 AC_MSG_ERROR([unable to find OpenSAML header files]))
273 [#include <saml/SAMLConfig.h>
274 #include <saml/version.h>],
275 [#if _OPENSAML_VERSION >= 20000
276 opensaml::SAMLConfig::getConfig();
278 #error Need OpenSAML version 2.0 or higher
280 [AC_DEFINE(HAVE_SAML,1,[Define if saml library was found])],
281 [AC_MSG_ERROR([unable to link with OpenSAML, or version was too old])])
283 # restore master libs
286 # Establish location of opensaml catalogs.
288 if test "x$with_saml" = "x" ; then
291 if test -f $with_saml/share/xml/opensaml/saml20-catalog.xml ; then
292 OPENSAMLXMLDIR="$with_saml"
293 elif test -f $with_xmltooling/share/xml/opensaml/saml20-catalog.xml ; then
294 OPENSAMLXMLDIR="$with_xmltooling"
295 elif test -f $with_xerces/share/xml/opensaml/saml20-catalog.xml ; then
296 OPENSAMLXMLDIR="$with_xerces"
297 elif test -f $with_log4shib/share/xml/opensaml/saml20-catalog.xml ; then
298 OPENSAMLXMLDIR="$with_log4shib"
300 if test "x$OPENSAMLXMLDIR" = "x" ; then
301 AC_MSG_ERROR([opensaml XML catalogs not found, may need to use --with-saml option])
303 OPENSAMLXMLDIR="$OPENSAMLXMLDIR/share/xml/opensaml"
304 AC_SUBST(OPENSAMLXMLDIR)
307 AC_SUBST(XMLSEC_LIBS)
309 # output the underlying makefiles
310 WANT_SUBDIRS="doc schemas configs shibsp shibd util"
311 AC_CONFIG_FILES([Makefile doc/Makefile schemas/Makefile \
312 configs/Makefile shibsp/Makefile shibd/Makefile \
313 util/Makefile selinux/Makefile])
316 AC_CONFIG_FILES([adfs/Makefile])
317 AC_ARG_ENABLE([adfs],
318 AC_HELP_STRING([--disable-adfs], [don't build the ADFS module]),
319 [adfs_enabled=$enableval], [adfs_enabled=yes])
320 if test "x$adfs_enabled" = "x" ; then
323 AC_MSG_CHECKING(whether to build the ADFS module)
324 if test "$adfs_enabled" = "no" ; then
328 WANT_SUBDIRS="$WANT_SUBDIRS adfs"
333 # Build NSAPI module?
335 AC_MSG_CHECKING(for NSAPI module option)
337 AC_HELP_STRING([--with-nsapi=DIR], [Build NSAPI module for Netscape/iPlanet/SunONE]),
338 [WANT_NSAPI=$withval],[WANT_NSAPI=no])
339 AC_MSG_RESULT($WANT_NSAPI)
341 if test "$WANT_NSAPI" != "no"; then
342 if test ! -d $WANT_NSAPI/bin ; then
343 AC_MSG_ERROR(Please specify the path to the root of your Netscape/iPlanet/SunONE server using --with-nsapi=DIR)
345 AC_MSG_CHECKING(for NSAPI include files)
346 if test -d $WANT_NSAPI/include ; then
347 NSAPI_INCLUDE=$WANT_NSAPI/include
348 AC_MSG_RESULT(Netscape-Enterprise 3.x style)
349 AC_CHECK_HEADERS([$NSAPI_INCLUDE/nsapi.h])
350 NSAPI_INCLUDE="$NSAPI_INC_DIR -I$NSAPI_INCLUDE"
352 if test -d $WANT_NSAPI/plugins/include ; then
353 test -n "$NSAPI_INCLUDE" && NSAPI_INC_DIR="-I$NSAPI_INCLUDE"
354 NSAPI_INCLUDE="$WANT_NSAPI/plugins/include"
355 AC_MSG_RESULT(iPlanet 4.x / SunONE 6.x style)
356 AC_CHECK_HEADERS([$NSAPI_INCLUDE/nsapi.h])
357 NSAPI_INCLUDE="$NSAPI_INC_DIR -I$NSAPI_INCLUDE"
359 if test "$NSAPI_INCLUDE" = ""; then
360 AC_MSG_ERROR(Please check you have nsapi.h in either $WANT_NSAPI/include or $WANT_NSAPI/plugins/include)
364 AC_SUBST(NSAPI_INCLUDE)
366 # always output the Makefile, even if you don't use it
367 AC_CONFIG_FILES([nsapi_shib/Makefile])
368 AM_CONDITIONAL(BUILD_NSAPI,test ! "$WANT_NSAPI" = "no")
370 # add the NSAPI module to the list of wanted subdirs..
371 if test ! "$WANT_NSAPI" = "no" ; then
372 WANT_SUBDIRS="$WANT_SUBDIRS nsapi_shib"
377 # Build FastCGI support?
379 AC_MSG_CHECKING(for FastCGI support)
381 AC_HELP_STRING([--with-fastcgi=DIR], [Build FastCGI support]),
382 [WANT_FASTCGI=$withval],[WANT_FASTCGI=no])
383 AC_MSG_RESULT($WANT_FASTCGI)
385 if test "$WANT_FASTCGI" != "no"; then
386 if test "$WANT_FASTCGI" != "yes"; then
387 if test x_$WANT_FASTCGI != x_/usr; then
388 FASTCGI_INCLUDE="-I$WANT_FASTCGI/include"
389 FASTCGI_LDFLAGS="-L$WANT_FASTCGI/lib"
392 AC_CHECK_HEADER([fcgio.h],,
393 AC_MSG_ERROR([unable to find FastCGI header files]))
394 FASTCGI_LIBS="-lfcgi -lfcgi++"
397 AC_SUBST(FASTCGI_INCLUDE)
398 AC_SUBST(FASTCGI_LDFLAGS)
399 AC_SUBST(FASTCGI_LIBS)
401 # always output the Makefile, even if you don't use it
402 AC_CONFIG_FILES([fastcgi/Makefile])
403 AM_CONDITIONAL(BUILD_FASTCGI,test ! "$WANT_FASTCGI" = "no")
405 if test ! "$WANT_FASTCGI" = "no" ; then
406 WANT_SUBDIRS="$WANT_SUBDIRS fastcgi"
411 # If no --enable-apache-xx specified
412 # find a default and fake the specific parameters
415 # simple macro to peek at an enable or a with
417 if test "[${[$1]_][$2]+set}" = set; then
418 peekval="${[$1]_[$2]}"
423 AC_MSG_CHECKING(if default apache needed)
425 Peek(enable,apache_13,need_default=no)
426 Peek(enable,apache_20,need_default=no)
427 Peek(enable,apache_22,need_default=no)
428 AC_MSG_RESULT($need_default)
430 if test "$need_default" = "yes"; then
431 # find an apxs, then the httpd
433 Peek(with,apxs,xs="$peekval")
434 Peek(with,apxs2,xs="$peekval")
435 Peek(with,apxs22,xs="$peekval")
436 if test "x$xs" = "x"; then
437 AC_PATH_PROGS(xs, apxs2 apxs,
438 AC_MSG_ERROR(No apxs, no apache found. Try --with-apxs),
439 [/usr/local/apache2/bin:/usr/local/apache/bin:/usr/sbin:$PATH])
441 # ask the daemon for the version and set parameters
442 AC_MSG_CHECKING(default apache version)
443 httpd="`$xs -q SBINDIR`/`$xs -q TARGET`"
444 if test "x$httpd" != "x" && test -f $httpd ; then
445 v=`$httpd -v|$SED -n -e 's/.*Apache\/\.*//p'`
447 1.3*) [enable_apache_13]=yes
451 2.0*) [enable_apache_20]=yes
455 2.2*) [enable_apache_22]=yes
459 *) AC_MSG_ERROR(unusable apache versions: $v. Try setting --with-apxs)
462 AC_MSG_RESULT(cannot determine version. Try setting --with-apxs)
466 # Apache 1.3 (mod_shib_13)
468 # --with-apxs (DSO build, the normal way, uses apxs to derive build flags)
470 AC_ARG_ENABLE(apache-13,
471 AC_HELP_STRING([--enable-apache-13], [enable the Apache 1.3 module]),
472 [ if test "x$enableval" = "x" ; then
475 WANT_APACHE_13="$enableval"
477 ],[ WANT_APACHE_13=no ])
478 AC_MSG_CHECKING(whether to build Apache 1.3 module)
479 if test "$WANT_APACHE_13" != yes && test "$WANT_APACHE_13" != no ; then
482 AC_MSG_RESULT($WANT_APACHE_13)
484 if test "$WANT_APACHE_13" = "yes" ; then
486 AC_HELP_STRING([--with-apxs=FILE], [Specifies where to find the Apache 1.3 apxs script.]),
488 AC_MSG_CHECKING(for user-specified apxs name/location)
489 if test "$withval" != "no" ; then
490 if test "$withval" != "yes"; then
492 AC_MSG_RESULT("$withval")
497 AC_PATH_PROG(APXS, apxs, no)
498 if test "$APXS" = "no" ; then
499 for i in /usr/sbin /usr/local/apache/bin ; do
500 if test "$APXS" = "no" && test -f "$i/apxs"; then
507 AC_MSG_CHECKING([to see if apxs was located])
508 if test ! -f "$APXS" ; then
510 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.])
515 # extract settings we need from APXS -q
516 APXS_CC="`$APXS -q CC`"
517 APXS_CFLAGS="`$APXS -q CFLAGS` `$APXS -q CFLAGS_SHLIB`"
518 APXS_INCLUDE="`$APXS -q INCLUDEDIR`"
521 AC_SUBST(APXS_CFLAGS)
522 AC_SUBST(APXS_INCLUDE)
525 # Apache 2.0 (mod_shib_20)
527 # --with-apxs2 (DSO build, the normal way, uses apxs to derive build flags)
528 # --with-apr (DSO build, APR development package installed separately)
530 AC_ARG_ENABLE(apache-20,
531 AC_HELP_STRING([--enable-apache-20], [enable the Apache 2.0 module]),
532 [ if test "x$enableval" = "x" ; then
535 WANT_APACHE_20="$enableval"
537 ],[ WANT_APACHE_20=no ])
538 AC_MSG_CHECKING(whether to build Apache 2.0 module)
539 if test "$WANT_APACHE_20" != yes && test "$WANT_APACHE_20" != no ; then
542 AC_MSG_RESULT($WANT_APACHE_20)
544 if test "$WANT_APACHE_20" = "yes" ; then
546 AC_HELP_STRING([--with-apxs2=FILE], [Specifies where to find the Apache 2.0 apxs script.]),
548 AC_MSG_CHECKING(for user-specified Apache2 apxs name/location)
549 if test "$withval" != "no" ; then
550 if test "$withval" != "yes"; then
552 AC_MSG_RESULT("$withval")
557 AC_PATH_PROG(APXS2, apxs2, no)
558 if test "$APXS2" = "no" ; then
559 AC_PATH_PROG(APXS2, apxs, no)
561 if test "$APXS2" = "no" ; then
562 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
563 if test "$APXS2" = "no" && test -f "$i/apxs2" ; then
567 if test "$APXS2" = "no" ; then
568 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
569 if test "$APXS2" = "no" && test -f "$i/apxs" ; then
577 AC_MSG_CHECKING([to see if Apache2 apxs was located])
578 if test ! -f "$APXS2" ; then
580 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.])
582 AC_MSG_RESULT($APXS2)
587 AC_HELP_STRING([--with-apr=PATH], [where apr-config is installed]),
589 AC_MSG_CHECKING(for user-specified apr-config name/location)
590 if test "$withval" != "no" ; then
591 if test "$withval" != "yes"; then
593 AC_MSG_RESULT("$withval")
598 AC_PATH_PROG(APR_CONFIG, apr-config,,[`$APXS2 -q SBINDIR`]:[$PATH])
600 if test -f "${APR_CONFIG}"; then
601 APR_CFLAGS="`${APR_CONFIG} --cflags` `${APR_CONFIG} --cppflags` `${APR_CONFIG} --includes`"
603 AC_MSG_ERROR([Unable to locate apr-config, may need --with-apr option.])
606 # extract settings we need from APXS2 -q
607 APXS2_CC="`$APXS2 -q CC`"
608 APXS2_CFLAGS="`$APXS2 -q CPPFLAGS` `$APXS2 -q CFLAGS` $APR_CFLAGS"
609 APXS2_INCLUDE="`$APXS2 -q INCLUDEDIR`"
612 AC_SUBST(APXS2_CFLAGS)
613 AC_SUBST(APXS2_INCLUDE)
616 # Apache 2.2 (mod_shib_22)
618 # --with-apxs22 (DSO build, the normal way, uses apxs to derive build flags)
619 # --with-apr1 (DSO build, APR development package installed separately)
621 AC_ARG_ENABLE(apache-22,
622 AC_HELP_STRING([--enable-apache-22], [enable the Apache 2.2 module]),
623 [ if test "x$enableval" = "x" ; then
626 WANT_APACHE_22="$enableval"
628 ],[ WANT_APACHE_22=no ])
629 AC_MSG_CHECKING(whether to build Apache 2.2 module)
630 if test "$WANT_APACHE_22" != yes && test "$WANT_APACHE_22" != no ; then
633 AC_MSG_RESULT($WANT_APACHE_22)
635 if test "$WANT_APACHE_22" = "yes" ; then
637 AC_HELP_STRING([--with-apxs22=FILE], [Specifies where to find the Apache 2.2 apxs script.]),
639 AC_MSG_CHECKING(for user-specified Apache2.2 apxs name/location)
640 if test "$withval" != "no" ; then
641 if test "$withval" != "yes"; then
643 AC_MSG_RESULT("$withval")
648 AC_PATH_PROG(APXS22, apxs2, no)
649 if test "$APXS22" = "no" ; then
650 AC_PATH_PROG(APXS22, apxs, no)
652 if test "$APXS22" = "no" ; then
653 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
654 if test "$APXS22" = "no" && test -f "$i/apxs2" ; then
658 if test "$APXS22" = "no" ; then
659 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
660 if test "$APXS22" = "no" && test -f "$i/apxs" ; then
668 AC_MSG_CHECKING([to see if Apache2.2 apxs was located])
669 if test ! -f "$APXS22" ; then
671 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.])
673 AC_MSG_RESULT($APXS22)
678 AC_HELP_STRING([--with-apr1=PATH], [where apr-1-config is installed]),
680 AC_MSG_CHECKING(for user-specified apr-1-config name/location)
681 if test "$withval" != "no" ; then
682 if test "$withval" != "yes"; then
684 AC_MSG_RESULT("$withval")
689 AC_PATH_PROG(APR1_CONFIG, apr-1-config,,[`$APXS22 -q SBINDIR`]:[$PATH])
691 if test -f "${APR1_CONFIG}"; then
692 APR1_CFLAGS="`${APR1_CONFIG} --cflags` `${APR1_CONFIG} --cppflags` `${APR1_CONFIG} --includes`"
694 AC_MSG_ERROR([Unable to locate apr-1-config, may need --with-apr1 option.])
697 # extract settings we need from APXS22 -q
698 APXS22_CC="`$APXS22 -q CC`"
699 APXS22_CFLAGS="`$APXS22 -q CPPFLAGS` `$APXS22 -q CFLAGS` $APR1_CFLAGS"
700 APXS22_INCLUDE="`$APXS22 -q INCLUDEDIR`"
703 AC_SUBST(APXS22_CFLAGS)
704 AC_SUBST(APXS22_INCLUDE)
706 # always output the Makefile, even if you don't use it
707 AC_CONFIG_FILES([apache/Makefile])
708 AM_CONDITIONAL(BUILD_AP13,test "$WANT_APACHE_13" = "yes")
709 AM_CONDITIONAL(BUILD_AP20,test "$WANT_APACHE_20" = "yes")
710 AM_CONDITIONAL(BUILD_AP22,test "$WANT_APACHE_22" = "yes")
712 # add the apache module to the list of wanted subdirs..
713 if test "$WANT_APACHE_13" = "yes" || test "$WANT_APACHE_20" = "yes" || test "$WANT_APACHE_22" = "yes" ; then
714 WANT_SUBDIRS="$WANT_SUBDIRS apache"
719 # Implement the checks of the ODBC Storage Service
721 # 1) Assume the user wants ODBC; if it's not found then just continue without
722 # 2) If the user specifically requested odbc, look for it and ERROR if not found
723 # 3) If the user specifically requested no odbc, don't build it.
726 AC_CONFIG_FILES([odbc-store/Makefile])
728 # determine whether we should enable the odbc ccache
729 AC_ARG_ENABLE([odbc],
730 AC_HELP_STRING([--disable-odbc], [disable the ODBC Storage Service]),
731 [odbc_enabled=$enableval], [odbc_enabled=default])
733 if test "x$odbc_enabled" = "x" ; then
737 # Are we trying to build ODBC?
738 AC_MSG_CHECKING(whether to build the ODBC storage service)
739 if test "$odbc_enabled" = "yes" ; then
742 elif test "$odbc_enabled" = "default" ; then
744 AC_MSG_RESULT([yes, if it can be found])
750 # If we're trying to build ODBC, try to find the odbc_config program.
751 if test "$build_odbc" = "yes" ; then
754 AC_HELP_STRING([--with-odbc=PATH], [directory where odbc is installed]),
755 [if test "$with_odbc" = no ; then
756 AC_MSG_ERROR([Try running --disable-odbc instead.])
757 elif test "$with_odbc" != yes ; then
758 odbc_dir="$with_odbc/bin"
759 if test "$with_odbc" != /usr ; then
760 ODBC_CFLAGS="-I$with_odbc/include"
761 ODBC_LIBS="-L$with_odbc/lib"
765 AC_PATH_PROG(ODBC_CONFIG, odbc_config, no, $odbc_dir $PATH )
766 if test "$ODBC_CONFIG" = no ; then
767 AC_MSG_WARN([Cannot find odbc_config, will try to guess settings.])
768 ODBC_LIBS="$ODBC_LIBS -lodbc"
770 ODBC_CFLAGS=`$ODBC_CONFIG --cflags`
771 ODBC_LIBS=`$ODBC_CONFIG --libs`
774 save_CPPFLAGS="$CPPFLAGS"
775 CPPFLAGS="$CPPFLAGS $ODBC_CFLAGS"
777 AC_CHECK_HEADER([sql.h], [have_sql_h=yes], [have_sql_h=no])
778 if test "$have_sql_h" = no -a "$odbc_enabled" = "yes" ; then
779 AC_MSG_ERROR(unable to find ODBC header files)
782 if test "$have_sql_h" = yes ; then
784 LIBS="$LIBS $ODBC_LIBS"
785 AC_MSG_CHECKING(if we can link againt ODBC)
790 [SQLSetEnvAttr(SQL_NULL_HANDLE, SQL_ATTR_CONNECTION_POOLING, (void*)SQL_CP_ONE_PER_HENV, 0)],
791 [have_odbc_libs=yes],
795 if test "$have_odbc_libs" = no ; then
796 if test "$odbc_enabled" = "yes" ; then
797 AC_MSG_ERROR([unable to link with ODBC Library])
799 AC_MSG_RESULT(no, skipping ODBC)
804 CPPFLAGS="$save_CPPFLAGS"
807 # if have_odbc_libs=yes then go ahead with building ODBC
808 if test "$have_odbc_libs" = yes ; then
809 # this AC_MSG_RESULT is from above!
811 WANT_SUBDIRS="$WANT_SUBDIRS odbc-store"
812 AC_SUBST(ODBC_CFLAGS)
817 AC_SUBST(WANT_SUBDIRS)
819 if test -n "$APXS_CC" && test "$APXS_CC" != "$CC" ; then
820 echo "=================================================================="
821 echo "WARNING: You have chosen to compile Apache-1.3 modules with a different"
822 echo " compiler than the one used to compile Apache."
824 echo " Current compiler: $CC"
825 echo " Apache's compiler: $APXS_CC"
827 echo "This could cause problems."
828 echo "=================================================================="
831 if test -n "$APXS2_CC" && test "$APXS2_CC" != "$CC" ; then
832 echo "=================================================================="
833 echo "WARNING: You have chosen to compile Apache-2.0 modules with a different"
834 echo " compiler than the one used to compile Apache."
836 echo " Current compiler: $CC"
837 echo " Apache's compiler: $APXS2_CC"
839 echo "This could cause problems."
840 echo "=================================================================="
843 if test -n "$APXS22_CC" && test "$APXS22_CC" != "$CC" ; then
844 echo "=================================================================="
845 echo "WARNING: You have chosen to compile Apache-2.2 modules with a different"
846 echo " compiler than the one used to compile Apache."
848 echo " Current compiler: $CC"
849 echo " Apache's compiler: $APXS22_CC"
851 echo "This could cause problems."
852 echo "=================================================================="
855 LIBTOOL="$LIBTOOL --silent"