2 AC_INIT([shibboleth],[2.5],[https://bugs.internet2.edu/],[shibboleth])
3 AC_CONFIG_SRCDIR(shibsp)
4 AC_CONFIG_AUX_DIR(build-aux)
5 AC_CONFIG_MACRO_DIR(m4)
19 DX_INIT_DOXYGEN(shibboleth, doxygen.cfg, doc/api)
23 AS_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_CONFIG_HEADERS([config.h shibsp/config_pub.h])
35 AC_CONFIG_FILES([shibboleth.spec pkginfo Portfile])
37 AC_PROG_CC([gcc gcc3 cc])
38 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_HEADERS([sys/utsname.h])
76 AC_CHECK_FUNCS([strchr strdup strstr timegm gmtime_r strtok_r strcasecmp])
79 ACX_PTHREAD([enable_threads="pthread"],[enable_threads="no"])
80 if test $enable_threads != "pthread"; then
81 AC_MSG_ERROR([unable to find pthreads, currently this is required])
83 AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])
84 LIBS="$PTHREAD_LIBS $LIBS"
85 CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
86 CXXFLAGS="$PTHREAD_CFLAGS $CXXFLAGS"
91 AS_HELP_STRING([--with-openssl=PATH],[where openssl is installed]),
92 [if test x_$with_openssl != x_/usr; then
93 SSLFLAGS="-I${with_openssl}/include"
96 if test "x$with_openssl" = "x" ; then
97 AC_PATH_PROG(PKG_CONFIG, pkg-config)
98 if test "x$PKG_CONFIG" != x && test "x$PKG_CONFIG" != "xno" ; then
99 if pkg-config openssl ; then
100 SSLFLAGS="`$PKG_CONFIG --cflags openssl`"
102 AC_MSG_WARN([OpenSSL not supported by pkg-config, try --with-openssl instead])
107 AC_MSG_CHECKING(for OpenSSL cflags)
108 AC_MSG_RESULT($SSLFLAGS)
109 CPPFLAGS="$SSLFLAGS $CPPFLAGS"
111 AC_CHECK_HEADER([openssl/x509.h],,AC_MSG_ERROR([unable to find openssl header files]))
119 # Thank you Solaris, really.
120 AC_MSG_CHECKING(for ctime_r)
121 if test -z "$ac_cv_ctime_args"; then
123 [AC_LANG_PROGRAM([[#include <time.h>]], [[time_t clock; char buf[26]; ctime_r(&clock, buf);]])],
124 [ac_cv_ctime_args=2],[])
127 [AC_LANG_PROGRAM([[#include <time.h>]], [[time_t clock; char buf[26]; ctime_r(&clock, buf, 26);]])],
128 [ac_cv_ctime_args=3],[])
130 if test -z "$ac_cv_ctime_args"; then
133 if test "$ac_cv_ctime_args" = 2; then
134 AC_DEFINE([HAVE_CTIME_R_2],[1],[Define if ctime_r is present with 2 parameters.])
135 elif test "$ac_cv_ctime_args" = 3; then
136 AC_DEFINE([HAVE_CTIME_R_3],[1],[Define if ctime_r is present with 3 parameters.])
138 AC_MSG_RESULT([yes, and it takes $ac_cv_ctime_args arguments])
141 # log4shib settings (favor this version over the log4cpp code)
142 AC_PATH_PROG(LOG4SHIB_CONFIG,log4shib-config)
143 AC_ARG_WITH(log4shib,
144 AS_HELP_STRING([--with-log4shib=PATH],[where log4shib-config is installed]),
146 LOG4SHIB_CONFIG="${with_log4shib}"
147 if ! test -f "${LOG4SHIB_CONFIG}"; then
148 LOG4SHIB_CONFIG="${with_log4shib}/bin/log4shib-config"
151 if test -f "${LOG4SHIB_CONFIG}" ; then
152 LIBS="`${LOG4SHIB_CONFIG} --libs` $LIBS"
153 CPPFLAGS="`${LOG4SHIB_CONFIG} --cflags` $CPPFLAGS"
154 AC_CHECK_HEADER([log4shib/CategoryStream.hh],,AC_MSG_ERROR([unable to find log4shib header files]))
156 [AC_LANG_PROGRAM([[#include <log4shib/Category.hh>
157 #include <log4shib/CategoryStream.hh>]],
158 [[log4shib::Category::getInstance("foo").errorStream() << log4shib::eol]])],
159 [AC_DEFINE([SHIBSP_LOG4SHIB],[1],[Define to 1 if log4shib library is used.])],
160 [AC_MSG_ERROR([unable to link with log4shib])])
162 AC_MSG_WARN([log4shib-config not found, may need to use --with-log4shib option])
163 AC_MSG_WARN([will look for original log4cpp library])
166 AC_PATH_PROG(LOG4CPP_CONFIG,log4cpp-config)
168 AS_HELP_STRING([--with-log4cpp=PATH],[where log4cpp-config is installed]),
170 LOG4CPP_CONFIG="${with_log4cpp}"
171 if ! test -f "${LOG4CPP_CONFIG}"; then
172 LOG4CPP_CONFIG="${with_log4cpp}/bin/log4cpp-config"
175 if test -f "${LOG4CPP_CONFIG}"; then
176 AC_MSG_WARN([will try to use log4cpp, note that most non-Internet2 supplied versions are not thread-safe])
177 LIBS="`${LOG4CPP_CONFIG} --libs` $LIBS"
178 CPPFLAGS="`${LOG4CPP_CONFIG} --cflags` $CPPFLAGS"
179 AC_CHECK_HEADER([log4cpp/CategoryStream.hh],,AC_MSG_ERROR([unable to find log4cpp header files]))
181 [AC_LANG_PROGRAM([[#include <log4cpp/Category.hh>
182 #include <log4cpp/CategoryStream.hh>]],
183 [[log4cpp::Category::getInstance("foo").errorStream() << log4cpp::eol]])],
184 [AC_DEFINE([SHIBSP_LOG4CPP],[1],[Define to 1 if log4cpp library is used.])],
185 [AC_MSG_ERROR([unable to link with log4cpp, need version 1.0 or later])])
187 AC_MSG_ERROR([log4cpp-config not found, may need to use --with-log4cpp option])
193 AS_HELP_STRING([--with-xerces=PATH],[where xerces-c is installed]),
194 [if test x_$with_xerces != x_/usr; then
195 LDFLAGS="-L${with_xerces}/lib $LDFLAGS"
196 CPPFLAGS="-I${with_xerces}/include $CPPFLAGS"
198 LIBS="-lxerces-c $LIBS"
199 AC_CHECK_HEADER([xercesc/dom/DOM.hpp],,AC_MSG_ERROR([unable to find xerces header files]))
200 AC_MSG_CHECKING([Xerces version])
202 [AC_LANG_PROGRAM([#include <xercesc/util/XercesVersion.hpp>],
203 [#if _XERCES_VERSION >= 20700
206 #error version 2.7.0 or above required
209 [AC_MSG_FAILURE([Xerces-C v2.7.0 or higher is required, v3.x preferred])])
211 [AC_LANG_PROGRAM([[#include <xercesc/util/PlatformUtils.hpp>]],[[xercesc::XMLPlatformUtils::Initialize()]])],
212 ,[AC_MSG_ERROR([unable to link with Xerces])])
214 AC_MSG_CHECKING([whether Xerces XMLString::release(XMLByte**) exists])
216 [AC_LANG_PROGRAM([[#include <xercesc/util/XMLString.hpp>]],
217 [[using namespace XERCES_CPP_NAMESPACE; XMLByte* buf=NULL; XMLString::release(&buf);]])],
218 [AC_MSG_RESULT([yes])AC_DEFINE([SHIBSP_XERCESC_HAS_XMLBYTE_RELEASE],[1],[Define to 1 if Xerces XMLString includes XMLByte release.])],
219 [AC_MSG_RESULT([no])])
221 AC_MSG_CHECKING([whether Xerces DOMNodeFilter API returns a short])
223 [AC_LANG_PROGRAM([[#include <xercesc/dom/DOM.hpp>]],
224 [[using namespace XERCES_CPP_NAMESPACE;
225 class Blocker : public DOMNodeFilter {
227 short acceptNode(const DOMNode* node) const {
228 return FILTER_REJECT;
231 static Blocker g_Blocker;
233 [AC_MSG_RESULT([yes])AC_DEFINE([SHIBSP_XERCESC_SHORT_ACCEPTNODE],[1],[Define to 1 if Xerces DOMNodeFilter API returns a short.])],
234 [AC_MSG_RESULT([no])])
236 # XML-Security settings
238 AS_HELP_STRING([--with-xmlsec=PATH],[where xmlsec is installed]),,
241 if test x_$with_xmlsec != x_/usr; then
242 LDFLAGS="-L${with_xmlsec}/lib $LDFLAGS"
243 CPPFLAGS="-I${with_xmlsec}/include $CPPFLAGS"
245 XMLSEC_LIBS="-lxml-security-c $XMLSEC_LIBS"
247 # save and append master libs
249 LIBS="$XMLSEC_LIBS $LIBS"
251 AC_CHECK_HEADER([xsec/utils/XSECPlatformUtils.hpp],,AC_MSG_ERROR([unable to find XML-Security-C header files]))
252 AC_MSG_CHECKING([XML-Security-C version])
254 [AC_LANG_PROGRAM([#include <xsec/utils/XSECPlatformUtils.hpp>],
255 [#if XSEC_VERSION_MAJOR > 1 || (XSEC_VERSION_MAJOR == 1 && XSEC_VERSION_MEDIUM > 3)
258 #error need version 1.4.0 or later
261 [AC_MSG_FAILURE([XML-Security-C version 1.4.0 or greater is required.])])
263 [AC_LANG_PROGRAM([[#include <xsec/utils/XSECPlatformUtils.hpp>]],
264 [[XSECPlatformUtils::Initialise()]])],,
265 [AC_MSG_ERROR([unable to link with XML-Security])])
267 AC_MSG_CHECKING([whether XML-Security-C supports white/blacklisting of algorithms])
268 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <xsec/framework/XSECAlgorithmMapper.hpp>]], [[XSECAlgorithmMapper* mapper; mapper->whitelistAlgorithm(NULL);]])],[AC_MSG_RESULT([yes])
269 AC_DEFINE([SHIBSP_XMLSEC_WHITELISTING],[1],[Define to 1 if XML-Security-C supports white/blacklisting algorithms.])],[AC_MSG_RESULT([no])])
271 # restore master libs
274 #XML-Tooling settings
275 AC_ARG_WITH(xmltooling,
276 AS_HELP_STRING([--with-xmltooling=PATH],[where xmltooling is installed]),
277 [if test x_$with_xmltooling != x_/usr; then
278 LDFLAGS="-L${with_xmltooling}/lib $LDFLAGS"
279 CPPFLAGS="-I${with_xmltooling}/include $CPPFLAGS"
280 DX_INCLUDE="${with_xmltooling}/include"
282 LITE_LIBS="-lxmltooling-lite"
283 XMLSEC_LIBS="-lxmltooling $XMLSEC_LIBS"
284 AC_CHECK_HEADER([xmltooling/base.h],,AC_MSG_ERROR([unable to find xmltooling header files]))
287 # save and append master libs
289 LIBS="$XMLSEC_LIBS $LIBS"
292 [AC_LANG_PROGRAM([[#include <xmltooling/XMLToolingConfig.h>
293 #include <xmltooling/version.h>]],
294 [[#if _XMLTOOLING_VERSION >= 10400
295 xmltooling::XMLToolingConfig::getConfig();
297 #error Need XMLTooling version 1.4 or higher
299 ,[AC_MSG_ERROR([unable to link with XMLTooling, or version was too old])])
301 # restore master libs
304 # Establish location of xmltooling catalog.
306 if test "x$with_xmltooling" = "x" ; then
307 with_xmltooling="/usr"
309 if test -f $with_xmltooling/share/xml/xmltooling/catalog.xml ; then
310 XMLTOOLINGXMLDIR="$with_xmltooling"
311 elif test -f $with_xerces/share/xml/xmltooling/catalog.xml ; then
312 XMLTOOLINGXMLDIR="$with_xerces"
313 elif test -f $with_log4shib/share/xml/xmltooling/catalog.xml ; then
314 XMLTOOLINGXMLDIR="$with_log4shib"
316 if test "x$XMLTOOLINGXMLDIR" = "x" ; then
317 AC_MSG_ERROR([xmltooling XML catalog not found, may need to use --with-xmltooling option])
319 XMLTOOLINGXMLDIR="$XMLTOOLINGXMLDIR/share/xml/xmltooling"
320 AC_SUBST(XMLTOOLINGXMLDIR)
324 AS_HELP_STRING([--with-saml=PATH],[where saml is installed]),
325 [if test x_$with_saml != x_/usr; then
326 LDFLAGS="-L${with_saml}/lib $LDFLAGS"
327 CPPFLAGS="-I${with_saml}/include $CPPFLAGS"
328 DX_INCLUDE="$DX_INCLUDE ${with_saml}/include"
330 XMLSEC_LIBS="-lsaml $XMLSEC_LIBS"
332 # save and append master libs
334 LIBS="$XMLSEC_LIBS $LIBS"
336 AC_CHECK_HEADER([saml/saml2/metadata/Metadata.h],,AC_MSG_ERROR([unable to find OpenSAML header files]))
338 [AC_LANG_PROGRAM([[#include <saml/SAMLConfig.h>
339 #include <saml/version.h>]],
340 [[#if _OPENSAML_VERSION >= 20400
341 opensaml::SAMLConfig::getConfig();
343 #error Need OpenSAML version 2.4 or higher
345 ,[AC_MSG_ERROR([unable to link with OpenSAML, or version was too old])
348 # restore master libs
351 # Establish location of opensaml catalogs.
353 if test "x$with_saml" = "x" ; then
356 if test -f $with_saml/share/xml/opensaml/saml20-catalog.xml ; then
357 OPENSAMLXMLDIR="$with_saml"
358 elif test -f $with_xmltooling/share/xml/opensaml/saml20-catalog.xml ; then
359 OPENSAMLXMLDIR="$with_xmltooling"
360 elif test -f $with_xerces/share/xml/opensaml/saml20-catalog.xml ; then
361 OPENSAMLXMLDIR="$with_xerces"
362 elif test -f $with_log4shib/share/xml/opensaml/saml20-catalog.xml ; then
363 OPENSAMLXMLDIR="$with_log4shib"
365 if test "x$OPENSAMLXMLDIR" = "x" ; then
366 AC_MSG_ERROR([opensaml XML catalogs not found, may need to use --with-saml option])
368 OPENSAMLXMLDIR="$OPENSAMLXMLDIR/share/xml/opensaml"
369 AC_SUBST(OPENSAMLXMLDIR)
372 AC_SUBST(XMLSEC_LIBS)
374 # output the underlying makefiles
375 WANT_SUBDIRS="doc schemas configs shibsp plugins shibd util"
376 AC_CONFIG_FILES([Makefile doc/Makefile schemas/Makefile \
377 configs/Makefile shibsp/Makefile plugins/Makefile \
378 shibd/Makefile util/Makefile selinux/Makefile])
381 AC_CONFIG_FILES([adfs/Makefile])
382 AC_ARG_ENABLE([adfs],
383 AS_HELP_STRING([--disable-adfs],[don't build the ADFS module]),
384 [adfs_enabled=$enableval], [adfs_enabled=yes])
385 if test "x$adfs_enabled" = "x" ; then
388 AC_MSG_CHECKING(whether to build the ADFS module)
389 if test "$adfs_enabled" = "no" ; then
393 WANT_SUBDIRS="$WANT_SUBDIRS adfs"
398 # Build NSAPI module?
400 AC_MSG_CHECKING(for NSAPI module option)
402 AS_HELP_STRING([--with-nsapi=DIR],[Build NSAPI module for Netscape/iPlanet/SunONE]),
403 [WANT_NSAPI=$withval],[WANT_NSAPI=no])
404 AC_MSG_RESULT($WANT_NSAPI)
406 if test "$WANT_NSAPI" != "no"; then
407 if test ! -d $WANT_NSAPI/bin ; then
408 AC_MSG_ERROR([Please specify the path to the root of your Netscape/iPlanet/SunONE server using --with-nsapi=DIR])
410 AC_MSG_CHECKING(for NSAPI include files)
411 if test -d $WANT_NSAPI/include ; then
412 NSAPI_INCLUDE=$WANT_NSAPI/include
413 AC_MSG_RESULT(Netscape-Enterprise 3.x style)
414 AC_CHECK_HEADERS([$NSAPI_INCLUDE/nsapi.h],,,[#define XP_UNIX])
415 NSAPI_INCLUDE="$NSAPI_INC_DIR -I$NSAPI_INCLUDE"
417 if test -d $WANT_NSAPI/plugins/include ; then
418 test -n "$NSAPI_INCLUDE" && NSAPI_INC_DIR="-I$NSAPI_INCLUDE"
419 NSAPI_INCLUDE="$WANT_NSAPI/plugins/include"
420 AC_MSG_RESULT(iPlanet 4.x / SunONE 6.x style)
421 AC_CHECK_HEADERS([$NSAPI_INCLUDE/nsapi.h],,,[#define XP_UNIX])
422 NSAPI_INCLUDE="$NSAPI_INC_DIR -I$NSAPI_INCLUDE"
424 if test "$NSAPI_INCLUDE" = ""; then
425 AC_MSG_ERROR([Please check you have nsapi.h in either $WANT_NSAPI/include or $WANT_NSAPI/plugins/include])
429 AC_SUBST(NSAPI_INCLUDE)
431 # always output the Makefile, even if you don't use it
432 AC_CONFIG_FILES([nsapi_shib/Makefile])
433 AM_CONDITIONAL(BUILD_NSAPI,test ! "$WANT_NSAPI" = "no")
435 # add the NSAPI module to the list of wanted subdirs..
436 if test ! "$WANT_NSAPI" = "no" ; then
437 WANT_SUBDIRS="$WANT_SUBDIRS nsapi_shib"
442 # Build FastCGI support?
444 AC_MSG_CHECKING(for FastCGI support)
446 AS_HELP_STRING([--with-fastcgi=DIR],[Build FastCGI support]),
447 [WANT_FASTCGI=$withval],[WANT_FASTCGI=no])
448 AC_MSG_RESULT($WANT_FASTCGI)
450 if test "$WANT_FASTCGI" != "no"; then
451 if test "$WANT_FASTCGI" != "yes"; then
452 if test x_$WANT_FASTCGI != x_/usr; then
453 FASTCGI_INCLUDE="-I$WANT_FASTCGI/include"
454 FASTCGI_LDFLAGS="-L$WANT_FASTCGI/lib"
457 AC_CHECK_HEADER([fcgio.h],,AC_MSG_ERROR([unable to find FastCGI header files]))
458 FASTCGI_LIBS="-lfcgi -lfcgi++"
461 AC_SUBST(FASTCGI_INCLUDE)
462 AC_SUBST(FASTCGI_LDFLAGS)
463 AC_SUBST(FASTCGI_LIBS)
465 # always output the Makefile, even if you don't use it
466 AC_CONFIG_FILES([fastcgi/Makefile])
467 AM_CONDITIONAL(BUILD_FASTCGI,test ! "$WANT_FASTCGI" = "no")
469 if test ! "$WANT_FASTCGI" = "no" ; then
470 WANT_SUBDIRS="$WANT_SUBDIRS fastcgi"
474 # Build Memcached support?
476 AC_MSG_CHECKING(for Memcached support)
477 AC_ARG_WITH(memcached,
478 AS_HELP_STRING([--with-memcached=DIR],[Build Memcached support]),
479 [WANT_MEMCACHED=$withval],[WANT_MEMCACHED=no])
480 AC_MSG_RESULT($WANT_MEMCACHED)
482 if test "$WANT_MEMCACHED" != "no"; then
483 if test "$WANT_MEMCACHED" != "yes"; then
484 if test x_$WANT_MEMCACHED != x_/usr; then
485 MEMCACHED_INCLUDE="-I$WANT_MEMCACHED/include"
486 MEMCACHED_LDFLAGS="-L$WANT_MEMCACHED/lib"
489 AC_CHECK_HEADER([libmemcached/memcached.h],,
490 AC_MSG_ERROR([unable to find Memcached header files]))
491 MEMCACHED_LIBS="-lmemcached"
494 AC_SUBST(MEMCACHED_INCLUDE)
495 AC_SUBST(MEMCACHED_LDFLAGS)
496 AC_SUBST(MEMCACHED_LIBS)
498 # always output the Makefile, even if you don't use it
499 AC_CONFIG_FILES([memcache-store/Makefile])
500 AM_CONDITIONAL(BUILD_MEMCACHED,test ! "$WANT_MEMCACHED" = "no")
502 if test ! "$WANT_MEMCACHED" = "no" ; then
503 WANT_SUBDIRS="$WANT_SUBDIRS memcache-store"
508 # If no --enable-apache-xx specified
509 # find a default and fake the specific parameters
512 # simple macro to peek at an enable or a with
514 if test "[${[$1]_][$2]+set}" = set; then
515 peekval="${[$1]_[$2]}"
520 AC_MSG_CHECKING(if default apache needed)
522 Peek(enable,apache_13,need_default=no)
523 Peek(enable,apache_20,need_default=no)
524 Peek(enable,apache_22,need_default=no)
525 AC_MSG_RESULT($need_default)
527 if test "$need_default" = "yes"; then
528 # find an apxs, then the httpd
530 Peek(with,apxs,xs="$peekval")
531 Peek(with,apxs2,xs="$peekval")
532 Peek(with,apxs22,xs="$peekval")
533 if test "x$xs" = "x"; then
534 AC_PATH_PROGS(xs, apxs2 apxs,
535 AC_MSG_ERROR(No apxs, no apache found. Try --with-apxs),
536 [/usr/local/apache2/bin:/usr/local/apache/bin:/usr/sbin:$PATH])
538 # ask the daemon for the version and set parameters
539 AC_MSG_CHECKING(default apache version)
540 httpd="`$xs -q SBINDIR`/`$xs -q TARGET`"
541 if test "x$httpd" != "x" && test -f $httpd ; then
542 v=`$httpd -v|$SED -n -e 's/.*Apache\/\.*//p'`
544 1.3*) [enable_apache_13]=yes
548 2.0*) [enable_apache_20]=yes
552 2.2*) [enable_apache_22]=yes
556 *) AC_MSG_ERROR(unusable apache versions: $v. Try setting --with-apxs)
559 AC_MSG_RESULT(cannot determine version. Try setting --with-apxs)
563 # Apache 1.3 (mod_shib_13)
565 # --with-apxs (DSO build, the normal way, uses apxs to derive build flags)
567 AC_ARG_ENABLE(apache-13,
568 AS_HELP_STRING([--enable-apache-13],[enable the Apache 1.3 module]),
569 [if test "x$enableval" = "x" ; then
572 WANT_APACHE_13="$enableval"
574 ],[ WANT_APACHE_13=no ])
575 AC_MSG_CHECKING(whether to build Apache 1.3 module)
576 if test "$WANT_APACHE_13" != yes && test "$WANT_APACHE_13" != no ; then
579 AC_MSG_RESULT($WANT_APACHE_13)
581 if test "$WANT_APACHE_13" = "yes" ; then
583 AS_HELP_STRING([--with-apxs=FILE],[Specifies where to find the Apache 1.3 apxs script.]),
585 AC_MSG_CHECKING(for user-specified apxs name/location)
586 if test "$withval" != "no" ; then
587 if test "$withval" != "yes"; then
589 AC_MSG_RESULT("$withval")
594 AC_PATH_PROG(APXS, apxs, no)
595 if test "$APXS" = "no" ; then
596 for i in /usr/sbin /usr/local/apache/bin ; do
597 if test "$APXS" = "no" && test -f "$i/apxs"; then
604 AC_MSG_CHECKING([to see if apxs was located])
605 if test ! -f "$APXS" ; then
607 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.])
612 # extract settings we need from APXS -q
613 APXS_CC="`$APXS -q CC`"
614 APXS_CFLAGS="`$APXS -q CFLAGS` `$APXS -q CFLAGS_SHLIB`"
615 APXS_INCLUDE="`$APXS -q INCLUDEDIR`"
618 AC_SUBST(APXS_CFLAGS)
619 AC_SUBST(APXS_INCLUDE)
622 # Apache 2.0 (mod_shib_20)
624 # --with-apxs2 (DSO build, the normal way, uses apxs to derive build flags)
625 # --with-apr (DSO build, APR development package installed separately)
626 # --with-apu (DSO build, APR-UTIL development package installed separately)
628 AC_ARG_ENABLE(apache-20,
629 AS_HELP_STRING([--enable-apache-20],[enable the Apache 2.0 module]),
630 [if test "x$enableval" = "x" ; then
633 WANT_APACHE_20="$enableval"
635 ],[ WANT_APACHE_20=no ])
636 AC_MSG_CHECKING(whether to build Apache 2.0 module)
637 if test "$WANT_APACHE_20" != yes && test "$WANT_APACHE_20" != no ; then
640 AC_MSG_RESULT($WANT_APACHE_20)
642 if test "$WANT_APACHE_20" = "yes" ; then
644 AS_HELP_STRING([--with-apxs2=FILE],[Specifies where to find the Apache 2.0 apxs script.]),
646 AC_MSG_CHECKING(for user-specified Apache2 apxs name/location)
647 if test "$withval" != "no" ; then
648 if test "$withval" != "yes"; then
650 AC_MSG_RESULT("$withval")
655 AC_PATH_PROG(APXS2, apxs2, no)
656 if test "$APXS2" = "no" ; then
657 AC_PATH_PROG(APXS2, apxs, no)
659 if test "$APXS2" = "no" ; then
660 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
661 if test "$APXS2" = "no" && test -f "$i/apxs2" ; then
665 if test "$APXS2" = "no" ; then
666 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
667 if test "$APXS2" = "no" && test -f "$i/apxs" ; then
675 AC_MSG_CHECKING([to see if Apache2 apxs was located])
676 if test ! -f "$APXS2" ; then
678 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.])
680 AC_MSG_RESULT($APXS2)
685 AS_HELP_STRING([--with-apr=PATH],[where apr-config is installed]),
687 AC_MSG_CHECKING(for user-specified apr-config name/location)
688 if test "$withval" != "no" ; then
689 if test "$withval" != "yes"; then
691 AC_MSG_RESULT("$withval")
696 AC_PATH_PROG(APR_CONFIG, apr-config,,[`$APXS2 -q SBINDIR`]:[$PATH])
698 if test -f "${APR_CONFIG}"; then
699 APR_CFLAGS="`${APR_CONFIG} --cflags` `${APR_CONFIG} --cppflags` `${APR_CONFIG} --includes`"
701 AC_MSG_ERROR([Unable to locate apr-config, may need --with-apr option.])
706 AS_HELP_STRING([--with-apu=PATH],[where apu-config is installed]),
708 AC_MSG_CHECKING(for user-specified apu-config name/location)
709 if test "$withval" != "no" ; then
710 if test "$withval" != "yes"; then
712 AC_MSG_RESULT("$withval")
717 AC_PATH_PROG(APU_CONFIG, apu-config,,[`$APXS2 -q SBINDIR`]:[$PATH])
719 if test -f "${APU_CONFIG}"; then
720 APU_CFLAGS="`${APU_CONFIG} --includes`"
722 AC_MSG_ERROR([Unable to locate apu-config, may need --with-apu option.])
725 # extract settings we need from APXS2 -q
726 APXS2_CC="`$APXS2 -q CC`"
727 APXS2_CFLAGS="`$APXS2 -q CPPFLAGS` `$APXS2 -q CFLAGS` $APR_CFLAGS $APU_CFLAGS"
728 APXS2_INCLUDE="`$APXS2 -q INCLUDEDIR`"
731 AC_SUBST(APXS2_CFLAGS)
732 AC_SUBST(APXS2_INCLUDE)
735 # Apache 2.2 (mod_shib_22)
737 # --with-apxs22 (DSO build, the normal way, uses apxs to derive build flags)
738 # --with-apr1 (DSO build, APR development package installed separately)
739 # --with-apu1 (DSO build, APR-UTIL development package installed separately)
741 AC_ARG_ENABLE(apache-22,
742 AS_HELP_STRING([--enable-apache-22],[enable the Apache 2.2 module]),
743 [if test "x$enableval" = "x" ; then
746 WANT_APACHE_22="$enableval"
748 ],[ WANT_APACHE_22=no ])
749 AC_MSG_CHECKING(whether to build Apache 2.2 module)
750 if test "$WANT_APACHE_22" != yes && test "$WANT_APACHE_22" != no ; then
753 AC_MSG_RESULT($WANT_APACHE_22)
755 if test "$WANT_APACHE_22" = "yes" ; then
757 AS_HELP_STRING([--with-apxs22=FILE],[Specifies where to find the Apache 2.2 apxs script.]),
759 AC_MSG_CHECKING(for user-specified Apache2.2 apxs name/location)
760 if test "$withval" != "no" ; then
761 if test "$withval" != "yes"; then
763 AC_MSG_RESULT("$withval")
768 AC_PATH_PROG(APXS22, apxs2, no)
769 if test "$APXS22" = "no" ; then
770 AC_PATH_PROG(APXS22, apxs, no)
772 if test "$APXS22" = "no" ; then
773 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
774 if test "$APXS22" = "no" && test -f "$i/apxs2" ; then
778 if test "$APXS22" = "no" ; then
779 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
780 if test "$APXS22" = "no" && test -f "$i/apxs" ; then
788 AC_MSG_CHECKING([to see if Apache2.2 apxs was located])
789 if test ! -f "$APXS22" ; then
791 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.])
793 AC_MSG_RESULT($APXS22)
798 AS_HELP_STRING([--with-apr1=PATH],[where apr-1-config is installed]),
800 AC_MSG_CHECKING(for user-specified apr-1-config name/location)
801 if test "$withval" != "no" ; then
802 if test "$withval" != "yes"; then
804 AC_MSG_RESULT("$withval")
809 AC_PATH_PROG(APR1_CONFIG, apr-1-config,,[`$APXS22 -q SBINDIR`]:[$PATH])
811 if test -f "${APR1_CONFIG}"; then
812 APR1_CFLAGS="`${APR1_CONFIG} --cflags` `${APR1_CONFIG} --cppflags` `${APR1_CONFIG} --includes`"
814 AC_MSG_ERROR([Unable to locate apr-1-config, may need --with-apr1 option.])
819 AS_HELP_STRING([--with-apu1=PATH],[where apu-1-config is installed]),
821 AC_MSG_CHECKING(for user-specified apu-1-config name/location)
822 if test "$withval" != "no" ; then
823 if test "$withval" != "yes"; then
825 AC_MSG_RESULT("$withval")
830 AC_PATH_PROG(APU1_CONFIG, apu-1-config,,[`$APXS22 -q SBINDIR`]:[$PATH])
832 if test -f "${APU1_CONFIG}"; then
833 APU1_CFLAGS="`${APU1_CONFIG} --includes`"
835 AC_MSG_ERROR([Unable to locate apu-1-config, may need --with-apu1 option.])
838 # extract settings we need from APXS22 -q
839 APXS22_CC="`$APXS22 -q CC`"
840 APXS22_CFLAGS="`$APXS22 -q CPPFLAGS` `$APXS22 -q CFLAGS` $APR1_CFLAGS $APU1_CFLAGS"
841 APXS22_INCLUDE="`$APXS22 -q INCLUDEDIR`"
844 AC_SUBST(APXS22_CFLAGS)
845 AC_SUBST(APXS22_INCLUDE)
847 # always output the Makefile, even if you don't use it
848 AC_CONFIG_FILES([apache/Makefile])
849 AM_CONDITIONAL(BUILD_AP13,test "$WANT_APACHE_13" = "yes")
850 AM_CONDITIONAL(BUILD_AP20,test "$WANT_APACHE_20" = "yes")
851 AM_CONDITIONAL(BUILD_AP22,test "$WANT_APACHE_22" = "yes")
853 # add the apache module to the list of wanted subdirs..
854 if test "$WANT_APACHE_13" = "yes" || test "$WANT_APACHE_20" = "yes" || test "$WANT_APACHE_22" = "yes" ; then
855 WANT_SUBDIRS="$WANT_SUBDIRS apache"
860 # Implement the checks of the ODBC Storage Service
862 # 1) Assume the user wants ODBC; if it's not found then just continue without
863 # 2) If the user specifically requested odbc, look for it and ERROR if not found
864 # 3) If the user specifically requested no odbc, don't build it.
867 AC_CONFIG_FILES([odbc-store/Makefile])
869 # determine whether we should enable the odbc ccache
870 AC_ARG_ENABLE([odbc],
871 AS_HELP_STRING([--disable-odbc],[disable the ODBC Storage Service]),
872 [odbc_enabled=$enableval], [odbc_enabled=default])
873 if test "x$odbc_enabled" = "x" ; then
877 # Are we trying to build ODBC?
878 AC_MSG_CHECKING(whether to build the ODBC storage service)
879 if test "$odbc_enabled" = "yes" ; then
882 elif test "$odbc_enabled" = "default" ; then
884 AC_MSG_RESULT([yes, if it can be found])
890 # If we're trying to build ODBC, try to find the odbc_config program.
891 if test "$build_odbc" = "yes" ; then
894 AS_HELP_STRING([--with-odbc=PATH],[directory where odbc is installed]),
895 [if test "$with_odbc" = no ; then
896 AC_MSG_ERROR([Try running --disable-odbc instead.])
897 elif test "$with_odbc" != yes ; then
898 odbc_dir="$with_odbc/bin"
899 if test "$with_odbc" != /usr ; then
900 ODBC_CFLAGS="-I$with_odbc/include"
901 ODBC_LIBS="-L$with_odbc/lib"
905 AC_PATH_PROG(ODBC_CONFIG, odbc_config, no, $odbc_dir $PATH )
906 if test "$ODBC_CONFIG" = no ; then
907 AC_MSG_WARN([Cannot find odbc_config, will try to guess settings.])
908 ODBC_LIBS="$ODBC_LIBS -lodbc"
910 ODBC_CFLAGS=`$ODBC_CONFIG --cflags`
911 ODBC_LIBS=`$ODBC_CONFIG --libs`
914 save_CPPFLAGS="$CPPFLAGS"
915 CPPFLAGS="$CPPFLAGS $ODBC_CFLAGS"
917 AC_CHECK_HEADER([sql.h], [have_sql_h=yes], [have_sql_h=no])
918 if test "$have_sql_h" = no -a "$odbc_enabled" = "yes" ; then
919 AC_MSG_ERROR(unable to find ODBC header files)
922 if test "$have_sql_h" = yes ; then
924 LIBS="$LIBS $ODBC_LIBS"
925 AC_MSG_CHECKING(if we can link againt ODBC)
927 [AC_LANG_PROGRAM([[#include <sql.h>
929 #include <stdio.h>]],
930 [[SQLSetEnvAttr(SQL_NULL_HANDLE, SQL_ATTR_CONNECTION_POOLING, (void*)SQL_CP_ONE_PER_HENV, 0)]])],
931 [have_odbc_libs=yes],[have_odbc_libs=no])
933 if test "$have_odbc_libs" = no ; then
934 if test "$odbc_enabled" = "yes" ; then
935 AC_MSG_ERROR([unable to link with ODBC Library])
937 AC_MSG_RESULT([no, skipping ODBC])
942 CPPFLAGS="$save_CPPFLAGS"
945 # if have_odbc_libs=yes then go ahead with building ODBC
946 if test "$have_odbc_libs" = yes ; then
947 # this AC_MSG_RESULT is from above!
949 WANT_SUBDIRS="$WANT_SUBDIRS odbc-store"
950 AC_SUBST(ODBC_CFLAGS)
957 AC_ARG_WITH(gssapi-includes,
958 AS_HELP_STRING([--with-gssapi-includes=DIR],[Specify location of GSSAPI header]),
959 [ GSSAPI_INCS="-I$withval"
963 AC_ARG_WITH(gssapi-libs,
964 AS_HELP_STRING([--with-gssapi-libs=DIR],[Specify location of GSSAPI libs]),
965 [ GSSAPI_LIB_DIR="-L$withval"
970 AS_HELP_STRING([--with-gssapi=DIR],[Where to look for GSSAPI]),
971 [ GSSAPI_ROOT="$withval"
972 if test x"$GSSAPI_ROOT" != xno; then
974 if test x"$GSSAPI_ROOT" = xyes; then
975 dnl if yes, then use default root
981 save_CPPFLAGS="$CPPFLAGS"
982 AC_MSG_CHECKING([if GSSAPI support is requested])
983 if test x"$want_gss" = xyes; then
986 if test -z "$GSSAPI_INCS"; then
987 if test -f "$GSSAPI_ROOT/bin/krb5-config"; then
988 GSSAPI_INCS=`$GSSAPI_ROOT/bin/krb5-config --cflags gssapi`
989 elif test "$GSSAPI_ROOT" != "yes"; then
990 GSSAPI_INCS="-I$GSSAPI_ROOT/include"
994 CPPFLAGS="$CPPFLAGS $GSSAPI_INCS"
996 AC_CHECK_HEADER(gss.h,
998 dnl found in the given dirs
999 AC_DEFINE([SHIBSP_HAVE_GSSGNU],[1],[if you have the GNU gssapi libraries])
1003 dnl not found, check Heimdal or MIT
1004 AC_CHECK_HEADERS([gssapi/gssapi.h], [], [not_mit=1])
1006 [gssapi/gssapi_generic.h gssapi/gssapi_krb5.h],
1011 #ifdef HAVE_GSSAPI_GSSAPI_H
1012 #include <gssapi/gssapi.h>
1015 if test "x$not_mit" = "x1"; then
1016 dnl MIT not found, check for Heimdal
1017 AC_CHECK_HEADER([gssapi.h],
1020 AC_DEFINE([SHIBSP_HAVE_GSSHEIMDAL],[1],[if you have the Heimdal gssapi libraries])
1023 dnl no header found, disabling GSS
1025 AC_MSG_WARN([disabling GSSAPI since no header files was found])
1030 AC_DEFINE([SHIBSP_HAVE_GSSMIT],[1],[if you have the MIT gssapi libraries])
1031 dnl check if we have a really old MIT kerberos (<= 1.2)
1032 AC_MSG_CHECKING([if gssapi headers declare GSS_C_NT_HOSTBASED_SERVICE])
1035 #include <gssapi/gssapi.h>
1036 #include <gssapi/gssapi_generic.h>
1037 #include <gssapi/gssapi_krb5.h>
1042 GSS_C_NT_HOSTBASED_SERVICE,
1046 AC_MSG_RESULT([yes])
1049 AC_DEFINE([HAVE_OLD_GSSMIT],[1],[if you have an old MIT gssapi library, lacking GSS_C_NT_HOSTBASED_SERVICE])
1057 if test x"$want_gss" = xyes; then
1058 AC_DEFINE([SHIBSP_HAVE_GSSAPI],[1],[if you have the gssapi libraries])
1060 if test -n "$gnu_gss"; then
1061 LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
1064 if test -z "$GSSAPI_LIB_DIR"; then
1065 GSSAPI_LIB_DIR="$GSSAPI_ROOT/lib$libsuff"
1067 if test "$GSSAPI_ROOT" != "yes"; then
1068 LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff"
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`
1075 if test "x$not_mit" = "x1"; then
1078 gss_libs="-lgssapi_krb5"
1081 LIBS="$LIBS $gss_libs"
1084 AC_MSG_CHECKING([whether GSS-API naming extensions are available])
1086 [AC_LANG_PROGRAM([[#include <gssapi/gssapi_ext.h>]],
1087 [[gss_get_name_attribute(NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);]])],
1088 [AC_MSG_RESULT([yes])AC_DEFINE([HAVE_GSSAPI_NAMINGEXTS],[1],[Define to 1 if GSS-API naming extensions are available.])],
1089 [AC_MSG_RESULT([no])])
1092 CPPFLAGS="$save_CPPFLAGS"
1096 AC_SUBST(WANT_SUBDIRS)
1098 if test -n "$APXS_CC" && test "$APXS_CC" != "$CC" ; then
1099 echo "=================================================================="
1100 echo "WARNING: You have chosen to compile Apache-1.3 modules with a different"
1101 echo " compiler than the one used to compile Apache."
1103 echo " Current compiler: $CC"
1104 echo " Apache's compiler: $APXS_CC"
1106 echo "This could cause problems."
1107 echo "=================================================================="
1110 if test -n "$APXS2_CC" && test "$APXS2_CC" != "$CC" ; then
1111 echo "=================================================================="
1112 echo "WARNING: You have chosen to compile Apache-2.0 modules with a different"
1113 echo " compiler than the one used to compile Apache."
1115 echo " Current compiler: $CC"
1116 echo " Apache's compiler: $APXS2_CC"
1118 echo "This could cause problems."
1119 echo "=================================================================="
1122 if test -n "$APXS22_CC" && test "$APXS22_CC" != "$CC" ; then
1123 echo "=================================================================="
1124 echo "WARNING: You have chosen to compile Apache-2.2 modules with a different"
1125 echo " compiler than the one used to compile Apache."
1127 echo " Current compiler: $CC"
1128 echo " Apache's compiler: $APXS22_CC"
1130 echo "This could cause problems."
1131 echo "=================================================================="
1134 LIBTOOL="$LIBTOOL --silent"