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"
441 # If no --enable-apache-xx specified
442 # find a default and fake the specific parameters
445 # simple macro to peek at an enable or a with
447 if test "[${[$1]_][$2]+set}" = set; then
448 peekval="${[$1]_[$2]}"
453 AC_MSG_CHECKING(if default apache needed)
455 Peek(enable,apache_13,need_default=no)
456 Peek(enable,apache_20,need_default=no)
457 Peek(enable,apache_22,need_default=no)
458 AC_MSG_RESULT($need_default)
460 if test "$need_default" = "yes"; then
461 # find an apxs, then the httpd
463 Peek(with,apxs,xs="$peekval")
464 Peek(with,apxs2,xs="$peekval")
465 Peek(with,apxs22,xs="$peekval")
466 if test "x$xs" = "x"; then
467 AC_PATH_PROGS(xs, apxs2 apxs,
468 AC_MSG_ERROR(No apxs, no apache found. Try --with-apxs),
469 [/usr/local/apache2/bin:/usr/local/apache/bin:/usr/sbin:$PATH])
471 # ask the daemon for the version and set parameters
472 AC_MSG_CHECKING(default apache version)
473 httpd="`$xs -q SBINDIR`/`$xs -q TARGET`"
474 if test "x$httpd" != "x" && test -f $httpd ; then
475 v=`$httpd -v|$SED -n -e 's/.*Apache\/\.*//p'`
477 1.3*) [enable_apache_13]=yes
481 2.0*) [enable_apache_20]=yes
485 2.2*) [enable_apache_22]=yes
489 *) AC_MSG_ERROR(unusable apache versions: $v. Try setting --with-apxs)
492 AC_MSG_RESULT(cannot determine version. Try setting --with-apxs)
496 # Apache 1.3 (mod_shib_13)
498 # --with-apxs (DSO build, the normal way, uses apxs to derive build flags)
500 AC_ARG_ENABLE(apache-13,
501 AC_HELP_STRING([--enable-apache-13], [enable the Apache 1.3 module]),
502 [ if test "x$enableval" = "x" ; then
505 WANT_APACHE_13="$enableval"
507 ],[ WANT_APACHE_13=no ])
508 AC_MSG_CHECKING(whether to build Apache 1.3 module)
509 if test "$WANT_APACHE_13" != yes && test "$WANT_APACHE_13" != no ; then
512 AC_MSG_RESULT($WANT_APACHE_13)
514 if test "$WANT_APACHE_13" = "yes" ; then
516 AC_HELP_STRING([--with-apxs=FILE], [Specifies where to find the Apache 1.3 apxs script.]),
518 AC_MSG_CHECKING(for user-specified apxs name/location)
519 if test "$withval" != "no" ; then
520 if test "$withval" != "yes"; then
522 AC_MSG_RESULT("$withval")
527 AC_PATH_PROG(APXS, apxs, no)
528 if test "$APXS" = "no" ; then
529 for i in /usr/sbin /usr/local/apache/bin ; do
530 if test "$APXS" = "no" && test -f "$i/apxs"; then
537 AC_MSG_CHECKING([to see if apxs was located])
538 if test ! -f "$APXS" ; then
540 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.])
545 # extract settings we need from APXS -q
546 APXS_CC="`$APXS -q CC`"
547 APXS_CFLAGS="`$APXS -q CFLAGS` `$APXS -q CFLAGS_SHLIB`"
548 APXS_INCLUDE="`$APXS -q INCLUDEDIR`"
551 AC_SUBST(APXS_CFLAGS)
552 AC_SUBST(APXS_INCLUDE)
555 # Apache 2.0 (mod_shib_20)
557 # --with-apxs2 (DSO build, the normal way, uses apxs to derive build flags)
558 # --with-apr (DSO build, APR development package installed separately)
560 AC_ARG_ENABLE(apache-20,
561 AC_HELP_STRING([--enable-apache-20], [enable the Apache 2.0 module]),
562 [ if test "x$enableval" = "x" ; then
565 WANT_APACHE_20="$enableval"
567 ],[ WANT_APACHE_20=no ])
568 AC_MSG_CHECKING(whether to build Apache 2.0 module)
569 if test "$WANT_APACHE_20" != yes && test "$WANT_APACHE_20" != no ; then
572 AC_MSG_RESULT($WANT_APACHE_20)
574 if test "$WANT_APACHE_20" = "yes" ; then
576 AC_HELP_STRING([--with-apxs2=FILE], [Specifies where to find the Apache 2.0 apxs script.]),
578 AC_MSG_CHECKING(for user-specified Apache2 apxs name/location)
579 if test "$withval" != "no" ; then
580 if test "$withval" != "yes"; then
582 AC_MSG_RESULT("$withval")
587 AC_PATH_PROG(APXS2, apxs2, no)
588 if test "$APXS2" = "no" ; then
589 AC_PATH_PROG(APXS2, apxs, no)
591 if test "$APXS2" = "no" ; then
592 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
593 if test "$APXS2" = "no" && test -f "$i/apxs2" ; then
597 if test "$APXS2" = "no" ; then
598 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
599 if test "$APXS2" = "no" && test -f "$i/apxs" ; then
607 AC_MSG_CHECKING([to see if Apache2 apxs was located])
608 if test ! -f "$APXS2" ; then
610 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.])
612 AC_MSG_RESULT($APXS2)
617 AC_HELP_STRING([--with-apr=PATH], [where apr-config is installed]),
619 AC_MSG_CHECKING(for user-specified apr-config name/location)
620 if test "$withval" != "no" ; then
621 if test "$withval" != "yes"; then
623 AC_MSG_RESULT("$withval")
628 AC_PATH_PROG(APR_CONFIG, apr-config,,[`$APXS2 -q SBINDIR`]:[$PATH])
630 if test -f "${APR_CONFIG}"; then
631 APR_CFLAGS="`${APR_CONFIG} --cflags` `${APR_CONFIG} --cppflags` `${APR_CONFIG} --includes`"
633 AC_MSG_ERROR([Unable to locate apr-config, may need --with-apr option.])
636 # extract settings we need from APXS2 -q
637 APXS2_CC="`$APXS2 -q CC`"
638 APXS2_CFLAGS="`$APXS2 -q CPPFLAGS` `$APXS2 -q CFLAGS` $APR_CFLAGS"
639 APXS2_INCLUDE="`$APXS2 -q INCLUDEDIR`"
642 AC_SUBST(APXS2_CFLAGS)
643 AC_SUBST(APXS2_INCLUDE)
646 # Apache 2.2 (mod_shib_22)
648 # --with-apxs22 (DSO build, the normal way, uses apxs to derive build flags)
649 # --with-apr1 (DSO build, APR development package installed separately)
651 AC_ARG_ENABLE(apache-22,
652 AC_HELP_STRING([--enable-apache-22], [enable the Apache 2.2 module]),
653 [ if test "x$enableval" = "x" ; then
656 WANT_APACHE_22="$enableval"
658 ],[ WANT_APACHE_22=no ])
659 AC_MSG_CHECKING(whether to build Apache 2.2 module)
660 if test "$WANT_APACHE_22" != yes && test "$WANT_APACHE_22" != no ; then
663 AC_MSG_RESULT($WANT_APACHE_22)
665 if test "$WANT_APACHE_22" = "yes" ; then
667 AC_HELP_STRING([--with-apxs22=FILE], [Specifies where to find the Apache 2.2 apxs script.]),
669 AC_MSG_CHECKING(for user-specified Apache2.2 apxs name/location)
670 if test "$withval" != "no" ; then
671 if test "$withval" != "yes"; then
673 AC_MSG_RESULT("$withval")
678 AC_PATH_PROG(APXS22, apxs2, no)
679 if test "$APXS22" = "no" ; then
680 AC_PATH_PROG(APXS22, apxs, no)
682 if test "$APXS22" = "no" ; then
683 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
684 if test "$APXS22" = "no" && test -f "$i/apxs2" ; then
688 if test "$APXS22" = "no" ; then
689 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
690 if test "$APXS22" = "no" && test -f "$i/apxs" ; then
698 AC_MSG_CHECKING([to see if Apache2.2 apxs was located])
699 if test ! -f "$APXS22" ; then
701 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.])
703 AC_MSG_RESULT($APXS22)
708 AC_HELP_STRING([--with-apr1=PATH], [where apr-1-config is installed]),
710 AC_MSG_CHECKING(for user-specified apr-1-config name/location)
711 if test "$withval" != "no" ; then
712 if test "$withval" != "yes"; then
714 AC_MSG_RESULT("$withval")
719 AC_PATH_PROG(APR1_CONFIG, apr-1-config,,[`$APXS22 -q SBINDIR`]:[$PATH])
721 if test -f "${APR1_CONFIG}"; then
722 APR1_CFLAGS="`${APR1_CONFIG} --cflags` `${APR1_CONFIG} --cppflags` `${APR1_CONFIG} --includes`"
724 AC_MSG_ERROR([Unable to locate apr-1-config, may need --with-apr1 option.])
727 # extract settings we need from APXS22 -q
728 APXS22_CC="`$APXS22 -q CC`"
729 APXS22_CFLAGS="`$APXS22 -q CPPFLAGS` `$APXS22 -q CFLAGS` $APR1_CFLAGS"
730 APXS22_INCLUDE="`$APXS22 -q INCLUDEDIR`"
733 AC_SUBST(APXS22_CFLAGS)
734 AC_SUBST(APXS22_INCLUDE)
736 # always output the Makefile, even if you don't use it
737 AC_CONFIG_FILES([apache/Makefile])
738 AM_CONDITIONAL(BUILD_AP13,test "$WANT_APACHE_13" = "yes")
739 AM_CONDITIONAL(BUILD_AP20,test "$WANT_APACHE_20" = "yes")
740 AM_CONDITIONAL(BUILD_AP22,test "$WANT_APACHE_22" = "yes")
742 # add the apache module to the list of wanted subdirs..
743 if test "$WANT_APACHE_13" = "yes" || test "$WANT_APACHE_20" = "yes" || test "$WANT_APACHE_22" = "yes" ; then
744 WANT_SUBDIRS="$WANT_SUBDIRS apache"
749 # Implement the checks of the ODBC Storage Service
751 # 1) Assume the user wants ODBC; if it's not found then just continue without
752 # 2) If the user specifically requested odbc, look for it and ERROR if not found
753 # 3) If the user specifically requested no odbc, don't build it.
756 AC_CONFIG_FILES([odbc-store/Makefile])
758 # determine whether we should enable the odbc ccache
759 AC_ARG_ENABLE([odbc],
760 AC_HELP_STRING([--disable-odbc], [disable the ODBC Storage Service]),
761 [odbc_enabled=$enableval], [odbc_enabled=default])
763 if test "x$odbc_enabled" = "x" ; then
767 # Are we trying to build ODBC?
768 AC_MSG_CHECKING(whether to build the ODBC storage service)
769 if test "$odbc_enabled" = "yes" ; then
772 elif test "$odbc_enabled" = "default" ; then
774 AC_MSG_RESULT([yes, if it can be found])
780 # If we're trying to build ODBC, try to find the odbc_config program.
781 if test "$build_odbc" = "yes" ; then
784 AC_HELP_STRING([--with-odbc=PATH], [directory where odbc is installed]),
785 [if test "$with_odbc" = no ; then
786 AC_MSG_ERROR([Try running --disable-odbc instead.])
787 elif test "$with_odbc" != yes ; then
788 odbc_dir="$with_odbc/bin"
789 if test "$with_odbc" != /usr ; then
790 ODBC_CFLAGS="-I$with_odbc/include"
791 ODBC_LIBS="-L$with_odbc/lib"
795 AC_PATH_PROG(ODBC_CONFIG, odbc_config, no, $odbc_dir $PATH )
796 if test "$ODBC_CONFIG" = no ; then
797 AC_MSG_WARN([Cannot find odbc_config, will try to guess settings.])
798 ODBC_LIBS="$ODBC_LIBS -lodbc"
800 ODBC_CFLAGS=`$ODBC_CONFIG --cflags`
801 ODBC_LIBS=`$ODBC_CONFIG --libs`
804 save_CPPFLAGS="$CPPFLAGS"
805 CPPFLAGS="$CPPFLAGS $ODBC_CFLAGS"
807 AC_CHECK_HEADER([sql.h], [have_sql_h=yes], [have_sql_h=no])
808 if test "$have_sql_h" = no -a "$odbc_enabled" = "yes" ; then
809 AC_MSG_ERROR(unable to find ODBC header files)
812 if test "$have_sql_h" = yes ; then
814 LIBS="$LIBS $ODBC_LIBS"
815 AC_MSG_CHECKING(if we can link againt ODBC)
820 [SQLSetEnvAttr(SQL_NULL_HANDLE, SQL_ATTR_CONNECTION_POOLING, (void*)SQL_CP_ONE_PER_HENV, 0)],
821 [have_odbc_libs=yes],
825 if test "$have_odbc_libs" = no ; then
826 if test "$odbc_enabled" = "yes" ; then
827 AC_MSG_ERROR([unable to link with ODBC Library])
829 AC_MSG_RESULT(no, skipping ODBC)
834 CPPFLAGS="$save_CPPFLAGS"
837 # if have_odbc_libs=yes then go ahead with building ODBC
838 if test "$have_odbc_libs" = yes ; then
839 # this AC_MSG_RESULT is from above!
841 WANT_SUBDIRS="$WANT_SUBDIRS odbc-store"
842 AC_SUBST(ODBC_CFLAGS)
847 AC_SUBST(WANT_SUBDIRS)
849 if test -n "$APXS_CC" && test "$APXS_CC" != "$CC" ; then
850 echo "=================================================================="
851 echo "WARNING: You have chosen to compile Apache-1.3 modules with a different"
852 echo " compiler than the one used to compile Apache."
854 echo " Current compiler: $CC"
855 echo " Apache's compiler: $APXS_CC"
857 echo "This could cause problems."
858 echo "=================================================================="
861 if test -n "$APXS2_CC" && test "$APXS2_CC" != "$CC" ; then
862 echo "=================================================================="
863 echo "WARNING: You have chosen to compile Apache-2.0 modules with a different"
864 echo " compiler than the one used to compile Apache."
866 echo " Current compiler: $CC"
867 echo " Apache's compiler: $APXS2_CC"
869 echo "This could cause problems."
870 echo "=================================================================="
873 if test -n "$APXS22_CC" && test "$APXS22_CC" != "$CC" ; then
874 echo "=================================================================="
875 echo "WARNING: You have chosen to compile Apache-2.2 modules with a different"
876 echo " compiler than the one used to compile Apache."
878 echo " Current compiler: $CC"
879 echo " Apache's compiler: $APXS22_CC"
881 echo "This could cause problems."
882 echo "=================================================================="
885 LIBTOOL="$LIBTOOL --silent"