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
126 ctime_r(&clock, buf);
127 ], [ac_cv_ctime_args=2])
134 ctime_r(&clock, buf, 26);
135 ], [ac_cv_ctime_args=3])
137 if test -z "$ac_cv_ctime_args"; then
140 if test "$ac_cv_ctime_args" = 2; then
141 AC_DEFINE(HAVE_CTIME_R_2,1,[Define if ctime_r is present with 2 parameters.])
142 elif test "$ac_cv_ctime_args" = 3; then
143 AC_DEFINE(HAVE_CTIME_R_3,1,[Define if ctime_r is present with 3 parameters.])
145 AC_MSG_RESULT([yes, and it takes $ac_cv_ctime_args arguments])
148 # log4shib settings (favor this version over the log4cpp code)
149 AC_PATH_PROG(LOG4SHIB_CONFIG,log4shib-config)
150 AC_ARG_WITH(log4shib,
151 AS_HELP_STRING([--with-log4shib=PATH],[where log4shib-config is installed]),
153 LOG4SHIB_CONFIG="${with_log4shib}"
154 if ! test -f "${LOG4SHIB_CONFIG}"; then
155 LOG4SHIB_CONFIG="${with_log4shib}/bin/log4shib-config"
158 if test -f "${LOG4SHIB_CONFIG}" ; then
159 LIBS="`${LOG4SHIB_CONFIG} --libs` $LIBS"
160 CPPFLAGS="`${LOG4SHIB_CONFIG} --cflags` $CPPFLAGS"
161 AC_CHECK_HEADER([log4shib/CategoryStream.hh],,AC_MSG_ERROR([unable to find log4shib header files]))
163 [AC_LANG_PROGRAM([[#include <log4shib/Category.hh>
164 #include <log4shib/CategoryStream.hh>]],
165 [[log4shib::Category::getInstance("foo").errorStream() << log4shib::eol]])],
166 [AC_DEFINE([SHIBSP_LOG4SHIB],[1],[Define to 1 if log4shib library is used.])],
167 [AC_MSG_ERROR([unable to link with log4shib])])
169 AC_MSG_WARN([log4shib-config not found, may need to use --with-log4shib option])
170 AC_MSG_WARN([will look for original log4cpp library])
173 AC_PATH_PROG(LOG4CPP_CONFIG,log4cpp-config)
175 AS_HELP_STRING([--with-log4cpp=PATH],[where log4cpp-config is installed]),
177 LOG4CPP_CONFIG="${with_log4cpp}"
178 if ! test -f "${LOG4CPP_CONFIG}"; then
179 LOG4CPP_CONFIG="${with_log4cpp}/bin/log4cpp-config"
182 if test -f "${LOG4CPP_CONFIG}"; then
183 AC_MSG_WARN([will try to use log4cpp, note that most non-Internet2 supplied versions are not thread-safe])
184 LIBS="`${LOG4CPP_CONFIG} --libs` $LIBS"
185 CPPFLAGS="`${LOG4CPP_CONFIG} --cflags` $CPPFLAGS"
186 AC_CHECK_HEADER([log4cpp/CategoryStream.hh],,AC_MSG_ERROR([unable to find log4cpp header files]))
188 [AC_LANG_PROGRAM([[#include <log4cpp/Category.hh>
189 #include <log4cpp/CategoryStream.hh>]],
190 [[log4cpp::Category::getInstance("foo").errorStream() << log4cpp::eol]])],
191 [AC_DEFINE([SHIBSP_LOG4CPP],[1],[Define to 1 if log4cpp library is used.])],
192 [AC_MSG_ERROR([unable to link with log4cpp, need version 1.0 or later])])
194 AC_MSG_ERROR([log4cpp-config not found, may need to use --with-log4cpp option])
200 AS_HELP_STRING([--with-xerces=PATH],[where xerces-c is installed]),
201 [if test x_$with_xerces != x_/usr; then
202 LDFLAGS="-L${with_xerces}/lib $LDFLAGS"
203 CPPFLAGS="-I${with_xerces}/include $CPPFLAGS"
205 LIBS="-lxerces-c $LIBS"
206 AC_CHECK_HEADER([xercesc/dom/DOM.hpp],,AC_MSG_ERROR([unable to find xerces header files]))
207 AC_MSG_CHECKING([Xerces version])
209 [AC_LANG_PROGRAM([#include <xercesc/util/XercesVersion.hpp>],
210 [#if _XERCES_VERSION != 20600
213 #error cannot use version 2.6.0
216 [AC_MSG_FAILURE([Xerces-C v2.6.0 has bugs that inhibit use with signed XML, please use a newer version])])
218 [AC_LANG_PROGRAM([[#include <xercesc/util/PlatformUtils.hpp>]],[[xercesc::XMLPlatformUtils::Initialize()]])],
219 ,[AC_MSG_ERROR([unable to link with Xerces])])
221 AC_MSG_CHECKING([whether Xerces XMLString::release(XMLByte**) exists])
223 [AC_LANG_PROGRAM([[#include <xercesc/util/XMLString.hpp>]],
224 [[using namespace XERCES_CPP_NAMESPACE; XMLByte* buf=NULL; XMLString::release(&buf);]])],
225 [AC_MSG_RESULT([yes])AC_DEFINE([SHIBSP_XERCESC_HAS_XMLBYTE_RELEASE],[1],[Define to 1 if Xerces XMLString includes XMLByte release.])],
226 [AC_MSG_RESULT([no])])
228 AC_MSG_CHECKING([whether Xerces DOMNodeFilter API returns a short])
229 AC_TRY_COMPILE([#include <xercesc/dom/DOM.hpp>],
230 [using namespace XERCES_CPP_NAMESPACE;
231 class Blocker : public DOMNodeFilter {
233 short acceptNode(const DOMNode* node) const {
234 return FILTER_REJECT;
237 static Blocker g_Blocker;
239 [AC_MSG_RESULT([yes])]
240 [AC_DEFINE([SHIBSP_XERCESC_SHORT_ACCEPTNODE],[1],[Define to 1 if Xerces DOMNodeFilter API returns a short.])],
241 [AC_MSG_RESULT([no])])
243 #XML-Tooling settings
244 AC_ARG_WITH(xmltooling,
245 AS_HELP_STRING([--with-xmltooling=PATH],[where xmltooling is installed]),
246 [if test x_$with_xmltooling != x_/usr; then
247 LDFLAGS="-L${with_xmltooling}/lib $LDFLAGS"
248 CPPFLAGS="-I${with_xmltooling}/include $CPPFLAGS"
249 DX_INCLUDE="${with_xmltooling}/include"
251 LITE_LIBS="-lxmltooling-lite"
252 XMLSEC_LIBS="-lxmltooling"
253 AC_CHECK_HEADER([xmltooling/base.h],,AC_MSG_ERROR([unable to find xmltooling header files]))
256 # save and append master libs
258 LIBS="$XMLSEC_LIBS $LIBS"
261 [AC_LANG_PROGRAM([[#include <xmltooling/XMLToolingConfig.h>
262 #include <xmltooling/version.h>]],
263 [[#if _XMLTOOLING_VERSION >= 10400
264 xmltooling::XMLToolingConfig::getConfig();
266 #error Need XMLTooling version 1.4 or higher
268 ,[AC_MSG_ERROR([unable to link with XMLTooling, or version was too old])])
270 # restore master libs
273 # Establish location of xmltooling catalog.
275 if test "x$with_xmltooling" = "x" ; then
276 with_xmltooling="/usr"
278 if test -f $with_xmltooling/share/xml/xmltooling/catalog.xml ; then
279 XMLTOOLINGXMLDIR="$with_xmltooling"
280 elif test -f $with_xerces/share/xml/xmltooling/catalog.xml ; then
281 XMLTOOLINGXMLDIR="$with_xerces"
282 elif test -f $with_log4shib/share/xml/xmltooling/catalog.xml ; then
283 XMLTOOLINGXMLDIR="$with_log4shib"
285 if test "x$XMLTOOLINGXMLDIR" = "x" ; then
286 AC_MSG_ERROR([xmltooling XML catalog not found, may need to use --with-xmltooling option])
288 XMLTOOLINGXMLDIR="$XMLTOOLINGXMLDIR/share/xml/xmltooling"
289 AC_SUBST(XMLTOOLINGXMLDIR)
291 # XML-Security settings
293 AS_HELP_STRING([--with-xmlsec=PATH],[where xmlsec is installed]),,
296 if test x_$with_xmlsec != x_/usr; then
297 LDFLAGS="-L${with_xmlsec}/lib $LDFLAGS"
298 CPPFLAGS="-I${with_xmlsec}/include $CPPFLAGS"
300 XMLSEC_LIBS="-lxml-security-c $XMLSEC_LIBS"
302 # save and append master libs
304 LIBS="$XMLSEC_LIBS $LIBS"
306 AC_CHECK_HEADER([xsec/utils/XSECPlatformUtils.hpp],,AC_MSG_ERROR([unable to find XML-Security-C header files]))
307 AC_MSG_CHECKING([XML-Security-C version])
309 [AC_LANG_PROGRAM([#include <xsec/utils/XSECPlatformUtils.hpp>],
310 [#if XSEC_VERSION_MAJOR > 1 || (XSEC_VERSION_MAJOR == 1 && XSEC_VERSION_MEDIUM > 3)
313 #error need version 1.4.0 or later
316 [AC_MSG_FAILURE([XML-Security-C version 1.4.0 or greater is required.])])
318 [AC_LANG_PROGRAM([[#include <xsec/utils/XSECPlatformUtils.hpp>]],
319 [[XSECPlatformUtils::Initialise()]])],,
320 [AC_MSG_ERROR([unable to link with XML-Security])])
323 AC_MSG_CHECKING([whether XML-Security-C supports white/blacklisting of algorithms])
324 AC_TRY_COMPILE([#include <xsec/framework/XSECAlgorithmMapper.hpp>],
325 [XSECAlgorithmMapper* mapper; mapper->whitelistAlgorithm(NULL);],
326 [AC_MSG_RESULT([yes])]
327 [AC_DEFINE([SHIBSP_XMLSEC_WHITELISTING],[1],[Define to 1 if XML-Security-C supports white/blacklisting algorithms.])],
328 [AC_MSG_RESULT([no])])
331 # restore master libs
336 AS_HELP_STRING([--with-saml=PATH],[where saml is installed]),
337 [if test x_$with_saml != x_/usr; then
338 LDFLAGS="-L${with_saml}/lib $LDFLAGS"
339 CPPFLAGS="-I${with_saml}/include $CPPFLAGS"
340 DX_INCLUDE="$DX_INCLUDE ${with_saml}/include"
342 XMLSEC_LIBS="-lsaml $XMLSEC_LIBS"
344 # save and append master libs
346 LIBS="$XMLSEC_LIBS $LIBS"
348 AC_CHECK_HEADER([saml/saml2/metadata/Metadata.h],,AC_MSG_ERROR([unable to find OpenSAML header files]))
351 #include <saml/SAMLConfig.h>
352 #include <saml/version.h>
355 #if _OPENSAML_VERSION >= 20400
356 opensaml::SAMLConfig::getConfig();
358 #error Need OpenSAML version 2.4 or higher
361 [AC_DEFINE(HAVE_SAML,1,[Define if saml library was found])],
362 [AC_MSG_ERROR([unable to link with OpenSAML, or version was too old])]
365 # restore master libs
368 # Establish location of opensaml catalogs.
370 if test "x$with_saml" = "x" ; then
373 if test -f $with_saml/share/xml/opensaml/saml20-catalog.xml ; then
374 OPENSAMLXMLDIR="$with_saml"
375 elif test -f $with_xmltooling/share/xml/opensaml/saml20-catalog.xml ; then
376 OPENSAMLXMLDIR="$with_xmltooling"
377 elif test -f $with_xerces/share/xml/opensaml/saml20-catalog.xml ; then
378 OPENSAMLXMLDIR="$with_xerces"
379 elif test -f $with_log4shib/share/xml/opensaml/saml20-catalog.xml ; then
380 OPENSAMLXMLDIR="$with_log4shib"
382 if test "x$OPENSAMLXMLDIR" = "x" ; then
383 AC_MSG_ERROR([opensaml XML catalogs not found, may need to use --with-saml option])
385 OPENSAMLXMLDIR="$OPENSAMLXMLDIR/share/xml/opensaml"
386 AC_SUBST(OPENSAMLXMLDIR)
389 AC_SUBST(XMLSEC_LIBS)
391 # output the underlying makefiles
392 WANT_SUBDIRS="doc schemas configs shibsp shibd util"
393 AC_CONFIG_FILES([Makefile doc/Makefile schemas/Makefile \
394 configs/Makefile shibsp/Makefile shibd/Makefile \
395 util/Makefile selinux/Makefile])
398 AC_CONFIG_FILES([adfs/Makefile])
399 AC_ARG_ENABLE([adfs],
400 AS_HELP_STRING([--disable-adfs],[don't build the ADFS module]),
401 [adfs_enabled=$enableval], [adfs_enabled=yes])
402 if test "x$adfs_enabled" = "x" ; then
405 AC_MSG_CHECKING(whether to build the ADFS module)
406 if test "$adfs_enabled" = "no" ; then
410 WANT_SUBDIRS="$WANT_SUBDIRS adfs"
415 # Build NSAPI module?
417 AC_MSG_CHECKING(for NSAPI module option)
419 AS_HELP_STRING([--with-nsapi=DIR],[Build NSAPI module for Netscape/iPlanet/SunONE]),
420 [WANT_NSAPI=$withval],[WANT_NSAPI=no])
421 AC_MSG_RESULT($WANT_NSAPI)
423 if test "$WANT_NSAPI" != "no"; then
424 if test ! -d $WANT_NSAPI/bin ; then
425 AC_MSG_ERROR([Please specify the path to the root of your Netscape/iPlanet/SunONE server using --with-nsapi=DIR])
427 AC_MSG_CHECKING(for NSAPI include files)
428 if test -d $WANT_NSAPI/include ; then
429 NSAPI_INCLUDE=$WANT_NSAPI/include
430 AC_MSG_RESULT(Netscape-Enterprise 3.x style)
431 AC_CHECK_HEADERS([$NSAPI_INCLUDE/nsapi.h],,,[#define XP_UNIX])
432 NSAPI_INCLUDE="$NSAPI_INC_DIR -I$NSAPI_INCLUDE"
434 if test -d $WANT_NSAPI/plugins/include ; then
435 test -n "$NSAPI_INCLUDE" && NSAPI_INC_DIR="-I$NSAPI_INCLUDE"
436 NSAPI_INCLUDE="$WANT_NSAPI/plugins/include"
437 AC_MSG_RESULT(iPlanet 4.x / SunONE 6.x style)
438 AC_CHECK_HEADERS([$NSAPI_INCLUDE/nsapi.h],,,[#define XP_UNIX])
439 NSAPI_INCLUDE="$NSAPI_INC_DIR -I$NSAPI_INCLUDE"
441 if test "$NSAPI_INCLUDE" = ""; then
442 AC_MSG_ERROR([Please check you have nsapi.h in either $WANT_NSAPI/include or $WANT_NSAPI/plugins/include])
446 AC_SUBST(NSAPI_INCLUDE)
448 # always output the Makefile, even if you don't use it
449 AC_CONFIG_FILES([nsapi_shib/Makefile])
450 AM_CONDITIONAL(BUILD_NSAPI,test ! "$WANT_NSAPI" = "no")
452 # add the NSAPI module to the list of wanted subdirs..
453 if test ! "$WANT_NSAPI" = "no" ; then
454 WANT_SUBDIRS="$WANT_SUBDIRS nsapi_shib"
459 # Build FastCGI support?
461 AC_MSG_CHECKING(for FastCGI support)
463 AS_HELP_STRING([--with-fastcgi=DIR],[Build FastCGI support]),
464 [WANT_FASTCGI=$withval],[WANT_FASTCGI=no])
465 AC_MSG_RESULT($WANT_FASTCGI)
467 if test "$WANT_FASTCGI" != "no"; then
468 if test "$WANT_FASTCGI" != "yes"; then
469 if test x_$WANT_FASTCGI != x_/usr; then
470 FASTCGI_INCLUDE="-I$WANT_FASTCGI/include"
471 FASTCGI_LDFLAGS="-L$WANT_FASTCGI/lib"
474 AC_CHECK_HEADER([fcgio.h],,AC_MSG_ERROR([unable to find FastCGI header files]))
475 FASTCGI_LIBS="-lfcgi -lfcgi++"
478 AC_SUBST(FASTCGI_INCLUDE)
479 AC_SUBST(FASTCGI_LDFLAGS)
480 AC_SUBST(FASTCGI_LIBS)
482 # always output the Makefile, even if you don't use it
483 AC_CONFIG_FILES([fastcgi/Makefile])
484 AM_CONDITIONAL(BUILD_FASTCGI,test ! "$WANT_FASTCGI" = "no")
486 if test ! "$WANT_FASTCGI" = "no" ; then
487 WANT_SUBDIRS="$WANT_SUBDIRS fastcgi"
491 # Build Memcached support?
493 AC_MSG_CHECKING(for Memcached support)
494 AC_ARG_WITH(memcached,
495 AS_HELP_STRING([--with-memcached=DIR],[Build Memcached support]),
496 [WANT_MEMCACHED=$withval],[WANT_MEMCACHED=no])
497 AC_MSG_RESULT($WANT_MEMCACHED)
499 if test "$WANT_MEMCACHED" != "no"; then
500 if test "$WANT_MEMCACHED" != "yes"; then
501 if test x_$WANT_MEMCACHED != x_/usr; then
502 MEMCACHED_INCLUDE="-I$WANT_MEMCACHED/include"
503 MEMCACHED_LDFLAGS="-L$WANT_MEMCACHED/lib"
506 AC_CHECK_HEADER([libmemcached/memcached.h],,
507 AC_MSG_ERROR([unable to find Memcached header files]))
508 MEMCACHED_LIBS="-lmemcached"
511 AC_SUBST(MEMCACHED_INCLUDE)
512 AC_SUBST(MEMCACHED_LDFLAGS)
513 AC_SUBST(MEMCACHED_LIBS)
515 # always output the Makefile, even if you don't use it
516 AC_CONFIG_FILES([memcache-store/Makefile])
517 AM_CONDITIONAL(BUILD_MEMCACHED,test ! "$WANT_MEMCACHED" = "no")
519 if test ! "$WANT_MEMCACHED" = "no" ; then
520 WANT_SUBDIRS="$WANT_SUBDIRS memcache-store"
525 # If no --enable-apache-xx specified
526 # find a default and fake the specific parameters
529 # simple macro to peek at an enable or a with
531 if test "[${[$1]_][$2]+set}" = set; then
532 peekval="${[$1]_[$2]}"
537 AC_MSG_CHECKING(if default apache needed)
539 Peek(enable,apache_13,need_default=no)
540 Peek(enable,apache_20,need_default=no)
541 Peek(enable,apache_22,need_default=no)
542 AC_MSG_RESULT($need_default)
544 if test "$need_default" = "yes"; then
545 # find an apxs, then the httpd
547 Peek(with,apxs,xs="$peekval")
548 Peek(with,apxs2,xs="$peekval")
549 Peek(with,apxs22,xs="$peekval")
550 if test "x$xs" = "x"; then
551 AC_PATH_PROGS(xs, apxs2 apxs,
552 AC_MSG_ERROR(No apxs, no apache found. Try --with-apxs),
553 [/usr/local/apache2/bin:/usr/local/apache/bin:/usr/sbin:$PATH])
555 # ask the daemon for the version and set parameters
556 AC_MSG_CHECKING(default apache version)
557 httpd="`$xs -q SBINDIR`/`$xs -q TARGET`"
558 if test "x$httpd" != "x" && test -f $httpd ; then
559 v=`$httpd -v|$SED -n -e 's/.*Apache\/\.*//p'`
561 1.3*) [enable_apache_13]=yes
565 2.0*) [enable_apache_20]=yes
569 2.2*) [enable_apache_22]=yes
573 *) AC_MSG_ERROR(unusable apache versions: $v. Try setting --with-apxs)
576 AC_MSG_RESULT(cannot determine version. Try setting --with-apxs)
580 # Apache 1.3 (mod_shib_13)
582 # --with-apxs (DSO build, the normal way, uses apxs to derive build flags)
584 AC_ARG_ENABLE(apache-13,
585 AS_HELP_STRING([--enable-apache-13],[enable the Apache 1.3 module]),
586 [if test "x$enableval" = "x" ; then
589 WANT_APACHE_13="$enableval"
591 ],[ WANT_APACHE_13=no ])
592 AC_MSG_CHECKING(whether to build Apache 1.3 module)
593 if test "$WANT_APACHE_13" != yes && test "$WANT_APACHE_13" != no ; then
596 AC_MSG_RESULT($WANT_APACHE_13)
598 if test "$WANT_APACHE_13" = "yes" ; then
600 AS_HELP_STRING([--with-apxs=FILE],[Specifies where to find the Apache 1.3 apxs script.]),
602 AC_MSG_CHECKING(for user-specified apxs name/location)
603 if test "$withval" != "no" ; then
604 if test "$withval" != "yes"; then
606 AC_MSG_RESULT("$withval")
611 AC_PATH_PROG(APXS, apxs, no)
612 if test "$APXS" = "no" ; then
613 for i in /usr/sbin /usr/local/apache/bin ; do
614 if test "$APXS" = "no" && test -f "$i/apxs"; then
621 AC_MSG_CHECKING([to see if apxs was located])
622 if test ! -f "$APXS" ; then
624 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.])
629 # extract settings we need from APXS -q
630 APXS_CC="`$APXS -q CC`"
631 APXS_CFLAGS="`$APXS -q CFLAGS` `$APXS -q CFLAGS_SHLIB`"
632 APXS_INCLUDE="`$APXS -q INCLUDEDIR`"
635 AC_SUBST(APXS_CFLAGS)
636 AC_SUBST(APXS_INCLUDE)
639 # Apache 2.0 (mod_shib_20)
641 # --with-apxs2 (DSO build, the normal way, uses apxs to derive build flags)
642 # --with-apr (DSO build, APR development package installed separately)
643 # --with-apu (DSO build, APR-UTIL development package installed separately)
645 AC_ARG_ENABLE(apache-20,
646 AS_HELP_STRING([--enable-apache-20],[enable the Apache 2.0 module]),
647 [if test "x$enableval" = "x" ; then
650 WANT_APACHE_20="$enableval"
652 ],[ WANT_APACHE_20=no ])
653 AC_MSG_CHECKING(whether to build Apache 2.0 module)
654 if test "$WANT_APACHE_20" != yes && test "$WANT_APACHE_20" != no ; then
657 AC_MSG_RESULT($WANT_APACHE_20)
659 if test "$WANT_APACHE_20" = "yes" ; then
661 AS_HELP_STRING([--with-apxs2=FILE],[Specifies where to find the Apache 2.0 apxs script.]),
663 AC_MSG_CHECKING(for user-specified Apache2 apxs name/location)
664 if test "$withval" != "no" ; then
665 if test "$withval" != "yes"; then
667 AC_MSG_RESULT("$withval")
672 AC_PATH_PROG(APXS2, apxs2, no)
673 if test "$APXS2" = "no" ; then
674 AC_PATH_PROG(APXS2, apxs, no)
676 if test "$APXS2" = "no" ; then
677 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
678 if test "$APXS2" = "no" && test -f "$i/apxs2" ; then
682 if test "$APXS2" = "no" ; then
683 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
684 if test "$APXS2" = "no" && test -f "$i/apxs" ; then
692 AC_MSG_CHECKING([to see if Apache2 apxs was located])
693 if test ! -f "$APXS2" ; then
695 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.])
697 AC_MSG_RESULT($APXS2)
702 AS_HELP_STRING([--with-apr=PATH],[where apr-config is installed]),
704 AC_MSG_CHECKING(for user-specified apr-config name/location)
705 if test "$withval" != "no" ; then
706 if test "$withval" != "yes"; then
708 AC_MSG_RESULT("$withval")
713 AC_PATH_PROG(APR_CONFIG, apr-config,,[`$APXS2 -q SBINDIR`]:[$PATH])
715 if test -f "${APR_CONFIG}"; then
716 APR_CFLAGS="`${APR_CONFIG} --cflags` `${APR_CONFIG} --cppflags` `${APR_CONFIG} --includes`"
718 AC_MSG_ERROR([Unable to locate apr-config, may need --with-apr option.])
723 AS_HELP_STRING([--with-apu=PATH],[where apu-config is installed]),
725 AC_MSG_CHECKING(for user-specified apu-config name/location)
726 if test "$withval" != "no" ; then
727 if test "$withval" != "yes"; then
729 AC_MSG_RESULT("$withval")
734 AC_PATH_PROG(APU_CONFIG, apu-config,,[`$APXS2 -q SBINDIR`]:[$PATH])
736 if test -f "${APU_CONFIG}"; then
737 APU_CFLAGS="`${APU_CONFIG} --includes`"
739 AC_MSG_ERROR([Unable to locate apu-config, may need --with-apu option.])
742 # extract settings we need from APXS2 -q
743 APXS2_CC="`$APXS2 -q CC`"
744 APXS2_CFLAGS="`$APXS2 -q CPPFLAGS` `$APXS2 -q CFLAGS` $APR_CFLAGS $APU_CFLAGS"
745 APXS2_INCLUDE="`$APXS2 -q INCLUDEDIR`"
748 AC_SUBST(APXS2_CFLAGS)
749 AC_SUBST(APXS2_INCLUDE)
752 # Apache 2.2 (mod_shib_22)
754 # --with-apxs22 (DSO build, the normal way, uses apxs to derive build flags)
755 # --with-apr1 (DSO build, APR development package installed separately)
756 # --with-apu1 (DSO build, APR-UTIL development package installed separately)
758 AC_ARG_ENABLE(apache-22,
759 AS_HELP_STRING([--enable-apache-22],[enable the Apache 2.2 module]),
760 [if test "x$enableval" = "x" ; then
763 WANT_APACHE_22="$enableval"
765 ],[ WANT_APACHE_22=no ])
766 AC_MSG_CHECKING(whether to build Apache 2.2 module)
767 if test "$WANT_APACHE_22" != yes && test "$WANT_APACHE_22" != no ; then
770 AC_MSG_RESULT($WANT_APACHE_22)
772 if test "$WANT_APACHE_22" = "yes" ; then
774 AS_HELP_STRING([--with-apxs22=FILE],[Specifies where to find the Apache 2.2 apxs script.]),
776 AC_MSG_CHECKING(for user-specified Apache2.2 apxs name/location)
777 if test "$withval" != "no" ; then
778 if test "$withval" != "yes"; then
780 AC_MSG_RESULT("$withval")
785 AC_PATH_PROG(APXS22, apxs2, no)
786 if test "$APXS22" = "no" ; then
787 AC_PATH_PROG(APXS22, apxs, no)
789 if test "$APXS22" = "no" ; then
790 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
791 if test "$APXS22" = "no" && test -f "$i/apxs2" ; then
795 if test "$APXS22" = "no" ; then
796 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
797 if test "$APXS22" = "no" && test -f "$i/apxs" ; then
805 AC_MSG_CHECKING([to see if Apache2.2 apxs was located])
806 if test ! -f "$APXS22" ; then
808 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.])
810 AC_MSG_RESULT($APXS22)
815 AS_HELP_STRING([--with-apr1=PATH],[where apr-1-config is installed]),
817 AC_MSG_CHECKING(for user-specified apr-1-config name/location)
818 if test "$withval" != "no" ; then
819 if test "$withval" != "yes"; then
821 AC_MSG_RESULT("$withval")
826 AC_PATH_PROG(APR1_CONFIG, apr-1-config,,[`$APXS22 -q SBINDIR`]:[$PATH])
828 if test -f "${APR1_CONFIG}"; then
829 APR1_CFLAGS="`${APR1_CONFIG} --cflags` `${APR1_CONFIG} --cppflags` `${APR1_CONFIG} --includes`"
831 AC_MSG_ERROR([Unable to locate apr-1-config, may need --with-apr1 option.])
836 AS_HELP_STRING([--with-apu1=PATH],[where apu-1-config is installed]),
838 AC_MSG_CHECKING(for user-specified apu-1-config name/location)
839 if test "$withval" != "no" ; then
840 if test "$withval" != "yes"; then
842 AC_MSG_RESULT("$withval")
847 AC_PATH_PROG(APU1_CONFIG, apu-1-config,,[`$APXS22 -q SBINDIR`]:[$PATH])
849 if test -f "${APU1_CONFIG}"; then
850 APU1_CFLAGS="`${APU1_CONFIG} --includes`"
852 AC_MSG_ERROR([Unable to locate apu-1-config, may need --with-apu1 option.])
855 # extract settings we need from APXS22 -q
856 APXS22_CC="`$APXS22 -q CC`"
857 APXS22_CFLAGS="`$APXS22 -q CPPFLAGS` `$APXS22 -q CFLAGS` $APR1_CFLAGS $APU1_CFLAGS"
858 APXS22_INCLUDE="`$APXS22 -q INCLUDEDIR`"
861 AC_SUBST(APXS22_CFLAGS)
862 AC_SUBST(APXS22_INCLUDE)
864 # always output the Makefile, even if you don't use it
865 AC_CONFIG_FILES([apache/Makefile])
866 AM_CONDITIONAL(BUILD_AP13,test "$WANT_APACHE_13" = "yes")
867 AM_CONDITIONAL(BUILD_AP20,test "$WANT_APACHE_20" = "yes")
868 AM_CONDITIONAL(BUILD_AP22,test "$WANT_APACHE_22" = "yes")
870 # add the apache module to the list of wanted subdirs..
871 if test "$WANT_APACHE_13" = "yes" || test "$WANT_APACHE_20" = "yes" || test "$WANT_APACHE_22" = "yes" ; then
872 WANT_SUBDIRS="$WANT_SUBDIRS apache"
877 # Implement the checks of the ODBC Storage Service
879 # 1) Assume the user wants ODBC; if it's not found then just continue without
880 # 2) If the user specifically requested odbc, look for it and ERROR if not found
881 # 3) If the user specifically requested no odbc, don't build it.
884 AC_CONFIG_FILES([odbc-store/Makefile])
886 # determine whether we should enable the odbc ccache
887 AC_ARG_ENABLE([odbc],
888 AS_HELP_STRING([--disable-odbc],[disable the ODBC Storage Service]),
889 [odbc_enabled=$enableval], [odbc_enabled=default])
890 if test "x$odbc_enabled" = "x" ; then
894 # Are we trying to build ODBC?
895 AC_MSG_CHECKING(whether to build the ODBC storage service)
896 if test "$odbc_enabled" = "yes" ; then
899 elif test "$odbc_enabled" = "default" ; then
901 AC_MSG_RESULT([yes, if it can be found])
907 # If we're trying to build ODBC, try to find the odbc_config program.
908 if test "$build_odbc" = "yes" ; then
911 AS_HELP_STRING([--with-odbc=PATH],[directory where odbc is installed]),
912 [if test "$with_odbc" = no ; then
913 AC_MSG_ERROR([Try running --disable-odbc instead.])
914 elif test "$with_odbc" != yes ; then
915 odbc_dir="$with_odbc/bin"
916 if test "$with_odbc" != /usr ; then
917 ODBC_CFLAGS="-I$with_odbc/include"
918 ODBC_LIBS="-L$with_odbc/lib"
922 AC_PATH_PROG(ODBC_CONFIG, odbc_config, no, $odbc_dir $PATH )
923 if test "$ODBC_CONFIG" = no ; then
924 AC_MSG_WARN([Cannot find odbc_config, will try to guess settings.])
925 ODBC_LIBS="$ODBC_LIBS -lodbc"
927 ODBC_CFLAGS=`$ODBC_CONFIG --cflags`
928 ODBC_LIBS=`$ODBC_CONFIG --libs`
931 save_CPPFLAGS="$CPPFLAGS"
932 CPPFLAGS="$CPPFLAGS $ODBC_CFLAGS"
934 AC_CHECK_HEADER([sql.h], [have_sql_h=yes], [have_sql_h=no])
935 if test "$have_sql_h" = no -a "$odbc_enabled" = "yes" ; then
936 AC_MSG_ERROR(unable to find ODBC header files)
939 if test "$have_sql_h" = yes ; then
941 LIBS="$LIBS $ODBC_LIBS"
942 AC_MSG_CHECKING(if we can link againt ODBC)
947 [SQLSetEnvAttr(SQL_NULL_HANDLE, SQL_ATTR_CONNECTION_POOLING, (void*)SQL_CP_ONE_PER_HENV, 0)],
948 [have_odbc_libs=yes],
952 if test "$have_odbc_libs" = no ; then
953 if test "$odbc_enabled" = "yes" ; then
954 AC_MSG_ERROR([unable to link with ODBC Library])
956 AC_MSG_RESULT([no, skipping ODBC])
961 CPPFLAGS="$save_CPPFLAGS"
964 # if have_odbc_libs=yes then go ahead with building ODBC
965 if test "$have_odbc_libs" = yes ; then
966 # this AC_MSG_RESULT is from above!
968 WANT_SUBDIRS="$WANT_SUBDIRS odbc-store"
969 AC_SUBST(ODBC_CFLAGS)
974 AC_SUBST(WANT_SUBDIRS)
976 if test -n "$APXS_CC" && test "$APXS_CC" != "$CC" ; then
977 echo "=================================================================="
978 echo "WARNING: You have chosen to compile Apache-1.3 modules with a different"
979 echo " compiler than the one used to compile Apache."
981 echo " Current compiler: $CC"
982 echo " Apache's compiler: $APXS_CC"
984 echo "This could cause problems."
985 echo "=================================================================="
988 if test -n "$APXS2_CC" && test "$APXS2_CC" != "$CC" ; then
989 echo "=================================================================="
990 echo "WARNING: You have chosen to compile Apache-2.0 modules with a different"
991 echo " compiler than the one used to compile Apache."
993 echo " Current compiler: $CC"
994 echo " Apache's compiler: $APXS2_CC"
996 echo "This could cause problems."
997 echo "=================================================================="
1000 if test -n "$APXS22_CC" && test "$APXS22_CC" != "$CC" ; then
1001 echo "=================================================================="
1002 echo "WARNING: You have chosen to compile Apache-2.2 modules with a different"
1003 echo " compiler than the one used to compile Apache."
1005 echo " Current compiler: $CC"
1006 echo " Apache's compiler: $APXS22_CC"
1008 echo "This could cause problems."
1009 echo "=================================================================="
1012 LIBTOOL="$LIBTOOL --silent"