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 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"
85 # Thank you Solaris, really.
86 AC_MSG_CHECKING(for ctime_r)
87 if test -z "$ac_cv_ctime_args"; then
94 ], ac_cv_ctime_args=2)
101 ctime_r(&clock, buf, 26);
102 ], ac_cv_ctime_args=3)
104 if test -z "$ac_cv_ctime_args"; then
107 if test "$ac_cv_ctime_args" = 2; then
108 AC_DEFINE(HAVE_CTIME_R_2,1,[Define if ctime_r is present with 2 parameters.])
109 elif test "$ac_cv_ctime_args" = 3; then
110 AC_DEFINE(HAVE_CTIME_R_3,1,[Define if ctime_r is present with 3 parameters.])
112 AC_MSG_RESULT([yes, and it takes $ac_cv_ctime_args arguments])
117 AC_HELP_STRING([--with-openssl=PATH], [where openssl is installed]),
118 [if test x_$with_openssl != x_/usr; then
119 SSLFLAGS="-I${with_openssl}/include"
122 if test "x$SSLFLAGS" = "x" ; then
123 AC_PATH_PROG(PKG_CONFIG, pkg-config)
124 if test "x$PKG_CONFIG" != x && test "x$PKG_CONFIG" != "xno" ; then
125 if pkg-config openssl ; then
126 SSLFLAGS="`$PKG_CONFIG --cflags openssl`"
128 AC_MSG_ERROR([OpenSSL not supported by pkg-config, try --with-openssl instead])
133 AC_MSG_CHECKING(for OpenSSL cflags)
134 AC_MSG_RESULT($SSLFLAGS)
135 CPPFLAGS="$SSLFLAGS $CPPFLAGS"
137 AC_CHECK_HEADER([openssl/x509.h],,
138 AC_MSG_ERROR([unable to find openssl header files]))
146 # log4shib settings (favor this version over the log4cpp code)
147 AC_PATH_PROG(LOG4SHIB_CONFIG,log4shib-config)
148 AC_ARG_WITH(log4shib,
149 AC_HELP_STRING([--with-log4shib=PATH], [where log4shib-config is installed]),
151 LOG4SHIB_CONFIG="${with_log4shib}"
152 if ! test -f "${LOG4SHIB_CONFIG}" ; then
153 LOG4SHIB_CONFIG="${with_log4shib}/bin/log4shib-config"
156 if test -f "${LOG4SHIB_CONFIG}"; then
157 LDFLAGS="`${LOG4SHIB_CONFIG} --libs` $LDFLAGS"
158 CPPFLAGS="`${LOG4SHIB_CONFIG} --cflags` $CPPFLAGS"
159 AC_CHECK_HEADER([log4shib/CategoryStream.hh],,AC_MSG_ERROR([unable to find log4shib header files]))
161 [#include <log4shib/Category.hh>
162 #include <log4shib/CategoryStream.hh>],
163 [log4shib::Category::getInstance("foo").errorStream() << log4shib::eol],
164 [AC_DEFINE(SHIBSP_LOG4SHIB,1,[Define if log4shib library is used.])],
165 [AC_MSG_ERROR([unable to link with log4shib])])
167 AC_MSG_WARN([log4shib-config not found, may need to use --with-log4shib option])
168 AC_MSG_WARN([will look for original log4cpp library])
171 AC_PATH_PROG(LOG4CPP_CONFIG,log4cpp-config)
173 AC_HELP_STRING([--with-log4cpp=PATH], [where log4cpp-config is installed]),
175 LOG4CPP_CONFIG="${with_log4cpp}"
176 if ! test -f "${LOG4CPP_CONFIG}" ; then
177 LOG4CPP_CONFIG="${with_log4cpp}/bin/log4cpp-config"
180 if test -f "${LOG4CPP_CONFIG}"; then
181 AC_MSG_WARN([will try to use log4cpp, note that most non-Internet2 supplied versions are not thread-safe])
182 LDFLAGS="`${LOG4CPP_CONFIG} --libs` $LDFLAGS"
183 CPPFLAGS="`${LOG4CPP_CONFIG} --cflags` $CPPFLAGS"
184 AC_CHECK_HEADER([log4cpp/CategoryStream.hh],,AC_MSG_ERROR([unable to find log4cpp header files]))
186 [#include <log4cpp/Category.hh>
187 #include <log4cpp/CategoryStream.hh>],
188 [log4cpp::Category::getInstance("foo").errorStream() << log4cpp::eol],
189 [AC_DEFINE(SHIBSP_LOG4CPP,1,[Define if log4cpp library is used.])],
190 [AC_MSG_ERROR([unable to link with log4cpp, need version 1.0 or later])])
192 AC_MSG_ERROR([log4cpp-config not found, may need to use --with-log4cpp option])
198 AC_HELP_STRING([--with-xerces=PATH], [where xerces-c is installed]),
199 [if test x_$with_xerces != x_/usr; then
200 LDFLAGS="-L${with_xerces}/lib $LDFLAGS"
201 CPPFLAGS="-I${with_xerces}/include $CPPFLAGS"
203 LIBS="-lxerces-c $LIBS"
204 AC_CHECK_HEADER([xercesc/dom/DOM.hpp],,
205 AC_MSG_ERROR([unable to find xerces header files]))
206 AC_MSG_CHECKING([Xerces version])
208 [AC_LANG_PROGRAM([#include <xercesc/util/XercesVersion.hpp>],
209 [#if _XERCES_VERSION != 20600
212 #error cannot use version 2.6.0
215 [AC_MSG_FAILURE([Xerces-C v2.6.0 has bugs that inhibit use with signed XML, please use a newer version])])
217 [#include <xercesc/util/PlatformUtils.hpp>],
218 [xercesc::XMLPlatformUtils::Initialize()],
219 [AC_DEFINE(HAVE_LIBXERCESC,1,[Define if Xerces-C library was found])],
220 [AC_MSG_ERROR([unable to link with Xerces])])
223 #XML-Tooling settings
224 AC_ARG_WITH(xmltooling,
225 AC_HELP_STRING([--with-xmltooling=PATH], [where xmltooling-c is installed]),
226 [if test x_$with_xmltooling != x_/usr; then
227 LDFLAGS="-L${with_xmltooling}/lib $LDFLAGS"
228 CPPFLAGS="-I${with_xmltooling}/include $CPPFLAGS"
230 LITE_LIBS="-lxmltooling-lite"
231 XMLSEC_LIBS="-lxmltooling"
232 AC_CHECK_HEADER([xmltooling/base.h],,
233 AC_MSG_ERROR([unable to find xmltooling header files]))
235 # Establish location of xmltooling catalog.
237 if test "x$with_xmltooling" = "x" ; then
238 with_xmltooling="/usr"
240 if test -f $with_xmltooling/share/xml/xmltooling/catalog.xml ; then
241 XMLTOOLINGXMLDIR="$with_xmltooling"
242 elif test -f $with_xerces/share/xml/xmltooling/catalog.xml ; then
243 XMLTOOLINGXMLDIR="$with_xerces"
244 elif test -f $with_log4shib/share/xml/xmltooling/catalog.xml ; then
245 XMLTOOLINGXMLDIR="$with_log4shib"
247 if test "x$XMLTOOLINGXMLDIR" = "x" ; then
248 AC_MSG_ERROR([xmltooling XML catalog not found, may need to use --with-xmltooling option])
250 XMLTOOLINGXMLDIR="$XMLTOOLINGXMLDIR/share/xml/xmltooling"
251 AC_SUBST(XMLTOOLINGXMLDIR)
253 # XML-Security settings
255 AC_HELP_STRING([--with-xmlsec=PATH], [where xmlsec is installed]),,
258 if test x_$with_xmlsec != x_/usr; then
259 LDFLAGS="-L${with_xmlsec}/lib $LDFLAGS"
260 CPPFLAGS="-I${with_xmlsec}/include $CPPFLAGS"
262 XMLSEC_LIBS="-lxml-security-c $XMLSEC_LIBS"
264 # save and append master libs
266 LIBS="$XMLSEC_LIBS $LIBS"
268 AC_CHECK_HEADER([xsec/utils/XSECPlatformUtils.hpp],,AC_MSG_ERROR([unable to find XML-Security header files]))
269 AC_MSG_CHECKING([XML-Security version])
271 [AC_LANG_PROGRAM([#include <xsec/utils/XSECPlatformUtils.hpp>],
272 [#if XSEC_VERSION_MAJOR > 1 || (XSEC_VERSION_MAJOR == 1 && XSEC_VERSION_MEDIUM > 3)
275 #error need version 1.4.0 or later
278 [AC_MSG_FAILURE([XML-Security version 1.4.0 or greater is required.])])
280 [#include <xsec/utils/XSECPlatformUtils.hpp>],
281 [XSECPlatformUtils::Initialise()],,
282 [AC_MSG_ERROR([unable to link with XML-Security])])
284 # restore master libs
289 AC_HELP_STRING([--with-saml=PATH], [where saml is installed]),
290 [if test x_$with_saml != x_/usr; then
291 LDFLAGS="-L${with_saml}/lib $LDFLAGS"
292 CPPFLAGS="-I${with_saml}/include $CPPFLAGS"
294 XMLSEC_LIBS="-lsaml $XMLSEC_LIBS"
296 # save and append master libs
298 LIBS="$XMLSEC_LIBS $LIBS"
300 AC_CHECK_HEADER([saml/saml2/metadata/Metadata.h],,
301 AC_MSG_ERROR([unable to find OpenSAML header files]))
303 [#include <saml/SAMLConfig.h>
304 #include <saml/version.h>],
305 [#if _OPENSAML_VERSION >= 20000
306 opensaml::SAMLConfig::getConfig();
308 #error Need OpenSAML version 2.0 or higher
310 [AC_DEFINE(HAVE_SAML,1,[Define if saml library was found])],
311 [AC_MSG_ERROR([unable to link with OpenSAML, or version was too old])])
313 # restore master libs
316 # Establish location of opensaml catalogs.
318 if test "x$with_saml" = "x" ; then
321 if test -f $with_saml/share/xml/opensaml/saml20-catalog.xml ; then
322 OPENSAMLXMLDIR="$with_saml"
323 elif test -f $with_xmltooling/share/xml/opensaml/saml20-catalog.xml ; then
324 OPENSAMLXMLDIR="$with_xmltooling"
325 elif test -f $with_xerces/share/xml/opensaml/saml20-catalog.xml ; then
326 OPENSAMLXMLDIR="$with_xerces"
327 elif test -f $with_log4shib/share/xml/opensaml/saml20-catalog.xml ; then
328 OPENSAMLXMLDIR="$with_log4shib"
330 if test "x$OPENSAMLXMLDIR" = "x" ; then
331 AC_MSG_ERROR([opensaml XML catalogs not found, may need to use --with-saml option])
333 OPENSAMLXMLDIR="$OPENSAMLXMLDIR/share/xml/opensaml"
334 AC_SUBST(OPENSAMLXMLDIR)
337 AC_SUBST(XMLSEC_LIBS)
339 # output the underlying makefiles
340 WANT_SUBDIRS="doc schemas configs shibsp shibd util"
341 AC_CONFIG_FILES([Makefile doc/Makefile schemas/Makefile \
342 configs/Makefile shibsp/Makefile shibd/Makefile \
343 util/Makefile selinux/Makefile])
346 AC_CONFIG_FILES([adfs/Makefile])
347 AC_ARG_ENABLE([adfs],
348 AC_HELP_STRING([--disable-adfs], [don't build the ADFS module]),
349 [adfs_enabled=$enableval], [adfs_enabled=yes])
350 if test "x$adfs_enabled" = "x" ; then
353 AC_MSG_CHECKING(whether to build the ADFS module)
354 if test "$adfs_enabled" = "no" ; then
358 WANT_SUBDIRS="$WANT_SUBDIRS adfs"
363 # Build NSAPI module?
365 AC_MSG_CHECKING(for NSAPI module option)
367 AC_HELP_STRING([--with-nsapi=DIR], [Build NSAPI module for Netscape/iPlanet/SunONE]),
368 [WANT_NSAPI=$withval],[WANT_NSAPI=no])
369 AC_MSG_RESULT($WANT_NSAPI)
371 if test "$WANT_NSAPI" != "no"; then
372 if test ! -d $WANT_NSAPI/bin ; then
373 AC_MSG_ERROR(Please specify the path to the root of your Netscape/iPlanet/SunONE server using --with-nsapi=DIR)
375 AC_MSG_CHECKING(for NSAPI include files)
376 if test -d $WANT_NSAPI/include ; then
377 NSAPI_INCLUDE=$WANT_NSAPI/include
378 AC_MSG_RESULT(Netscape-Enterprise 3.x style)
379 AC_CHECK_HEADERS([$NSAPI_INCLUDE/nsapi.h],,,[#define XP_UNIX])
380 NSAPI_INCLUDE="$NSAPI_INC_DIR -I$NSAPI_INCLUDE"
382 if test -d $WANT_NSAPI/plugins/include ; then
383 test -n "$NSAPI_INCLUDE" && NSAPI_INC_DIR="-I$NSAPI_INCLUDE"
384 NSAPI_INCLUDE="$WANT_NSAPI/plugins/include"
385 AC_MSG_RESULT(iPlanet 4.x / SunONE 6.x style)
386 AC_CHECK_HEADERS([$NSAPI_INCLUDE/nsapi.h],,,[#define XP_UNIX])
387 NSAPI_INCLUDE="$NSAPI_INC_DIR -I$NSAPI_INCLUDE"
389 if test "$NSAPI_INCLUDE" = ""; then
390 AC_MSG_ERROR(Please check you have nsapi.h in either $WANT_NSAPI/include or $WANT_NSAPI/plugins/include)
394 AC_SUBST(NSAPI_INCLUDE)
396 # always output the Makefile, even if you don't use it
397 AC_CONFIG_FILES([nsapi_shib/Makefile])
398 AM_CONDITIONAL(BUILD_NSAPI,test ! "$WANT_NSAPI" = "no")
400 # add the NSAPI module to the list of wanted subdirs..
401 if test ! "$WANT_NSAPI" = "no" ; then
402 WANT_SUBDIRS="$WANT_SUBDIRS nsapi_shib"
407 # Build FastCGI support?
409 AC_MSG_CHECKING(for FastCGI support)
411 AC_HELP_STRING([--with-fastcgi=DIR], [Build FastCGI support]),
412 [WANT_FASTCGI=$withval],[WANT_FASTCGI=no])
413 AC_MSG_RESULT($WANT_FASTCGI)
415 if test "$WANT_FASTCGI" != "no"; then
416 if test "$WANT_FASTCGI" != "yes"; then
417 if test x_$WANT_FASTCGI != x_/usr; then
418 FASTCGI_INCLUDE="-I$WANT_FASTCGI/include"
419 FASTCGI_LDFLAGS="-L$WANT_FASTCGI/lib"
422 AC_CHECK_HEADER([fcgio.h],,
423 AC_MSG_ERROR([unable to find FastCGI header files]))
424 FASTCGI_LIBS="-lfcgi -lfcgi++"
427 AC_SUBST(FASTCGI_INCLUDE)
428 AC_SUBST(FASTCGI_LDFLAGS)
429 AC_SUBST(FASTCGI_LIBS)
431 # always output the Makefile, even if you don't use it
432 AC_CONFIG_FILES([fastcgi/Makefile])
433 AM_CONDITIONAL(BUILD_FASTCGI,test ! "$WANT_FASTCGI" = "no")
435 if test ! "$WANT_FASTCGI" = "no" ; then
436 WANT_SUBDIRS="$WANT_SUBDIRS fastcgi"
440 # Build Memcached support?
442 AC_MSG_CHECKING(for Memcached support)
443 AC_ARG_WITH(memcached,
444 AC_HELP_STRING([--with-memcached=DIR], [Build Memcached support]),
445 [WANT_MEMCACHED=$withval],[WANT_MEMCACHED=no])
446 AC_MSG_RESULT($WANT_MEMCACHED)
448 if test "$WANT_MEMCACHED" != "no"; then
449 if test "$WANT_MEMCACHED" != "yes"; then
450 if test x_$WANT_MEMCACHED != x_/usr; then
451 MEMCACHED_INCLUDE="-I$WANT_MEMCACHED/include"
452 MEMCACHED_LDFLAGS="-L$WANT_MEMCACHED/lib"
455 AC_CHECK_HEADER([libmemcached/memcached.h],,
456 AC_MSG_ERROR([unable to find Memcached header files]))
457 MEMCACHED_LIBS="-lmemcached"
460 AC_SUBST(MEMCACHED_INCLUDE)
461 AC_SUBST(MEMCACHED_LDFLAGS)
462 AC_SUBST(MEMCACHED_LIBS)
464 # always output the Makefile, even if you don't use it
465 AC_CONFIG_FILES([memcache-store/Makefile])
466 AM_CONDITIONAL(BUILD_MEMCACHED,test ! "$WANT_MEMCACHED" = "no")
468 if test ! "$WANT_MEMCACHED" = "no" ; then
469 WANT_SUBDIRS="$WANT_SUBDIRS memcache-store"
474 # If no --enable-apache-xx specified
475 # find a default and fake the specific parameters
478 # simple macro to peek at an enable or a with
480 if test "[${[$1]_][$2]+set}" = set; then
481 peekval="${[$1]_[$2]}"
486 AC_MSG_CHECKING(if default apache needed)
488 Peek(enable,apache_13,need_default=no)
489 Peek(enable,apache_20,need_default=no)
490 Peek(enable,apache_22,need_default=no)
491 AC_MSG_RESULT($need_default)
493 if test "$need_default" = "yes"; then
494 # find an apxs, then the httpd
496 Peek(with,apxs,xs="$peekval")
497 Peek(with,apxs2,xs="$peekval")
498 Peek(with,apxs22,xs="$peekval")
499 if test "x$xs" = "x"; then
500 AC_PATH_PROGS(xs, apxs2 apxs,
501 AC_MSG_ERROR(No apxs, no apache found. Try --with-apxs),
502 [/usr/local/apache2/bin:/usr/local/apache/bin:/usr/sbin:$PATH])
504 # ask the daemon for the version and set parameters
505 AC_MSG_CHECKING(default apache version)
506 httpd="`$xs -q SBINDIR`/`$xs -q TARGET`"
507 if test "x$httpd" != "x" && test -f $httpd ; then
508 v=`$httpd -v|$SED -n -e 's/.*Apache\/\.*//p'`
510 1.3*) [enable_apache_13]=yes
514 2.0*) [enable_apache_20]=yes
518 2.2*) [enable_apache_22]=yes
522 *) AC_MSG_ERROR(unusable apache versions: $v. Try setting --with-apxs)
525 AC_MSG_RESULT(cannot determine version. Try setting --with-apxs)
529 # Apache 1.3 (mod_shib_13)
531 # --with-apxs (DSO build, the normal way, uses apxs to derive build flags)
533 AC_ARG_ENABLE(apache-13,
534 AC_HELP_STRING([--enable-apache-13], [enable the Apache 1.3 module]),
535 [ if test "x$enableval" = "x" ; then
538 WANT_APACHE_13="$enableval"
540 ],[ WANT_APACHE_13=no ])
541 AC_MSG_CHECKING(whether to build Apache 1.3 module)
542 if test "$WANT_APACHE_13" != yes && test "$WANT_APACHE_13" != no ; then
545 AC_MSG_RESULT($WANT_APACHE_13)
547 if test "$WANT_APACHE_13" = "yes" ; then
549 AC_HELP_STRING([--with-apxs=FILE], [Specifies where to find the Apache 1.3 apxs script.]),
551 AC_MSG_CHECKING(for user-specified apxs name/location)
552 if test "$withval" != "no" ; then
553 if test "$withval" != "yes"; then
555 AC_MSG_RESULT("$withval")
560 AC_PATH_PROG(APXS, apxs, no)
561 if test "$APXS" = "no" ; then
562 for i in /usr/sbin /usr/local/apache/bin ; do
563 if test "$APXS" = "no" && test -f "$i/apxs"; then
570 AC_MSG_CHECKING([to see if apxs was located])
571 if test ! -f "$APXS" ; then
573 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.])
578 # extract settings we need from APXS -q
579 APXS_CC="`$APXS -q CC`"
580 APXS_CFLAGS="`$APXS -q CFLAGS` `$APXS -q CFLAGS_SHLIB`"
581 APXS_INCLUDE="`$APXS -q INCLUDEDIR`"
584 AC_SUBST(APXS_CFLAGS)
585 AC_SUBST(APXS_INCLUDE)
588 # Apache 2.0 (mod_shib_20)
590 # --with-apxs2 (DSO build, the normal way, uses apxs to derive build flags)
591 # --with-apr (DSO build, APR development package installed separately)
593 AC_ARG_ENABLE(apache-20,
594 AC_HELP_STRING([--enable-apache-20], [enable the Apache 2.0 module]),
595 [ if test "x$enableval" = "x" ; then
598 WANT_APACHE_20="$enableval"
600 ],[ WANT_APACHE_20=no ])
601 AC_MSG_CHECKING(whether to build Apache 2.0 module)
602 if test "$WANT_APACHE_20" != yes && test "$WANT_APACHE_20" != no ; then
605 AC_MSG_RESULT($WANT_APACHE_20)
607 if test "$WANT_APACHE_20" = "yes" ; then
609 AC_HELP_STRING([--with-apxs2=FILE], [Specifies where to find the Apache 2.0 apxs script.]),
611 AC_MSG_CHECKING(for user-specified Apache2 apxs name/location)
612 if test "$withval" != "no" ; then
613 if test "$withval" != "yes"; then
615 AC_MSG_RESULT("$withval")
620 AC_PATH_PROG(APXS2, apxs2, no)
621 if test "$APXS2" = "no" ; then
622 AC_PATH_PROG(APXS2, apxs, no)
624 if test "$APXS2" = "no" ; then
625 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
626 if test "$APXS2" = "no" && test -f "$i/apxs2" ; then
630 if test "$APXS2" = "no" ; then
631 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
632 if test "$APXS2" = "no" && test -f "$i/apxs" ; then
640 AC_MSG_CHECKING([to see if Apache2 apxs was located])
641 if test ! -f "$APXS2" ; then
643 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.])
645 AC_MSG_RESULT($APXS2)
650 AC_HELP_STRING([--with-apr=PATH], [where apr-config is installed]),
652 AC_MSG_CHECKING(for user-specified apr-config name/location)
653 if test "$withval" != "no" ; then
654 if test "$withval" != "yes"; then
656 AC_MSG_RESULT("$withval")
661 AC_PATH_PROG(APR_CONFIG, apr-config,,[`$APXS2 -q SBINDIR`]:[$PATH])
663 if test -f "${APR_CONFIG}"; then
664 APR_CFLAGS="`${APR_CONFIG} --cflags` `${APR_CONFIG} --cppflags` `${APR_CONFIG} --includes`"
666 AC_MSG_ERROR([Unable to locate apr-config, may need --with-apr option.])
669 # extract settings we need from APXS2 -q
670 APXS2_CC="`$APXS2 -q CC`"
671 APXS2_CFLAGS="`$APXS2 -q CPPFLAGS` `$APXS2 -q CFLAGS` $APR_CFLAGS"
672 APXS2_INCLUDE="`$APXS2 -q INCLUDEDIR`"
675 AC_SUBST(APXS2_CFLAGS)
676 AC_SUBST(APXS2_INCLUDE)
679 # Apache 2.2 (mod_shib_22)
681 # --with-apxs22 (DSO build, the normal way, uses apxs to derive build flags)
682 # --with-apr1 (DSO build, APR development package installed separately)
684 AC_ARG_ENABLE(apache-22,
685 AC_HELP_STRING([--enable-apache-22], [enable the Apache 2.2 module]),
686 [ if test "x$enableval" = "x" ; then
689 WANT_APACHE_22="$enableval"
691 ],[ WANT_APACHE_22=no ])
692 AC_MSG_CHECKING(whether to build Apache 2.2 module)
693 if test "$WANT_APACHE_22" != yes && test "$WANT_APACHE_22" != no ; then
696 AC_MSG_RESULT($WANT_APACHE_22)
698 if test "$WANT_APACHE_22" = "yes" ; then
700 AC_HELP_STRING([--with-apxs22=FILE], [Specifies where to find the Apache 2.2 apxs script.]),
702 AC_MSG_CHECKING(for user-specified Apache2.2 apxs name/location)
703 if test "$withval" != "no" ; then
704 if test "$withval" != "yes"; then
706 AC_MSG_RESULT("$withval")
711 AC_PATH_PROG(APXS22, apxs2, no)
712 if test "$APXS22" = "no" ; then
713 AC_PATH_PROG(APXS22, apxs, no)
715 if test "$APXS22" = "no" ; then
716 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
717 if test "$APXS22" = "no" && test -f "$i/apxs2" ; then
721 if test "$APXS22" = "no" ; then
722 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
723 if test "$APXS22" = "no" && test -f "$i/apxs" ; then
731 AC_MSG_CHECKING([to see if Apache2.2 apxs was located])
732 if test ! -f "$APXS22" ; then
734 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.])
736 AC_MSG_RESULT($APXS22)
741 AC_HELP_STRING([--with-apr1=PATH], [where apr-1-config is installed]),
743 AC_MSG_CHECKING(for user-specified apr-1-config name/location)
744 if test "$withval" != "no" ; then
745 if test "$withval" != "yes"; then
747 AC_MSG_RESULT("$withval")
752 AC_PATH_PROG(APR1_CONFIG, apr-1-config,,[`$APXS22 -q SBINDIR`]:[$PATH])
754 if test -f "${APR1_CONFIG}"; then
755 APR1_CFLAGS="`${APR1_CONFIG} --cflags` `${APR1_CONFIG} --cppflags` `${APR1_CONFIG} --includes`"
757 AC_MSG_ERROR([Unable to locate apr-1-config, may need --with-apr1 option.])
760 # extract settings we need from APXS22 -q
761 APXS22_CC="`$APXS22 -q CC`"
762 APXS22_CFLAGS="`$APXS22 -q CPPFLAGS` `$APXS22 -q CFLAGS` $APR1_CFLAGS"
763 APXS22_INCLUDE="`$APXS22 -q INCLUDEDIR`"
766 AC_SUBST(APXS22_CFLAGS)
767 AC_SUBST(APXS22_INCLUDE)
769 # always output the Makefile, even if you don't use it
770 AC_CONFIG_FILES([apache/Makefile])
771 AM_CONDITIONAL(BUILD_AP13,test "$WANT_APACHE_13" = "yes")
772 AM_CONDITIONAL(BUILD_AP20,test "$WANT_APACHE_20" = "yes")
773 AM_CONDITIONAL(BUILD_AP22,test "$WANT_APACHE_22" = "yes")
775 # add the apache module to the list of wanted subdirs..
776 if test "$WANT_APACHE_13" = "yes" || test "$WANT_APACHE_20" = "yes" || test "$WANT_APACHE_22" = "yes" ; then
777 WANT_SUBDIRS="$WANT_SUBDIRS apache"
782 # Implement the checks of the ODBC Storage Service
784 # 1) Assume the user wants ODBC; if it's not found then just continue without
785 # 2) If the user specifically requested odbc, look for it and ERROR if not found
786 # 3) If the user specifically requested no odbc, don't build it.
789 AC_CONFIG_FILES([odbc-store/Makefile])
791 # determine whether we should enable the odbc ccache
792 AC_ARG_ENABLE([odbc],
793 AC_HELP_STRING([--disable-odbc], [disable the ODBC Storage Service]),
794 [odbc_enabled=$enableval], [odbc_enabled=default])
796 if test "x$odbc_enabled" = "x" ; then
800 # Are we trying to build ODBC?
801 AC_MSG_CHECKING(whether to build the ODBC storage service)
802 if test "$odbc_enabled" = "yes" ; then
805 elif test "$odbc_enabled" = "default" ; then
807 AC_MSG_RESULT([yes, if it can be found])
813 # If we're trying to build ODBC, try to find the odbc_config program.
814 if test "$build_odbc" = "yes" ; then
817 AC_HELP_STRING([--with-odbc=PATH], [directory where odbc is installed]),
818 [if test "$with_odbc" = no ; then
819 AC_MSG_ERROR([Try running --disable-odbc instead.])
820 elif test "$with_odbc" != yes ; then
821 odbc_dir="$with_odbc/bin"
822 if test "$with_odbc" != /usr ; then
823 ODBC_CFLAGS="-I$with_odbc/include"
824 ODBC_LIBS="-L$with_odbc/lib"
828 AC_PATH_PROG(ODBC_CONFIG, odbc_config, no, $odbc_dir $PATH )
829 if test "$ODBC_CONFIG" = no ; then
830 AC_MSG_WARN([Cannot find odbc_config, will try to guess settings.])
831 ODBC_LIBS="$ODBC_LIBS -lodbc"
833 ODBC_CFLAGS=`$ODBC_CONFIG --cflags`
834 ODBC_LIBS=`$ODBC_CONFIG --libs`
837 save_CPPFLAGS="$CPPFLAGS"
838 CPPFLAGS="$CPPFLAGS $ODBC_CFLAGS"
840 AC_CHECK_HEADER([sql.h], [have_sql_h=yes], [have_sql_h=no])
841 if test "$have_sql_h" = no -a "$odbc_enabled" = "yes" ; then
842 AC_MSG_ERROR(unable to find ODBC header files)
845 if test "$have_sql_h" = yes ; then
847 LIBS="$LIBS $ODBC_LIBS"
848 AC_MSG_CHECKING(if we can link againt ODBC)
853 [SQLSetEnvAttr(SQL_NULL_HANDLE, SQL_ATTR_CONNECTION_POOLING, (void*)SQL_CP_ONE_PER_HENV, 0)],
854 [have_odbc_libs=yes],
858 if test "$have_odbc_libs" = no ; then
859 if test "$odbc_enabled" = "yes" ; then
860 AC_MSG_ERROR([unable to link with ODBC Library])
862 AC_MSG_RESULT(no, skipping ODBC)
867 CPPFLAGS="$save_CPPFLAGS"
870 # if have_odbc_libs=yes then go ahead with building ODBC
871 if test "$have_odbc_libs" = yes ; then
872 # this AC_MSG_RESULT is from above!
874 WANT_SUBDIRS="$WANT_SUBDIRS odbc-store"
875 AC_SUBST(ODBC_CFLAGS)
880 AC_SUBST(WANT_SUBDIRS)
882 if test -n "$APXS_CC" && test "$APXS_CC" != "$CC" ; then
883 echo "=================================================================="
884 echo "WARNING: You have chosen to compile Apache-1.3 modules with a different"
885 echo " compiler than the one used to compile Apache."
887 echo " Current compiler: $CC"
888 echo " Apache's compiler: $APXS_CC"
890 echo "This could cause problems."
891 echo "=================================================================="
894 if test -n "$APXS2_CC" && test "$APXS2_CC" != "$CC" ; then
895 echo "=================================================================="
896 echo "WARNING: You have chosen to compile Apache-2.0 modules with a different"
897 echo " compiler than the one used to compile Apache."
899 echo " Current compiler: $CC"
900 echo " Apache's compiler: $APXS2_CC"
902 echo "This could cause problems."
903 echo "=================================================================="
906 if test -n "$APXS22_CC" && test "$APXS22_CC" != "$CC" ; then
907 echo "=================================================================="
908 echo "WARNING: You have chosen to compile Apache-2.2 modules with a different"
909 echo " compiler than the one used to compile Apache."
911 echo " Current compiler: $CC"
912 echo " Apache's compiler: $APXS22_CC"
914 echo "This could cause problems."
915 echo "=================================================================="
918 LIBTOOL="$LIBTOOL --silent"