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
122 [AC_LANG_PROGRAM([[#include <time.h>]], [[time_t clock; char buf[26]; ctime_r(&clock, buf);]])],
123 [ac_cv_ctime_args=2],[])
126 [AC_LANG_PROGRAM([[#include <time.h>]], [[time_t clock; char buf[26]; ctime_r(&clock, buf, 26);]])],
127 [ac_cv_ctime_args=3],[])
129 if test -z "$ac_cv_ctime_args"; then
132 if test "$ac_cv_ctime_args" = 2; then
133 AC_DEFINE([HAVE_CTIME_R_2],[1],[Define if ctime_r is present with 2 parameters.])
134 elif test "$ac_cv_ctime_args" = 3; then
135 AC_DEFINE([HAVE_CTIME_R_3],[1],[Define if ctime_r is present with 3 parameters.])
137 AC_MSG_RESULT([yes, and it takes $ac_cv_ctime_args arguments])
140 # log4shib settings (favor this version over the log4cpp code)
141 AC_PATH_PROG(LOG4SHIB_CONFIG,log4shib-config)
142 AC_ARG_WITH(log4shib,
143 AS_HELP_STRING([--with-log4shib=PATH],[where log4shib-config is installed]),
145 LOG4SHIB_CONFIG="${with_log4shib}"
146 if ! test -f "${LOG4SHIB_CONFIG}"; then
147 LOG4SHIB_CONFIG="${with_log4shib}/bin/log4shib-config"
150 if test -f "${LOG4SHIB_CONFIG}" ; then
151 LIBS="`${LOG4SHIB_CONFIG} --libs` $LIBS"
152 CPPFLAGS="`${LOG4SHIB_CONFIG} --cflags` $CPPFLAGS"
153 AC_CHECK_HEADER([log4shib/CategoryStream.hh],,AC_MSG_ERROR([unable to find log4shib header files]))
155 [AC_LANG_PROGRAM([[#include <log4shib/Category.hh>
156 #include <log4shib/CategoryStream.hh>]],
157 [[log4shib::Category::getInstance("foo").errorStream() << log4shib::eol]])],
158 [AC_DEFINE([SHIBSP_LOG4SHIB],[1],[Define to 1 if log4shib library is used.])],
159 [AC_MSG_ERROR([unable to link with log4shib])])
161 AC_MSG_WARN([log4shib-config not found, may need to use --with-log4shib option])
162 AC_MSG_WARN([will look for original log4cpp library])
165 AC_PATH_PROG(LOG4CPP_CONFIG,log4cpp-config)
167 AS_HELP_STRING([--with-log4cpp=PATH],[where log4cpp-config is installed]),
169 LOG4CPP_CONFIG="${with_log4cpp}"
170 if ! test -f "${LOG4CPP_CONFIG}"; then
171 LOG4CPP_CONFIG="${with_log4cpp}/bin/log4cpp-config"
174 if test -f "${LOG4CPP_CONFIG}"; then
175 AC_MSG_WARN([will try to use log4cpp, note that most non-Internet2 supplied versions are not thread-safe])
176 LIBS="`${LOG4CPP_CONFIG} --libs` $LIBS"
177 CPPFLAGS="`${LOG4CPP_CONFIG} --cflags` $CPPFLAGS"
178 AC_CHECK_HEADER([log4cpp/CategoryStream.hh],,AC_MSG_ERROR([unable to find log4cpp header files]))
180 [AC_LANG_PROGRAM([[#include <log4cpp/Category.hh>
181 #include <log4cpp/CategoryStream.hh>]],
182 [[log4cpp::Category::getInstance("foo").errorStream() << log4cpp::eol]])],
183 [AC_DEFINE([SHIBSP_LOG4CPP],[1],[Define to 1 if log4cpp library is used.])],
184 [AC_MSG_ERROR([unable to link with log4cpp, need version 1.0 or later])])
186 AC_MSG_ERROR([log4cpp-config not found, may need to use --with-log4cpp option])
192 AS_HELP_STRING([--with-xerces=PATH],[where xerces-c is installed]),
193 [if test x_$with_xerces != x_/usr; then
194 LDFLAGS="-L${with_xerces}/lib $LDFLAGS"
195 CPPFLAGS="-I${with_xerces}/include $CPPFLAGS"
197 LIBS="-lxerces-c $LIBS"
198 AC_CHECK_HEADER([xercesc/dom/DOM.hpp],,AC_MSG_ERROR([unable to find xerces header files]))
199 AC_MSG_CHECKING([Xerces version])
201 [AC_LANG_PROGRAM([#include <xercesc/util/XercesVersion.hpp>],
202 [#if _XERCES_VERSION != 20600
205 #error cannot use version 2.6.0
208 [AC_MSG_FAILURE([Xerces-C v2.6.0 has bugs that inhibit use with signed XML, please use a newer version])])
210 [AC_LANG_PROGRAM([[#include <xercesc/util/PlatformUtils.hpp>]],[[xercesc::XMLPlatformUtils::Initialize()]])],
211 ,[AC_MSG_ERROR([unable to link with Xerces])])
213 AC_MSG_CHECKING([whether Xerces XMLString::release(XMLByte**) exists])
215 [AC_LANG_PROGRAM([[#include <xercesc/util/XMLString.hpp>]],
216 [[using namespace XERCES_CPP_NAMESPACE; XMLByte* buf=NULL; XMLString::release(&buf);]])],
217 [AC_MSG_RESULT([yes])AC_DEFINE([SHIBSP_XERCESC_HAS_XMLBYTE_RELEASE],[1],[Define to 1 if Xerces XMLString includes XMLByte release.])],
218 [AC_MSG_RESULT([no])])
220 AC_MSG_CHECKING([whether Xerces DOMNodeFilter API returns a short])
222 [AC_LANG_PROGRAM([[#include <xercesc/dom/DOM.hpp>]],
223 [[using namespace XERCES_CPP_NAMESPACE;
224 class Blocker : public DOMNodeFilter {
226 short acceptNode(const DOMNode* node) const {
227 return FILTER_REJECT;
230 static Blocker g_Blocker;
232 [AC_MSG_RESULT([yes])AC_DEFINE([SHIBSP_XERCESC_SHORT_ACCEPTNODE],[1],[Define to 1 if Xerces DOMNodeFilter API returns a short.])],
233 [AC_MSG_RESULT([no])])
235 #XML-Tooling settings
236 AC_ARG_WITH(xmltooling,
237 AS_HELP_STRING([--with-xmltooling=PATH],[where xmltooling is installed]),
238 [if test x_$with_xmltooling != x_/usr; then
239 LDFLAGS="-L${with_xmltooling}/lib $LDFLAGS"
240 CPPFLAGS="-I${with_xmltooling}/include $CPPFLAGS"
241 DX_INCLUDE="${with_xmltooling}/include"
243 LITE_LIBS="-lxmltooling-lite"
244 XMLSEC_LIBS="-lxmltooling"
245 AC_CHECK_HEADER([xmltooling/base.h],,AC_MSG_ERROR([unable to find xmltooling header files]))
248 # save and append master libs
250 LIBS="$XMLSEC_LIBS $LIBS"
253 [AC_LANG_PROGRAM([[#include <xmltooling/XMLToolingConfig.h>
254 #include <xmltooling/version.h>]],
255 [[#if _XMLTOOLING_VERSION >= 10400
256 xmltooling::XMLToolingConfig::getConfig();
258 #error Need XMLTooling version 1.4 or higher
260 ,[AC_MSG_ERROR([unable to link with XMLTooling, or version was too old])])
262 # restore master libs
265 # Establish location of xmltooling catalog.
267 if test "x$with_xmltooling" = "x" ; then
268 with_xmltooling="/usr"
270 if test -f $with_xmltooling/share/xml/xmltooling/catalog.xml ; then
271 XMLTOOLINGXMLDIR="$with_xmltooling"
272 elif test -f $with_xerces/share/xml/xmltooling/catalog.xml ; then
273 XMLTOOLINGXMLDIR="$with_xerces"
274 elif test -f $with_log4shib/share/xml/xmltooling/catalog.xml ; then
275 XMLTOOLINGXMLDIR="$with_log4shib"
277 if test "x$XMLTOOLINGXMLDIR" = "x" ; then
278 AC_MSG_ERROR([xmltooling XML catalog not found, may need to use --with-xmltooling option])
280 XMLTOOLINGXMLDIR="$XMLTOOLINGXMLDIR/share/xml/xmltooling"
281 AC_SUBST(XMLTOOLINGXMLDIR)
283 # XML-Security settings
285 AS_HELP_STRING([--with-xmlsec=PATH],[where xmlsec is installed]),,
288 if test x_$with_xmlsec != x_/usr; then
289 LDFLAGS="-L${with_xmlsec}/lib $LDFLAGS"
290 CPPFLAGS="-I${with_xmlsec}/include $CPPFLAGS"
292 XMLSEC_LIBS="-lxml-security-c $XMLSEC_LIBS"
294 # save and append master libs
296 LIBS="$XMLSEC_LIBS $LIBS"
298 AC_CHECK_HEADER([xsec/utils/XSECPlatformUtils.hpp],,AC_MSG_ERROR([unable to find XML-Security-C header files]))
299 AC_MSG_CHECKING([XML-Security-C version])
301 [AC_LANG_PROGRAM([#include <xsec/utils/XSECPlatformUtils.hpp>],
302 [#if XSEC_VERSION_MAJOR > 1 || (XSEC_VERSION_MAJOR == 1 && XSEC_VERSION_MEDIUM > 3)
305 #error need version 1.4.0 or later
308 [AC_MSG_FAILURE([XML-Security-C version 1.4.0 or greater is required.])])
310 [AC_LANG_PROGRAM([[#include <xsec/utils/XSECPlatformUtils.hpp>]],
311 [[XSECPlatformUtils::Initialise()]])],,
312 [AC_MSG_ERROR([unable to link with XML-Security])])
315 AC_MSG_CHECKING([whether XML-Security-C supports white/blacklisting of algorithms])
316 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <xsec/framework/XSECAlgorithmMapper.hpp>]], [[XSECAlgorithmMapper* mapper; mapper->whitelistAlgorithm(NULL);]])],[AC_MSG_RESULT([yes])
317 AC_DEFINE([SHIBSP_XMLSEC_WHITELISTING],[1],[Define to 1 if XML-Security-C supports white/blacklisting algorithms.])],[AC_MSG_RESULT([no])])
320 # restore master libs
325 AS_HELP_STRING([--with-saml=PATH],[where saml is installed]),
326 [if test x_$with_saml != x_/usr; then
327 LDFLAGS="-L${with_saml}/lib $LDFLAGS"
328 CPPFLAGS="-I${with_saml}/include $CPPFLAGS"
329 DX_INCLUDE="$DX_INCLUDE ${with_saml}/include"
331 XMLSEC_LIBS="-lsaml $XMLSEC_LIBS"
333 # save and append master libs
335 LIBS="$XMLSEC_LIBS $LIBS"
337 AC_CHECK_HEADER([saml/saml2/metadata/Metadata.h],,AC_MSG_ERROR([unable to find OpenSAML header files]))
339 [AC_LANG_PROGRAM([[#include <saml/SAMLConfig.h>
340 #include <saml/version.h>]],
341 [[#if _OPENSAML_VERSION >= 20400
342 opensaml::SAMLConfig::getConfig();
344 #error Need OpenSAML version 2.4 or higher
346 ,[AC_MSG_ERROR([unable to link with OpenSAML, or version was too old])
349 # restore master libs
352 # Establish location of opensaml catalogs.
354 if test "x$with_saml" = "x" ; then
357 if test -f $with_saml/share/xml/opensaml/saml20-catalog.xml ; then
358 OPENSAMLXMLDIR="$with_saml"
359 elif test -f $with_xmltooling/share/xml/opensaml/saml20-catalog.xml ; then
360 OPENSAMLXMLDIR="$with_xmltooling"
361 elif test -f $with_xerces/share/xml/opensaml/saml20-catalog.xml ; then
362 OPENSAMLXMLDIR="$with_xerces"
363 elif test -f $with_log4shib/share/xml/opensaml/saml20-catalog.xml ; then
364 OPENSAMLXMLDIR="$with_log4shib"
366 if test "x$OPENSAMLXMLDIR" = "x" ; then
367 AC_MSG_ERROR([opensaml XML catalogs not found, may need to use --with-saml option])
369 OPENSAMLXMLDIR="$OPENSAMLXMLDIR/share/xml/opensaml"
370 AC_SUBST(OPENSAMLXMLDIR)
373 AC_SUBST(XMLSEC_LIBS)
375 # output the underlying makefiles
376 WANT_SUBDIRS="doc schemas configs shibsp shibd util"
377 AC_CONFIG_FILES([Makefile doc/Makefile schemas/Makefile \
378 configs/Makefile shibsp/Makefile shibd/Makefile \
379 util/Makefile selinux/Makefile])
382 AC_CONFIG_FILES([adfs/Makefile])
383 AC_ARG_ENABLE([adfs],
384 AS_HELP_STRING([--disable-adfs],[don't build the ADFS module]),
385 [adfs_enabled=$enableval], [adfs_enabled=yes])
386 if test "x$adfs_enabled" = "x" ; then
389 AC_MSG_CHECKING(whether to build the ADFS module)
390 if test "$adfs_enabled" = "no" ; then
394 WANT_SUBDIRS="$WANT_SUBDIRS adfs"
399 # Build NSAPI module?
401 AC_MSG_CHECKING(for NSAPI module option)
403 AS_HELP_STRING([--with-nsapi=DIR],[Build NSAPI module for Netscape/iPlanet/SunONE]),
404 [WANT_NSAPI=$withval],[WANT_NSAPI=no])
405 AC_MSG_RESULT($WANT_NSAPI)
407 if test "$WANT_NSAPI" != "no"; then
408 if test ! -d $WANT_NSAPI/bin ; then
409 AC_MSG_ERROR([Please specify the path to the root of your Netscape/iPlanet/SunONE server using --with-nsapi=DIR])
411 AC_MSG_CHECKING(for NSAPI include files)
412 if test -d $WANT_NSAPI/include ; then
413 NSAPI_INCLUDE=$WANT_NSAPI/include
414 AC_MSG_RESULT(Netscape-Enterprise 3.x style)
415 AC_CHECK_HEADERS([$NSAPI_INCLUDE/nsapi.h],,,[#define XP_UNIX])
416 NSAPI_INCLUDE="$NSAPI_INC_DIR -I$NSAPI_INCLUDE"
418 if test -d $WANT_NSAPI/plugins/include ; then
419 test -n "$NSAPI_INCLUDE" && NSAPI_INC_DIR="-I$NSAPI_INCLUDE"
420 NSAPI_INCLUDE="$WANT_NSAPI/plugins/include"
421 AC_MSG_RESULT(iPlanet 4.x / SunONE 6.x style)
422 AC_CHECK_HEADERS([$NSAPI_INCLUDE/nsapi.h],,,[#define XP_UNIX])
423 NSAPI_INCLUDE="$NSAPI_INC_DIR -I$NSAPI_INCLUDE"
425 if test "$NSAPI_INCLUDE" = ""; then
426 AC_MSG_ERROR([Please check you have nsapi.h in either $WANT_NSAPI/include or $WANT_NSAPI/plugins/include])
430 AC_SUBST(NSAPI_INCLUDE)
432 # always output the Makefile, even if you don't use it
433 AC_CONFIG_FILES([nsapi_shib/Makefile])
434 AM_CONDITIONAL(BUILD_NSAPI,test ! "$WANT_NSAPI" = "no")
436 # add the NSAPI module to the list of wanted subdirs..
437 if test ! "$WANT_NSAPI" = "no" ; then
438 WANT_SUBDIRS="$WANT_SUBDIRS nsapi_shib"
443 # Build FastCGI support?
445 AC_MSG_CHECKING(for FastCGI support)
447 AS_HELP_STRING([--with-fastcgi=DIR],[Build FastCGI support]),
448 [WANT_FASTCGI=$withval],[WANT_FASTCGI=no])
449 AC_MSG_RESULT($WANT_FASTCGI)
451 if test "$WANT_FASTCGI" != "no"; then
452 if test "$WANT_FASTCGI" != "yes"; then
453 if test x_$WANT_FASTCGI != x_/usr; then
454 FASTCGI_INCLUDE="-I$WANT_FASTCGI/include"
455 FASTCGI_LDFLAGS="-L$WANT_FASTCGI/lib"
458 AC_CHECK_HEADER([fcgio.h],,AC_MSG_ERROR([unable to find FastCGI header files]))
459 FASTCGI_LIBS="-lfcgi -lfcgi++"
462 AC_SUBST(FASTCGI_INCLUDE)
463 AC_SUBST(FASTCGI_LDFLAGS)
464 AC_SUBST(FASTCGI_LIBS)
466 # always output the Makefile, even if you don't use it
467 AC_CONFIG_FILES([fastcgi/Makefile])
468 AM_CONDITIONAL(BUILD_FASTCGI,test ! "$WANT_FASTCGI" = "no")
470 if test ! "$WANT_FASTCGI" = "no" ; then
471 WANT_SUBDIRS="$WANT_SUBDIRS fastcgi"
475 # Build Memcached support?
477 AC_MSG_CHECKING(for Memcached support)
478 AC_ARG_WITH(memcached,
479 AS_HELP_STRING([--with-memcached=DIR],[Build Memcached support]),
480 [WANT_MEMCACHED=$withval],[WANT_MEMCACHED=no])
481 AC_MSG_RESULT($WANT_MEMCACHED)
483 if test "$WANT_MEMCACHED" != "no"; then
484 if test "$WANT_MEMCACHED" != "yes"; then
485 if test x_$WANT_MEMCACHED != x_/usr; then
486 MEMCACHED_INCLUDE="-I$WANT_MEMCACHED/include"
487 MEMCACHED_LDFLAGS="-L$WANT_MEMCACHED/lib"
490 AC_CHECK_HEADER([libmemcached/memcached.h],,
491 AC_MSG_ERROR([unable to find Memcached header files]))
492 MEMCACHED_LIBS="-lmemcached"
495 AC_SUBST(MEMCACHED_INCLUDE)
496 AC_SUBST(MEMCACHED_LDFLAGS)
497 AC_SUBST(MEMCACHED_LIBS)
499 # always output the Makefile, even if you don't use it
500 AC_CONFIG_FILES([memcache-store/Makefile])
501 AM_CONDITIONAL(BUILD_MEMCACHED,test ! "$WANT_MEMCACHED" = "no")
503 if test ! "$WANT_MEMCACHED" = "no" ; then
504 WANT_SUBDIRS="$WANT_SUBDIRS memcache-store"
509 # If no --enable-apache-xx specified
510 # find a default and fake the specific parameters
513 # simple macro to peek at an enable or a with
515 if test "[${[$1]_][$2]+set}" = set; then
516 peekval="${[$1]_[$2]}"
521 AC_MSG_CHECKING(if default apache needed)
523 Peek(enable,apache_13,need_default=no)
524 Peek(enable,apache_20,need_default=no)
525 Peek(enable,apache_22,need_default=no)
526 AC_MSG_RESULT($need_default)
528 if test "$need_default" = "yes"; then
529 # find an apxs, then the httpd
531 Peek(with,apxs,xs="$peekval")
532 Peek(with,apxs2,xs="$peekval")
533 Peek(with,apxs22,xs="$peekval")
534 if test "x$xs" = "x"; then
535 AC_PATH_PROGS(xs, apxs2 apxs,
536 AC_MSG_ERROR(No apxs, no apache found. Try --with-apxs),
537 [/usr/local/apache2/bin:/usr/local/apache/bin:/usr/sbin:$PATH])
539 # ask the daemon for the version and set parameters
540 AC_MSG_CHECKING(default apache version)
541 httpd="`$xs -q SBINDIR`/`$xs -q TARGET`"
542 if test "x$httpd" != "x" && test -f $httpd ; then
543 v=`$httpd -v|$SED -n -e 's/.*Apache\/\.*//p'`
545 1.3*) [enable_apache_13]=yes
549 2.0*) [enable_apache_20]=yes
553 2.2*) [enable_apache_22]=yes
557 *) AC_MSG_ERROR(unusable apache versions: $v. Try setting --with-apxs)
560 AC_MSG_RESULT(cannot determine version. Try setting --with-apxs)
564 # Apache 1.3 (mod_shib_13)
566 # --with-apxs (DSO build, the normal way, uses apxs to derive build flags)
568 AC_ARG_ENABLE(apache-13,
569 AS_HELP_STRING([--enable-apache-13],[enable the Apache 1.3 module]),
570 [if test "x$enableval" = "x" ; then
573 WANT_APACHE_13="$enableval"
575 ],[ WANT_APACHE_13=no ])
576 AC_MSG_CHECKING(whether to build Apache 1.3 module)
577 if test "$WANT_APACHE_13" != yes && test "$WANT_APACHE_13" != no ; then
580 AC_MSG_RESULT($WANT_APACHE_13)
582 if test "$WANT_APACHE_13" = "yes" ; then
584 AS_HELP_STRING([--with-apxs=FILE],[Specifies where to find the Apache 1.3 apxs script.]),
586 AC_MSG_CHECKING(for user-specified apxs name/location)
587 if test "$withval" != "no" ; then
588 if test "$withval" != "yes"; then
590 AC_MSG_RESULT("$withval")
595 AC_PATH_PROG(APXS, apxs, no)
596 if test "$APXS" = "no" ; then
597 for i in /usr/sbin /usr/local/apache/bin ; do
598 if test "$APXS" = "no" && test -f "$i/apxs"; then
605 AC_MSG_CHECKING([to see if apxs was located])
606 if test ! -f "$APXS" ; then
608 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.])
613 # extract settings we need from APXS -q
614 APXS_CC="`$APXS -q CC`"
615 APXS_CFLAGS="`$APXS -q CFLAGS` `$APXS -q CFLAGS_SHLIB`"
616 APXS_INCLUDE="`$APXS -q INCLUDEDIR`"
619 AC_SUBST(APXS_CFLAGS)
620 AC_SUBST(APXS_INCLUDE)
623 # Apache 2.0 (mod_shib_20)
625 # --with-apxs2 (DSO build, the normal way, uses apxs to derive build flags)
626 # --with-apr (DSO build, APR development package installed separately)
627 # --with-apu (DSO build, APR-UTIL development package installed separately)
629 AC_ARG_ENABLE(apache-20,
630 AS_HELP_STRING([--enable-apache-20],[enable the Apache 2.0 module]),
631 [if test "x$enableval" = "x" ; then
634 WANT_APACHE_20="$enableval"
636 ],[ WANT_APACHE_20=no ])
637 AC_MSG_CHECKING(whether to build Apache 2.0 module)
638 if test "$WANT_APACHE_20" != yes && test "$WANT_APACHE_20" != no ; then
641 AC_MSG_RESULT($WANT_APACHE_20)
643 if test "$WANT_APACHE_20" = "yes" ; then
645 AS_HELP_STRING([--with-apxs2=FILE],[Specifies where to find the Apache 2.0 apxs script.]),
647 AC_MSG_CHECKING(for user-specified Apache2 apxs name/location)
648 if test "$withval" != "no" ; then
649 if test "$withval" != "yes"; then
651 AC_MSG_RESULT("$withval")
656 AC_PATH_PROG(APXS2, apxs2, no)
657 if test "$APXS2" = "no" ; then
658 AC_PATH_PROG(APXS2, apxs, no)
660 if test "$APXS2" = "no" ; then
661 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
662 if test "$APXS2" = "no" && test -f "$i/apxs2" ; then
666 if test "$APXS2" = "no" ; then
667 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
668 if test "$APXS2" = "no" && test -f "$i/apxs" ; then
676 AC_MSG_CHECKING([to see if Apache2 apxs was located])
677 if test ! -f "$APXS2" ; then
679 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.])
681 AC_MSG_RESULT($APXS2)
686 AS_HELP_STRING([--with-apr=PATH],[where apr-config is installed]),
688 AC_MSG_CHECKING(for user-specified apr-config name/location)
689 if test "$withval" != "no" ; then
690 if test "$withval" != "yes"; then
692 AC_MSG_RESULT("$withval")
697 AC_PATH_PROG(APR_CONFIG, apr-config,,[`$APXS2 -q SBINDIR`]:[$PATH])
699 if test -f "${APR_CONFIG}"; then
700 APR_CFLAGS="`${APR_CONFIG} --cflags` `${APR_CONFIG} --cppflags` `${APR_CONFIG} --includes`"
702 AC_MSG_ERROR([Unable to locate apr-config, may need --with-apr option.])
707 AS_HELP_STRING([--with-apu=PATH],[where apu-config is installed]),
709 AC_MSG_CHECKING(for user-specified apu-config name/location)
710 if test "$withval" != "no" ; then
711 if test "$withval" != "yes"; then
713 AC_MSG_RESULT("$withval")
718 AC_PATH_PROG(APU_CONFIG, apu-config,,[`$APXS2 -q SBINDIR`]:[$PATH])
720 if test -f "${APU_CONFIG}"; then
721 APU_CFLAGS="`${APU_CONFIG} --includes`"
723 AC_MSG_ERROR([Unable to locate apu-config, may need --with-apu option.])
726 # extract settings we need from APXS2 -q
727 APXS2_CC="`$APXS2 -q CC`"
728 APXS2_CFLAGS="`$APXS2 -q CPPFLAGS` `$APXS2 -q CFLAGS` $APR_CFLAGS $APU_CFLAGS"
729 APXS2_INCLUDE="`$APXS2 -q INCLUDEDIR`"
732 AC_SUBST(APXS2_CFLAGS)
733 AC_SUBST(APXS2_INCLUDE)
736 # Apache 2.2 (mod_shib_22)
738 # --with-apxs22 (DSO build, the normal way, uses apxs to derive build flags)
739 # --with-apr1 (DSO build, APR development package installed separately)
740 # --with-apu1 (DSO build, APR-UTIL development package installed separately)
742 AC_ARG_ENABLE(apache-22,
743 AS_HELP_STRING([--enable-apache-22],[enable the Apache 2.2 module]),
744 [if test "x$enableval" = "x" ; then
747 WANT_APACHE_22="$enableval"
749 ],[ WANT_APACHE_22=no ])
750 AC_MSG_CHECKING(whether to build Apache 2.2 module)
751 if test "$WANT_APACHE_22" != yes && test "$WANT_APACHE_22" != no ; then
754 AC_MSG_RESULT($WANT_APACHE_22)
756 if test "$WANT_APACHE_22" = "yes" ; then
758 AS_HELP_STRING([--with-apxs22=FILE],[Specifies where to find the Apache 2.2 apxs script.]),
760 AC_MSG_CHECKING(for user-specified Apache2.2 apxs name/location)
761 if test "$withval" != "no" ; then
762 if test "$withval" != "yes"; then
764 AC_MSG_RESULT("$withval")
769 AC_PATH_PROG(APXS22, apxs2, no)
770 if test "$APXS22" = "no" ; then
771 AC_PATH_PROG(APXS22, apxs, no)
773 if test "$APXS22" = "no" ; then
774 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
775 if test "$APXS22" = "no" && test -f "$i/apxs2" ; then
779 if test "$APXS22" = "no" ; then
780 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
781 if test "$APXS22" = "no" && test -f "$i/apxs" ; then
789 AC_MSG_CHECKING([to see if Apache2.2 apxs was located])
790 if test ! -f "$APXS22" ; then
792 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.])
794 AC_MSG_RESULT($APXS22)
799 AS_HELP_STRING([--with-apr1=PATH],[where apr-1-config is installed]),
801 AC_MSG_CHECKING(for user-specified apr-1-config name/location)
802 if test "$withval" != "no" ; then
803 if test "$withval" != "yes"; then
805 AC_MSG_RESULT("$withval")
810 AC_PATH_PROG(APR1_CONFIG, apr-1-config,,[`$APXS22 -q SBINDIR`]:[$PATH])
812 if test -f "${APR1_CONFIG}"; then
813 APR1_CFLAGS="`${APR1_CONFIG} --cflags` `${APR1_CONFIG} --cppflags` `${APR1_CONFIG} --includes`"
815 AC_MSG_ERROR([Unable to locate apr-1-config, may need --with-apr1 option.])
820 AS_HELP_STRING([--with-apu1=PATH],[where apu-1-config is installed]),
822 AC_MSG_CHECKING(for user-specified apu-1-config name/location)
823 if test "$withval" != "no" ; then
824 if test "$withval" != "yes"; then
826 AC_MSG_RESULT("$withval")
831 AC_PATH_PROG(APU1_CONFIG, apu-1-config,,[`$APXS22 -q SBINDIR`]:[$PATH])
833 if test -f "${APU1_CONFIG}"; then
834 APU1_CFLAGS="`${APU1_CONFIG} --includes`"
836 AC_MSG_ERROR([Unable to locate apu-1-config, may need --with-apu1 option.])
839 # extract settings we need from APXS22 -q
840 APXS22_CC="`$APXS22 -q CC`"
841 APXS22_CFLAGS="`$APXS22 -q CPPFLAGS` `$APXS22 -q CFLAGS` $APR1_CFLAGS $APU1_CFLAGS"
842 APXS22_INCLUDE="`$APXS22 -q INCLUDEDIR`"
845 AC_SUBST(APXS22_CFLAGS)
846 AC_SUBST(APXS22_INCLUDE)
848 # always output the Makefile, even if you don't use it
849 AC_CONFIG_FILES([apache/Makefile])
850 AM_CONDITIONAL(BUILD_AP13,test "$WANT_APACHE_13" = "yes")
851 AM_CONDITIONAL(BUILD_AP20,test "$WANT_APACHE_20" = "yes")
852 AM_CONDITIONAL(BUILD_AP22,test "$WANT_APACHE_22" = "yes")
854 # add the apache module to the list of wanted subdirs..
855 if test "$WANT_APACHE_13" = "yes" || test "$WANT_APACHE_20" = "yes" || test "$WANT_APACHE_22" = "yes" ; then
856 WANT_SUBDIRS="$WANT_SUBDIRS apache"
861 # Implement the checks of the ODBC Storage Service
863 # 1) Assume the user wants ODBC; if it's not found then just continue without
864 # 2) If the user specifically requested odbc, look for it and ERROR if not found
865 # 3) If the user specifically requested no odbc, don't build it.
868 AC_CONFIG_FILES([odbc-store/Makefile])
870 # determine whether we should enable the odbc ccache
871 AC_ARG_ENABLE([odbc],
872 AS_HELP_STRING([--disable-odbc],[disable the ODBC Storage Service]),
873 [odbc_enabled=$enableval], [odbc_enabled=default])
874 if test "x$odbc_enabled" = "x" ; then
878 # Are we trying to build ODBC?
879 AC_MSG_CHECKING(whether to build the ODBC storage service)
880 if test "$odbc_enabled" = "yes" ; then
883 elif test "$odbc_enabled" = "default" ; then
885 AC_MSG_RESULT([yes, if it can be found])
891 # If we're trying to build ODBC, try to find the odbc_config program.
892 if test "$build_odbc" = "yes" ; then
895 AS_HELP_STRING([--with-odbc=PATH],[directory where odbc is installed]),
896 [if test "$with_odbc" = no ; then
897 AC_MSG_ERROR([Try running --disable-odbc instead.])
898 elif test "$with_odbc" != yes ; then
899 odbc_dir="$with_odbc/bin"
900 if test "$with_odbc" != /usr ; then
901 ODBC_CFLAGS="-I$with_odbc/include"
902 ODBC_LIBS="-L$with_odbc/lib"
906 AC_PATH_PROG(ODBC_CONFIG, odbc_config, no, $odbc_dir $PATH )
907 if test "$ODBC_CONFIG" = no ; then
908 AC_MSG_WARN([Cannot find odbc_config, will try to guess settings.])
909 ODBC_LIBS="$ODBC_LIBS -lodbc"
911 ODBC_CFLAGS=`$ODBC_CONFIG --cflags`
912 ODBC_LIBS=`$ODBC_CONFIG --libs`
915 save_CPPFLAGS="$CPPFLAGS"
916 CPPFLAGS="$CPPFLAGS $ODBC_CFLAGS"
918 AC_CHECK_HEADER([sql.h], [have_sql_h=yes], [have_sql_h=no])
919 if test "$have_sql_h" = no -a "$odbc_enabled" = "yes" ; then
920 AC_MSG_ERROR(unable to find ODBC header files)
923 if test "$have_sql_h" = yes ; then
925 LIBS="$LIBS $ODBC_LIBS"
926 AC_MSG_CHECKING(if we can link againt ODBC)
928 [AC_LANG_PROGRAM([[#include <sql.h>
930 #include <stdio.h>]],
931 [[SQLSetEnvAttr(SQL_NULL_HANDLE, SQL_ATTR_CONNECTION_POOLING, (void*)SQL_CP_ONE_PER_HENV, 0)]])],
932 [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)
958 AC_ARG_WITH(gssapi-includes,
959 AS_HELP_STRING([--with-gssapi-includes=DIR],[Specify location of GSSAPI header]),
960 [ GSSAPI_INCS="-I$withval"
964 AC_ARG_WITH(gssapi-libs,
965 AS_HELP_STRING([--with-gssapi-libs=DIR],[Specify location of GSSAPI libs]),
966 [ GSSAPI_LIB_DIR="-L$withval"
971 AS_HELP_STRING([--with-gssapi=DIR],[Where to look for GSSAPI]),
972 [ GSSAPI_ROOT="$withval"
973 if test x"$GSSAPI_ROOT" != xno; then
975 if test x"$GSSAPI_ROOT" = xyes; then
976 dnl if yes, then use default root
982 save_CPPFLAGS="$CPPFLAGS"
983 AC_MSG_CHECKING([if GSSAPI support is requested])
984 if test x"$want_gss" = xyes; then
987 if test -z "$GSSAPI_INCS"; then
988 if test -f "$GSSAPI_ROOT/bin/krb5-config"; then
989 GSSAPI_INCS=`$GSSAPI_ROOT/bin/krb5-config --cflags gssapi`
990 elif test "$GSSAPI_ROOT" != "yes"; then
991 GSSAPI_INCS="-I$GSSAPI_ROOT/include"
995 CPPFLAGS="$CPPFLAGS $GSSAPI_INCS"
997 AC_CHECK_HEADER(gss.h,
999 dnl found in the given dirs
1000 AC_DEFINE([HAVE_GSSGNU],[1],[if you have the GNU gssapi libraries])
1004 dnl not found, check Heimdal or MIT
1005 AC_CHECK_HEADERS([gssapi/gssapi.h], [], [not_mit=1])
1007 [gssapi/gssapi_generic.h gssapi/gssapi_krb5.h],
1012 #ifdef HAVE_GSSAPI_GSSAPI_H
1013 #include <gssapi/gssapi.h>
1016 if test "x$not_mit" = "x1"; then
1017 dnl MIT not found, check for Heimdal
1018 AC_CHECK_HEADER([gssapi.h],
1021 AC_DEFINE([HAVE_GSSHEIMDAL],[1],[if you have the Heimdal gssapi libraries])
1024 dnl no header found, disabling GSS
1026 AC_MSG_WARN([disabling GSSAPI since no header files was found])
1031 AC_DEFINE([HAVE_GSSMIT],[1],[if you have the MIT gssapi libraries])
1032 dnl check if we have a really old MIT kerberos (<= 1.2)
1033 AC_MSG_CHECKING([if gssapi headers declare GSS_C_NT_HOSTBASED_SERVICE])
1036 #include <gssapi/gssapi.h>
1037 #include <gssapi/gssapi_generic.h>
1038 #include <gssapi/gssapi_krb5.h>
1043 GSS_C_NT_HOSTBASED_SERVICE,
1047 AC_MSG_RESULT([yes])
1050 AC_DEFINE([HAVE_OLD_GSSMIT],[1],[if you have an old MIT gssapi library, lacking GSS_C_NT_HOSTBASED_SERVICE])
1058 if test x"$want_gss" = xyes; then
1059 AC_DEFINE([HAVE_GSSAPI],[1],[if you have the gssapi libraries])
1061 if test -n "$gnu_gss"; then
1062 LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
1064 elif test -z "$GSSAPI_LIB_DIR"; then
1067 LIBS="$LIBS -lgssapi_krb5 -lresolv"
1070 if test -f "$GSSAPI_ROOT/bin/krb5-config"; then
1071 dnl krb5-config doesn't have --libs-only-L or similar, put everything
1073 gss_libs=`$GSSAPI_ROOT/bin/krb5-config --libs gssapi`
1074 LIBS="$LIBS $gss_libs"
1075 elif test "$GSSAPI_ROOT" != "yes"; then
1076 LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff"
1077 LIBS="$LIBS -lgssapi"
1079 LIBS="$LIBS -lgssapi"
1084 LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
1085 LIBS="$LIBS -lgssapi"
1088 CPPFLAGS="$save_CPPFLAGS"
1092 AC_SUBST(WANT_SUBDIRS)
1094 if test -n "$APXS_CC" && test "$APXS_CC" != "$CC" ; then
1095 echo "=================================================================="
1096 echo "WARNING: You have chosen to compile Apache-1.3 modules with a different"
1097 echo " compiler than the one used to compile Apache."
1099 echo " Current compiler: $CC"
1100 echo " Apache's compiler: $APXS_CC"
1102 echo "This could cause problems."
1103 echo "=================================================================="
1106 if test -n "$APXS2_CC" && test "$APXS2_CC" != "$CC" ; then
1107 echo "=================================================================="
1108 echo "WARNING: You have chosen to compile Apache-2.0 modules with a different"
1109 echo " compiler than the one used to compile Apache."
1111 echo " Current compiler: $CC"
1112 echo " Apache's compiler: $APXS2_CC"
1114 echo "This could cause problems."
1115 echo "=================================================================="
1118 if test -n "$APXS22_CC" && test "$APXS22_CC" != "$CC" ; then
1119 echo "=================================================================="
1120 echo "WARNING: You have chosen to compile Apache-2.2 modules with a different"
1121 echo " compiler than the one used to compile Apache."
1123 echo " Current compiler: $CC"
1124 echo " Apache's compiler: $APXS22_CC"
1126 echo "This could cause problems."
1127 echo "=================================================================="
1130 LIBTOOL="$LIBTOOL --silent"