2 AC_INIT([shibboleth],[2.4],[https://bugs.internet2.edu/],[shibboleth])
3 AC_CONFIG_SRCDIR(shibsp)
4 AC_CONFIG_AUX_DIR(build-aux)
5 AC_CONFIG_MACRO_DIR(m4)
18 DX_INIT_DOXYGEN(shibboleth, doxygen.cfg, doc/api)
22 AS_HELP_STRING([--enable-debug],[Have GCC compile with symbols (Default = no)]),
23 enable_debug=$enableval, enable_debug=no)
25 if test "$enable_debug" = "yes" ; then
26 GCC_CFLAGS="$CFLAGS -g -D_DEBUG"
27 GCC_CXXFLAGS="$CXXFLAGS -g -D_DEBUG"
29 GCC_CFLAGS="$CFLAGS -O2 -DNDEBUG"
30 GCC_CXXFLAGS="$CXXFLAGS -O2 -DNDEBUG"
33 AC_CONFIG_HEADERS([config.h])
34 AC_CONFIG_FILES([shibboleth.spec pkginfo Portfile])
36 AC_PROG_CC([gcc gcc3 cc])
37 AC_PROG_CXX([g++ g++3 c++ CC])
41 if test "$GCC" = "yes" ; then
42 # AC_HAVE_GCC_VERSION(4,0,0,0,
44 # AC_DEFINE(GCC_HASCLASSVISIBILITY,1,
45 # [Define to enable class visibility control in gcc.])
46 # GCC_CFLAGS="$GCC_CFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
47 # GCC_CXXFLAGS="$GCC_CXXFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
49 CFLAGS="-Wall $GCC_CFLAGS"
50 CXXFLAGS="-Wall $GCC_CXXFLAGS"
52 # Fix for Sun Workshop compiler in debug mode, may be Sun case #6360993
53 case "${host_cpu}-${host_os}" in
55 if test "$CXX" = "CC" ; then
56 CXXFLAGS="$CXXFLAGS -Qoption ccfe -stabs=no%dfltlit+no%dflthlp"
60 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"
90 AS_HELP_STRING([--with-openssl=PATH],[where openssl is installed]),
91 [if test x_$with_openssl != x_/usr; then
92 SSLFLAGS="-I${with_openssl}/include"
95 if test "x$with_openssl" = "x" ; then
96 AC_PATH_PROG(PKG_CONFIG, pkg-config)
97 if test "x$PKG_CONFIG" != x && test "x$PKG_CONFIG" != "xno" ; then
98 if pkg-config openssl ; then
99 SSLFLAGS="`$PKG_CONFIG --cflags openssl`"
101 AC_MSG_WARN([OpenSSL not supported by pkg-config, try --with-openssl instead])
106 AC_MSG_CHECKING(for OpenSSL cflags)
107 AC_MSG_RESULT($SSLFLAGS)
108 CPPFLAGS="$SSLFLAGS $CPPFLAGS"
110 AC_CHECK_HEADER([openssl/x509.h],,AC_MSG_ERROR([unable to find openssl header files]))
118 # Thank you Solaris, really.
119 AC_MSG_CHECKING(for ctime_r)
120 if test -z "$ac_cv_ctime_args"; then
121 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[
124 ctime_r(&clock, buf);
125 ]])],[ac_cv_ctime_args=2],[])
127 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[
130 ctime_r(&clock, buf, 26);
131 ]])],[ac_cv_ctime_args=3],[])
133 if test -z "$ac_cv_ctime_args"; then
136 if test "$ac_cv_ctime_args" = 2; then
137 AC_DEFINE(HAVE_CTIME_R_2,1,[Define if ctime_r is present with 2 parameters.])
138 elif test "$ac_cv_ctime_args" = 3; then
139 AC_DEFINE(HAVE_CTIME_R_3,1,[Define if ctime_r is present with 3 parameters.])
141 AC_MSG_RESULT([yes, and it takes $ac_cv_ctime_args arguments])
144 # log4shib settings (favor this version over the log4cpp code)
145 AC_PATH_PROG(LOG4SHIB_CONFIG,log4shib-config)
146 AC_ARG_WITH(log4shib,
147 AS_HELP_STRING([--with-log4shib=PATH],[where log4shib-config is installed]),
149 LOG4SHIB_CONFIG="${with_log4shib}"
150 if ! test -f "${LOG4SHIB_CONFIG}"; then
151 LOG4SHIB_CONFIG="${with_log4shib}/bin/log4shib-config"
154 if test -f "${LOG4SHIB_CONFIG}" ; then
155 LIBS="`${LOG4SHIB_CONFIG} --libs` $LIBS"
156 CPPFLAGS="`${LOG4SHIB_CONFIG} --cflags` $CPPFLAGS"
157 AC_CHECK_HEADER([log4shib/CategoryStream.hh],,AC_MSG_ERROR([unable to find log4shib header files]))
159 [AC_LANG_PROGRAM([[#include <log4shib/Category.hh>
160 #include <log4shib/CategoryStream.hh>]],
161 [[log4shib::Category::getInstance("foo").errorStream() << log4shib::eol]])],
162 [AC_DEFINE([SHIBSP_LOG4SHIB],[1],[Define to 1 if log4shib library is used.])],
163 [AC_MSG_ERROR([unable to link with log4shib])])
165 AC_MSG_WARN([log4shib-config not found, may need to use --with-log4shib option])
166 AC_MSG_WARN([will look for original log4cpp library])
169 AC_PATH_PROG(LOG4CPP_CONFIG,log4cpp-config)
171 AS_HELP_STRING([--with-log4cpp=PATH],[where log4cpp-config is installed]),
173 LOG4CPP_CONFIG="${with_log4cpp}"
174 if ! test -f "${LOG4CPP_CONFIG}"; then
175 LOG4CPP_CONFIG="${with_log4cpp}/bin/log4cpp-config"
178 if test -f "${LOG4CPP_CONFIG}"; then
179 AC_MSG_WARN([will try to use log4cpp, note that most non-Internet2 supplied versions are not thread-safe])
180 LIBS="`${LOG4CPP_CONFIG} --libs` $LIBS"
181 CPPFLAGS="`${LOG4CPP_CONFIG} --cflags` $CPPFLAGS"
182 AC_CHECK_HEADER([log4cpp/CategoryStream.hh],,AC_MSG_ERROR([unable to find log4cpp header files]))
184 [AC_LANG_PROGRAM([[#include <log4cpp/Category.hh>
185 #include <log4cpp/CategoryStream.hh>]],
186 [[log4cpp::Category::getInstance("foo").errorStream() << log4cpp::eol]])],
187 [AC_DEFINE([SHIBSP_LOG4CPP],[1],[Define to 1 if log4cpp library is used.])],
188 [AC_MSG_ERROR([unable to link with log4cpp, need version 1.0 or later])])
190 AC_MSG_ERROR([log4cpp-config not found, may need to use --with-log4cpp option])
196 AS_HELP_STRING([--with-xerces=PATH],[where xerces-c is installed]),
197 [if test x_$with_xerces != x_/usr; then
198 LDFLAGS="-L${with_xerces}/lib $LDFLAGS"
199 CPPFLAGS="-I${with_xerces}/include $CPPFLAGS"
201 LIBS="-lxerces-c $LIBS"
202 AC_CHECK_HEADER([xercesc/dom/DOM.hpp],,AC_MSG_ERROR([unable to find xerces header files]))
203 AC_MSG_CHECKING([Xerces version])
205 [AC_LANG_PROGRAM([#include <xercesc/util/XercesVersion.hpp>],
206 [#if _XERCES_VERSION != 20600
209 #error cannot use version 2.6.0
212 [AC_MSG_FAILURE([Xerces-C v2.6.0 has bugs that inhibit use with signed XML, please use a newer version])])
214 [AC_LANG_PROGRAM([[#include <xercesc/util/PlatformUtils.hpp>]],[[xercesc::XMLPlatformUtils::Initialize()]])],
215 ,[AC_MSG_ERROR([unable to link with Xerces])])
217 AC_MSG_CHECKING([whether Xerces XMLString::release(XMLByte**) exists])
219 [AC_LANG_PROGRAM([[#include <xercesc/util/XMLString.hpp>]],
220 [[using namespace XERCES_CPP_NAMESPACE; XMLByte* buf=NULL; XMLString::release(&buf);]])],
221 [AC_MSG_RESULT([yes])AC_DEFINE([SHIBSP_XERCESC_HAS_XMLBYTE_RELEASE],[1],[Define to 1 if Xerces XMLString includes XMLByte release.])],
222 [AC_MSG_RESULT([no])])
224 AC_MSG_CHECKING([whether Xerces DOMNodeFilter API returns a short])
225 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <xercesc/dom/DOM.hpp>]], [[using namespace XERCES_CPP_NAMESPACE;
226 class Blocker : public DOMNodeFilter {
228 short acceptNode(const DOMNode* node) const {
229 return FILTER_REJECT;
232 static Blocker g_Blocker;
233 ]])],[AC_MSG_RESULT([yes])
234 AC_DEFINE([SHIBSP_XERCESC_SHORT_ACCEPTNODE],[1],[Define to 1 if Xerces DOMNodeFilter API returns a short.])],[AC_MSG_RESULT([no])])
236 #XML-Tooling settings
237 AC_ARG_WITH(xmltooling,
238 AS_HELP_STRING([--with-xmltooling=PATH],[where xmltooling is installed]),
239 [if test x_$with_xmltooling != x_/usr; then
240 LDFLAGS="-L${with_xmltooling}/lib $LDFLAGS"
241 CPPFLAGS="-I${with_xmltooling}/include $CPPFLAGS"
242 DX_INCLUDE="${with_xmltooling}/include"
244 LITE_LIBS="-lxmltooling-lite"
245 XMLSEC_LIBS="-lxmltooling"
246 AC_CHECK_HEADER([xmltooling/base.h],,AC_MSG_ERROR([unable to find xmltooling header files]))
249 # save and append master libs
251 LIBS="$XMLSEC_LIBS $LIBS"
254 [AC_LANG_PROGRAM([[#include <xmltooling/XMLToolingConfig.h>
255 #include <xmltooling/version.h>]],
256 [[#if _XMLTOOLING_VERSION >= 10400
257 xmltooling::XMLToolingConfig::getConfig();
259 #error Need XMLTooling version 1.4 or higher
261 ,[AC_MSG_ERROR([unable to link with XMLTooling, or version was too old])])
263 # restore master libs
266 # Establish location of xmltooling catalog.
268 if test "x$with_xmltooling" = "x" ; then
269 with_xmltooling="/usr"
271 if test -f $with_xmltooling/share/xml/xmltooling/catalog.xml ; then
272 XMLTOOLINGXMLDIR="$with_xmltooling"
273 elif test -f $with_xerces/share/xml/xmltooling/catalog.xml ; then
274 XMLTOOLINGXMLDIR="$with_xerces"
275 elif test -f $with_log4shib/share/xml/xmltooling/catalog.xml ; then
276 XMLTOOLINGXMLDIR="$with_log4shib"
278 if test "x$XMLTOOLINGXMLDIR" = "x" ; then
279 AC_MSG_ERROR([xmltooling XML catalog not found, may need to use --with-xmltooling option])
281 XMLTOOLINGXMLDIR="$XMLTOOLINGXMLDIR/share/xml/xmltooling"
282 AC_SUBST(XMLTOOLINGXMLDIR)
284 # XML-Security settings
286 AS_HELP_STRING([--with-xmlsec=PATH],[where xmlsec is installed]),,
289 if test x_$with_xmlsec != x_/usr; then
290 LDFLAGS="-L${with_xmlsec}/lib $LDFLAGS"
291 CPPFLAGS="-I${with_xmlsec}/include $CPPFLAGS"
293 XMLSEC_LIBS="-lxml-security-c $XMLSEC_LIBS"
295 # save and append master libs
297 LIBS="$XMLSEC_LIBS $LIBS"
299 AC_CHECK_HEADER([xsec/utils/XSECPlatformUtils.hpp],,AC_MSG_ERROR([unable to find XML-Security-C header files]))
300 AC_MSG_CHECKING([XML-Security-C version])
302 [AC_LANG_PROGRAM([#include <xsec/utils/XSECPlatformUtils.hpp>],
303 [#if XSEC_VERSION_MAJOR > 1 || (XSEC_VERSION_MAJOR == 1 && XSEC_VERSION_MEDIUM > 3)
306 #error need version 1.4.0 or later
309 [AC_MSG_FAILURE([XML-Security-C version 1.4.0 or greater is required.])])
311 [AC_LANG_PROGRAM([[#include <xsec/utils/XSECPlatformUtils.hpp>]],
312 [[XSECPlatformUtils::Initialise()]])],,
313 [AC_MSG_ERROR([unable to link with XML-Security])])
316 AC_MSG_CHECKING([whether XML-Security-C supports white/blacklisting of algorithms])
317 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <xsec/framework/XSECAlgorithmMapper.hpp>]], [[XSECAlgorithmMapper* mapper; mapper->whitelistAlgorithm(NULL);]])],[AC_MSG_RESULT([yes])
318 AC_DEFINE([SHIBSP_XMLSEC_WHITELISTING],[1],[Define to 1 if XML-Security-C supports white/blacklisting algorithms.])],[AC_MSG_RESULT([no])])
321 # restore master libs
326 AS_HELP_STRING([--with-saml=PATH],[where saml is installed]),
327 [if test x_$with_saml != x_/usr; then
328 LDFLAGS="-L${with_saml}/lib $LDFLAGS"
329 CPPFLAGS="-I${with_saml}/include $CPPFLAGS"
330 DX_INCLUDE="$DX_INCLUDE ${with_saml}/include"
332 XMLSEC_LIBS="-lsaml $XMLSEC_LIBS"
334 # save and append master libs
336 LIBS="$XMLSEC_LIBS $LIBS"
338 AC_CHECK_HEADER([saml/saml2/metadata/Metadata.h],,AC_MSG_ERROR([unable to find OpenSAML header files]))
339 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
340 #include <saml/SAMLConfig.h>
341 #include <saml/version.h>
343 #if _OPENSAML_VERSION >= 20400
344 opensaml::SAMLConfig::getConfig();
346 #error Need OpenSAML version 2.4 or higher
348 ]])],[AC_DEFINE(HAVE_SAML,1,[Define if saml library was found])],[AC_MSG_ERROR([unable to link with OpenSAML, or version was too old])
351 # restore master libs
354 # Establish location of opensaml catalogs.
356 if test "x$with_saml" = "x" ; then
359 if test -f $with_saml/share/xml/opensaml/saml20-catalog.xml ; then
360 OPENSAMLXMLDIR="$with_saml"
361 elif test -f $with_xmltooling/share/xml/opensaml/saml20-catalog.xml ; then
362 OPENSAMLXMLDIR="$with_xmltooling"
363 elif test -f $with_xerces/share/xml/opensaml/saml20-catalog.xml ; then
364 OPENSAMLXMLDIR="$with_xerces"
365 elif test -f $with_log4shib/share/xml/opensaml/saml20-catalog.xml ; then
366 OPENSAMLXMLDIR="$with_log4shib"
368 if test "x$OPENSAMLXMLDIR" = "x" ; then
369 AC_MSG_ERROR([opensaml XML catalogs not found, may need to use --with-saml option])
371 OPENSAMLXMLDIR="$OPENSAMLXMLDIR/share/xml/opensaml"
372 AC_SUBST(OPENSAMLXMLDIR)
375 AC_SUBST(XMLSEC_LIBS)
377 # output the underlying makefiles
378 WANT_SUBDIRS="doc schemas configs shibsp shibd util"
379 AC_CONFIG_FILES([Makefile doc/Makefile schemas/Makefile \
380 configs/Makefile shibsp/Makefile shibd/Makefile \
381 util/Makefile selinux/Makefile])
384 AC_CONFIG_FILES([adfs/Makefile])
385 AC_ARG_ENABLE([adfs],
386 AS_HELP_STRING([--disable-adfs],[don't build the ADFS module]),
387 [adfs_enabled=$enableval], [adfs_enabled=yes])
388 if test "x$adfs_enabled" = "x" ; then
391 AC_MSG_CHECKING(whether to build the ADFS module)
392 if test "$adfs_enabled" = "no" ; then
396 WANT_SUBDIRS="$WANT_SUBDIRS adfs"
401 # Build NSAPI module?
403 AC_MSG_CHECKING(for NSAPI module option)
405 AS_HELP_STRING([--with-nsapi=DIR],[Build NSAPI module for Netscape/iPlanet/SunONE]),
406 [WANT_NSAPI=$withval],[WANT_NSAPI=no])
407 AC_MSG_RESULT($WANT_NSAPI)
409 if test "$WANT_NSAPI" != "no"; then
410 if test ! -d $WANT_NSAPI/bin ; then
411 AC_MSG_ERROR([Please specify the path to the root of your Netscape/iPlanet/SunONE server using --with-nsapi=DIR])
413 AC_MSG_CHECKING(for NSAPI include files)
414 if test -d $WANT_NSAPI/include ; then
415 NSAPI_INCLUDE=$WANT_NSAPI/include
416 AC_MSG_RESULT(Netscape-Enterprise 3.x style)
417 AC_CHECK_HEADERS([$NSAPI_INCLUDE/nsapi.h],,,[#define XP_UNIX])
418 NSAPI_INCLUDE="$NSAPI_INC_DIR -I$NSAPI_INCLUDE"
420 if test -d $WANT_NSAPI/plugins/include ; then
421 test -n "$NSAPI_INCLUDE" && NSAPI_INC_DIR="-I$NSAPI_INCLUDE"
422 NSAPI_INCLUDE="$WANT_NSAPI/plugins/include"
423 AC_MSG_RESULT(iPlanet 4.x / SunONE 6.x style)
424 AC_CHECK_HEADERS([$NSAPI_INCLUDE/nsapi.h],,,[#define XP_UNIX])
425 NSAPI_INCLUDE="$NSAPI_INC_DIR -I$NSAPI_INCLUDE"
427 if test "$NSAPI_INCLUDE" = ""; then
428 AC_MSG_ERROR([Please check you have nsapi.h in either $WANT_NSAPI/include or $WANT_NSAPI/plugins/include])
432 AC_SUBST(NSAPI_INCLUDE)
434 # always output the Makefile, even if you don't use it
435 AC_CONFIG_FILES([nsapi_shib/Makefile])
436 AM_CONDITIONAL(BUILD_NSAPI,test ! "$WANT_NSAPI" = "no")
438 # add the NSAPI module to the list of wanted subdirs..
439 if test ! "$WANT_NSAPI" = "no" ; then
440 WANT_SUBDIRS="$WANT_SUBDIRS nsapi_shib"
445 # Build FastCGI support?
447 AC_MSG_CHECKING(for FastCGI support)
449 AS_HELP_STRING([--with-fastcgi=DIR],[Build FastCGI support]),
450 [WANT_FASTCGI=$withval],[WANT_FASTCGI=no])
451 AC_MSG_RESULT($WANT_FASTCGI)
453 if test "$WANT_FASTCGI" != "no"; then
454 if test "$WANT_FASTCGI" != "yes"; then
455 if test x_$WANT_FASTCGI != x_/usr; then
456 FASTCGI_INCLUDE="-I$WANT_FASTCGI/include"
457 FASTCGI_LDFLAGS="-L$WANT_FASTCGI/lib"
460 AC_CHECK_HEADER([fcgio.h],,AC_MSG_ERROR([unable to find FastCGI header files]))
461 FASTCGI_LIBS="-lfcgi -lfcgi++"
464 AC_SUBST(FASTCGI_INCLUDE)
465 AC_SUBST(FASTCGI_LDFLAGS)
466 AC_SUBST(FASTCGI_LIBS)
468 # always output the Makefile, even if you don't use it
469 AC_CONFIG_FILES([fastcgi/Makefile])
470 AM_CONDITIONAL(BUILD_FASTCGI,test ! "$WANT_FASTCGI" = "no")
472 if test ! "$WANT_FASTCGI" = "no" ; then
473 WANT_SUBDIRS="$WANT_SUBDIRS fastcgi"
477 # Build Memcached support?
479 AC_MSG_CHECKING(for Memcached support)
480 AC_ARG_WITH(memcached,
481 AS_HELP_STRING([--with-memcached=DIR],[Build Memcached support]),
482 [WANT_MEMCACHED=$withval],[WANT_MEMCACHED=no])
483 AC_MSG_RESULT($WANT_MEMCACHED)
485 if test "$WANT_MEMCACHED" != "no"; then
486 if test "$WANT_MEMCACHED" != "yes"; then
487 if test x_$WANT_MEMCACHED != x_/usr; then
488 MEMCACHED_INCLUDE="-I$WANT_MEMCACHED/include"
489 MEMCACHED_LDFLAGS="-L$WANT_MEMCACHED/lib"
492 AC_CHECK_HEADER([libmemcached/memcached.h],,
493 AC_MSG_ERROR([unable to find Memcached header files]))
494 MEMCACHED_LIBS="-lmemcached"
497 AC_SUBST(MEMCACHED_INCLUDE)
498 AC_SUBST(MEMCACHED_LDFLAGS)
499 AC_SUBST(MEMCACHED_LIBS)
501 # always output the Makefile, even if you don't use it
502 AC_CONFIG_FILES([memcache-store/Makefile])
503 AM_CONDITIONAL(BUILD_MEMCACHED,test ! "$WANT_MEMCACHED" = "no")
505 if test ! "$WANT_MEMCACHED" = "no" ; then
506 WANT_SUBDIRS="$WANT_SUBDIRS memcache-store"
511 # If no --enable-apache-xx specified
512 # find a default and fake the specific parameters
515 # simple macro to peek at an enable or a with
517 if test "[${[$1]_][$2]+set}" = set; then
518 peekval="${[$1]_[$2]}"
523 AC_MSG_CHECKING(if default apache needed)
525 Peek(enable,apache_13,need_default=no)
526 Peek(enable,apache_20,need_default=no)
527 Peek(enable,apache_22,need_default=no)
528 AC_MSG_RESULT($need_default)
530 if test "$need_default" = "yes"; then
531 # find an apxs, then the httpd
533 Peek(with,apxs,xs="$peekval")
534 Peek(with,apxs2,xs="$peekval")
535 Peek(with,apxs22,xs="$peekval")
536 if test "x$xs" = "x"; then
537 AC_PATH_PROGS(xs, apxs2 apxs,
538 AC_MSG_ERROR(No apxs, no apache found. Try --with-apxs),
539 [/usr/local/apache2/bin:/usr/local/apache/bin:/usr/sbin:$PATH])
541 # ask the daemon for the version and set parameters
542 AC_MSG_CHECKING(default apache version)
543 httpd="`$xs -q SBINDIR`/`$xs -q TARGET`"
544 if test "x$httpd" != "x" && test -f $httpd ; then
545 v=`$httpd -v|$SED -n -e 's/.*Apache\/\.*//p'`
547 1.3*) [enable_apache_13]=yes
551 2.0*) [enable_apache_20]=yes
555 2.2*) [enable_apache_22]=yes
559 *) AC_MSG_ERROR(unusable apache versions: $v. Try setting --with-apxs)
562 AC_MSG_RESULT(cannot determine version. Try setting --with-apxs)
566 # Apache 1.3 (mod_shib_13)
568 # --with-apxs (DSO build, the normal way, uses apxs to derive build flags)
570 AC_ARG_ENABLE(apache-13,
571 AS_HELP_STRING([--enable-apache-13],[enable the Apache 1.3 module]),
572 [if test "x$enableval" = "x" ; then
575 WANT_APACHE_13="$enableval"
577 ],[ WANT_APACHE_13=no ])
578 AC_MSG_CHECKING(whether to build Apache 1.3 module)
579 if test "$WANT_APACHE_13" != yes && test "$WANT_APACHE_13" != no ; then
582 AC_MSG_RESULT($WANT_APACHE_13)
584 if test "$WANT_APACHE_13" = "yes" ; then
586 AS_HELP_STRING([--with-apxs=FILE],[Specifies where to find the Apache 1.3 apxs script.]),
588 AC_MSG_CHECKING(for user-specified apxs name/location)
589 if test "$withval" != "no" ; then
590 if test "$withval" != "yes"; then
592 AC_MSG_RESULT("$withval")
597 AC_PATH_PROG(APXS, apxs, no)
598 if test "$APXS" = "no" ; then
599 for i in /usr/sbin /usr/local/apache/bin ; do
600 if test "$APXS" = "no" && test -f "$i/apxs"; then
607 AC_MSG_CHECKING([to see if apxs was located])
608 if test ! -f "$APXS" ; then
610 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.])
615 # extract settings we need from APXS -q
616 APXS_CC="`$APXS -q CC`"
617 APXS_CFLAGS="`$APXS -q CFLAGS` `$APXS -q CFLAGS_SHLIB`"
618 APXS_INCLUDE="`$APXS -q INCLUDEDIR`"
621 AC_SUBST(APXS_CFLAGS)
622 AC_SUBST(APXS_INCLUDE)
625 # Apache 2.0 (mod_shib_20)
627 # --with-apxs2 (DSO build, the normal way, uses apxs to derive build flags)
628 # --with-apr (DSO build, APR development package installed separately)
629 # --with-apu (DSO build, APR-UTIL development package installed separately)
631 AC_ARG_ENABLE(apache-20,
632 AS_HELP_STRING([--enable-apache-20],[enable the Apache 2.0 module]),
633 [if test "x$enableval" = "x" ; then
636 WANT_APACHE_20="$enableval"
638 ],[ WANT_APACHE_20=no ])
639 AC_MSG_CHECKING(whether to build Apache 2.0 module)
640 if test "$WANT_APACHE_20" != yes && test "$WANT_APACHE_20" != no ; then
643 AC_MSG_RESULT($WANT_APACHE_20)
645 if test "$WANT_APACHE_20" = "yes" ; then
647 AS_HELP_STRING([--with-apxs2=FILE],[Specifies where to find the Apache 2.0 apxs script.]),
649 AC_MSG_CHECKING(for user-specified Apache2 apxs name/location)
650 if test "$withval" != "no" ; then
651 if test "$withval" != "yes"; then
653 AC_MSG_RESULT("$withval")
658 AC_PATH_PROG(APXS2, apxs2, no)
659 if test "$APXS2" = "no" ; then
660 AC_PATH_PROG(APXS2, apxs, no)
662 if test "$APXS2" = "no" ; then
663 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
664 if test "$APXS2" = "no" && test -f "$i/apxs2" ; then
668 if test "$APXS2" = "no" ; then
669 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
670 if test "$APXS2" = "no" && test -f "$i/apxs" ; then
678 AC_MSG_CHECKING([to see if Apache2 apxs was located])
679 if test ! -f "$APXS2" ; then
681 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.])
683 AC_MSG_RESULT($APXS2)
688 AS_HELP_STRING([--with-apr=PATH],[where apr-config is installed]),
690 AC_MSG_CHECKING(for user-specified apr-config name/location)
691 if test "$withval" != "no" ; then
692 if test "$withval" != "yes"; then
694 AC_MSG_RESULT("$withval")
699 AC_PATH_PROG(APR_CONFIG, apr-config,,[`$APXS2 -q SBINDIR`]:[$PATH])
701 if test -f "${APR_CONFIG}"; then
702 APR_CFLAGS="`${APR_CONFIG} --cflags` `${APR_CONFIG} --cppflags` `${APR_CONFIG} --includes`"
704 AC_MSG_ERROR([Unable to locate apr-config, may need --with-apr option.])
709 AS_HELP_STRING([--with-apu=PATH],[where apu-config is installed]),
711 AC_MSG_CHECKING(for user-specified apu-config name/location)
712 if test "$withval" != "no" ; then
713 if test "$withval" != "yes"; then
715 AC_MSG_RESULT("$withval")
720 AC_PATH_PROG(APU_CONFIG, apu-config,,[`$APXS2 -q SBINDIR`]:[$PATH])
722 if test -f "${APU_CONFIG}"; then
723 APU_CFLAGS="`${APU_CONFIG} --includes`"
725 AC_MSG_ERROR([Unable to locate apu-config, may need --with-apu option.])
728 # extract settings we need from APXS2 -q
729 APXS2_CC="`$APXS2 -q CC`"
730 APXS2_CFLAGS="`$APXS2 -q CPPFLAGS` `$APXS2 -q CFLAGS` $APR_CFLAGS $APU_CFLAGS"
731 APXS2_INCLUDE="`$APXS2 -q INCLUDEDIR`"
734 AC_SUBST(APXS2_CFLAGS)
735 AC_SUBST(APXS2_INCLUDE)
738 # Apache 2.2 (mod_shib_22)
740 # --with-apxs22 (DSO build, the normal way, uses apxs to derive build flags)
741 # --with-apr1 (DSO build, APR development package installed separately)
742 # --with-apu1 (DSO build, APR-UTIL development package installed separately)
744 AC_ARG_ENABLE(apache-22,
745 AS_HELP_STRING([--enable-apache-22],[enable the Apache 2.2 module]),
746 [if test "x$enableval" = "x" ; then
749 WANT_APACHE_22="$enableval"
751 ],[ WANT_APACHE_22=no ])
752 AC_MSG_CHECKING(whether to build Apache 2.2 module)
753 if test "$WANT_APACHE_22" != yes && test "$WANT_APACHE_22" != no ; then
756 AC_MSG_RESULT($WANT_APACHE_22)
758 if test "$WANT_APACHE_22" = "yes" ; then
760 AS_HELP_STRING([--with-apxs22=FILE],[Specifies where to find the Apache 2.2 apxs script.]),
762 AC_MSG_CHECKING(for user-specified Apache2.2 apxs name/location)
763 if test "$withval" != "no" ; then
764 if test "$withval" != "yes"; then
766 AC_MSG_RESULT("$withval")
771 AC_PATH_PROG(APXS22, apxs2, no)
772 if test "$APXS22" = "no" ; then
773 AC_PATH_PROG(APXS22, apxs, no)
775 if test "$APXS22" = "no" ; then
776 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
777 if test "$APXS22" = "no" && test -f "$i/apxs2" ; then
781 if test "$APXS22" = "no" ; then
782 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
783 if test "$APXS22" = "no" && test -f "$i/apxs" ; then
791 AC_MSG_CHECKING([to see if Apache2.2 apxs was located])
792 if test ! -f "$APXS22" ; then
794 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.])
796 AC_MSG_RESULT($APXS22)
801 AS_HELP_STRING([--with-apr1=PATH],[where apr-1-config is installed]),
803 AC_MSG_CHECKING(for user-specified apr-1-config name/location)
804 if test "$withval" != "no" ; then
805 if test "$withval" != "yes"; then
807 AC_MSG_RESULT("$withval")
812 AC_PATH_PROG(APR1_CONFIG, apr-1-config,,[`$APXS22 -q SBINDIR`]:[$PATH])
814 if test -f "${APR1_CONFIG}"; then
815 APR1_CFLAGS="`${APR1_CONFIG} --cflags` `${APR1_CONFIG} --cppflags` `${APR1_CONFIG} --includes`"
817 AC_MSG_ERROR([Unable to locate apr-1-config, may need --with-apr1 option.])
822 AS_HELP_STRING([--with-apu1=PATH],[where apu-1-config is installed]),
824 AC_MSG_CHECKING(for user-specified apu-1-config name/location)
825 if test "$withval" != "no" ; then
826 if test "$withval" != "yes"; then
828 AC_MSG_RESULT("$withval")
833 AC_PATH_PROG(APU1_CONFIG, apu-1-config,,[`$APXS22 -q SBINDIR`]:[$PATH])
835 if test -f "${APU1_CONFIG}"; then
836 APU1_CFLAGS="`${APU1_CONFIG} --includes`"
838 AC_MSG_ERROR([Unable to locate apu-1-config, may need --with-apu1 option.])
841 # extract settings we need from APXS22 -q
842 APXS22_CC="`$APXS22 -q CC`"
843 APXS22_CFLAGS="`$APXS22 -q CPPFLAGS` `$APXS22 -q CFLAGS` $APR1_CFLAGS $APU1_CFLAGS"
844 APXS22_INCLUDE="`$APXS22 -q INCLUDEDIR`"
847 AC_SUBST(APXS22_CFLAGS)
848 AC_SUBST(APXS22_INCLUDE)
850 # always output the Makefile, even if you don't use it
851 AC_CONFIG_FILES([apache/Makefile])
852 AM_CONDITIONAL(BUILD_AP13,test "$WANT_APACHE_13" = "yes")
853 AM_CONDITIONAL(BUILD_AP20,test "$WANT_APACHE_20" = "yes")
854 AM_CONDITIONAL(BUILD_AP22,test "$WANT_APACHE_22" = "yes")
856 # add the apache module to the list of wanted subdirs..
857 if test "$WANT_APACHE_13" = "yes" || test "$WANT_APACHE_20" = "yes" || test "$WANT_APACHE_22" = "yes" ; then
858 WANT_SUBDIRS="$WANT_SUBDIRS apache"
863 # Implement the checks of the ODBC Storage Service
865 # 1) Assume the user wants ODBC; if it's not found then just continue without
866 # 2) If the user specifically requested odbc, look for it and ERROR if not found
867 # 3) If the user specifically requested no odbc, don't build it.
870 AC_CONFIG_FILES([odbc-store/Makefile])
872 # determine whether we should enable the odbc ccache
873 AC_ARG_ENABLE([odbc],
874 AS_HELP_STRING([--disable-odbc],[disable the ODBC Storage Service]),
875 [odbc_enabled=$enableval], [odbc_enabled=default])
876 if test "x$odbc_enabled" = "x" ; then
880 # Are we trying to build ODBC?
881 AC_MSG_CHECKING(whether to build the ODBC storage service)
882 if test "$odbc_enabled" = "yes" ; then
885 elif test "$odbc_enabled" = "default" ; then
887 AC_MSG_RESULT([yes, if it can be found])
893 # If we're trying to build ODBC, try to find the odbc_config program.
894 if test "$build_odbc" = "yes" ; then
897 AS_HELP_STRING([--with-odbc=PATH],[directory where odbc is installed]),
898 [if test "$with_odbc" = no ; then
899 AC_MSG_ERROR([Try running --disable-odbc instead.])
900 elif test "$with_odbc" != yes ; then
901 odbc_dir="$with_odbc/bin"
902 if test "$with_odbc" != /usr ; then
903 ODBC_CFLAGS="-I$with_odbc/include"
904 ODBC_LIBS="-L$with_odbc/lib"
908 AC_PATH_PROG(ODBC_CONFIG, odbc_config, no, $odbc_dir $PATH )
909 if test "$ODBC_CONFIG" = no ; then
910 AC_MSG_WARN([Cannot find odbc_config, will try to guess settings.])
911 ODBC_LIBS="$ODBC_LIBS -lodbc"
913 ODBC_CFLAGS=`$ODBC_CONFIG --cflags`
914 ODBC_LIBS=`$ODBC_CONFIG --libs`
917 save_CPPFLAGS="$CPPFLAGS"
918 CPPFLAGS="$CPPFLAGS $ODBC_CFLAGS"
920 AC_CHECK_HEADER([sql.h], [have_sql_h=yes], [have_sql_h=no])
921 if test "$have_sql_h" = no -a "$odbc_enabled" = "yes" ; then
922 AC_MSG_ERROR(unable to find ODBC header files)
925 if test "$have_sql_h" = yes ; then
927 LIBS="$LIBS $ODBC_LIBS"
928 AC_MSG_CHECKING(if we can link againt ODBC)
929 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sql.h>
931 #include <stdio.h>]], [[SQLSetEnvAttr(SQL_NULL_HANDLE, SQL_ATTR_CONNECTION_POOLING, (void*)SQL_CP_ONE_PER_HENV, 0)]])],[have_odbc_libs=yes],[have_odbc_libs=no])
934 if test "$have_odbc_libs" = no ; then
935 if test "$odbc_enabled" = "yes" ; then
936 AC_MSG_ERROR([unable to link with ODBC Library])
938 AC_MSG_RESULT([no, skipping ODBC])
943 CPPFLAGS="$save_CPPFLAGS"
946 # if have_odbc_libs=yes then go ahead with building ODBC
947 if test "$have_odbc_libs" = yes ; then
948 # this AC_MSG_RESULT is from above!
950 WANT_SUBDIRS="$WANT_SUBDIRS odbc-store"
951 AC_SUBST(ODBC_CFLAGS)
956 AC_SUBST(WANT_SUBDIRS)
958 if test -n "$APXS_CC" && test "$APXS_CC" != "$CC" ; then
959 echo "=================================================================="
960 echo "WARNING: You have chosen to compile Apache-1.3 modules with a different"
961 echo " compiler than the one used to compile Apache."
963 echo " Current compiler: $CC"
964 echo " Apache's compiler: $APXS_CC"
966 echo "This could cause problems."
967 echo "=================================================================="
970 if test -n "$APXS2_CC" && test "$APXS2_CC" != "$CC" ; then
971 echo "=================================================================="
972 echo "WARNING: You have chosen to compile Apache-2.0 modules with a different"
973 echo " compiler than the one used to compile Apache."
975 echo " Current compiler: $CC"
976 echo " Apache's compiler: $APXS2_CC"
978 echo "This could cause problems."
979 echo "=================================================================="
982 if test -n "$APXS22_CC" && test "$APXS22_CC" != "$CC" ; then
983 echo "=================================================================="
984 echo "WARNING: You have chosen to compile Apache-2.2 modules with a different"
985 echo " compiler than the one used to compile Apache."
987 echo " Current compiler: $CC"
988 echo " Apache's compiler: $APXS22_CC"
990 echo "This could cause problems."
991 echo "=================================================================="
994 LIBTOOL="$LIBTOOL --silent"