2 AC_INIT([shibboleth],[2.5],[https://issues.shibboleth.net/],[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])
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"
53 # Fix for Sun Workshop compiler in debug mode, may be Sun case #6360993
54 # Also enables POSIX semantics for some functions.
55 case "${host_cpu}-${host_os}" in
57 CFLAGS="$CFLAGS -D_POSIX_PTHREAD_SEMANTICS"
58 CXXFLAGS="$CXXFLAGS -D_POSIX_PTHREAD_SEMANTICS"
59 if test "$CXX" = "CC" ; then
60 CXXFLAGS="$CXXFLAGS -Qoption ccfe -stabs=no%dfltlit+no%dflthlp"
64 CXXFLAGS="$CXXFLAGS -D_POSIX_PII_SOCKET"
70 # Checks for typedefs, structures, and compiler characteristics.
75 # Checks for library functions.
78 AC_CHECK_HEADERS([sys/utsname.h grp.h pwd.h])
79 AC_CHECK_HEADERS([sys/socket.h], [AC_DEFINE([SHIBSP_HAVE_SYS_SOCKET_H],[1],[Define to 1 if you have the <sys/socket> header file.])], [])
80 AC_CHECK_FUNCS([strchr strdup strstr timegm gmtime_r strtok_r strcasecmp getpwnam getgrnam])
81 AC_CHECK_TYPES([struct sockaddr_storage], [], [], [[#include <sys/socket.h>]])
84 ACX_PTHREAD([enable_threads="pthread"],[enable_threads="no"])
85 if test $enable_threads != "pthread"; then
86 AC_MSG_ERROR([unable to find pthreads, currently this is required])
88 AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])
89 LIBS="$PTHREAD_LIBS $LIBS"
90 CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
91 CXXFLAGS="$PTHREAD_CFLAGS $CXXFLAGS"
96 AS_HELP_STRING([--with-openssl=PATH],[where openssl is installed]),
97 [if test x_$with_openssl != x_/usr; then
98 SSLFLAGS="-I${with_openssl}/include"
101 if test "x$with_openssl" = "x" ; then
102 AC_PATH_PROG(PKG_CONFIG, pkg-config)
103 if test "x$PKG_CONFIG" != x && test "x$PKG_CONFIG" != "xno" ; then
104 if pkg-config openssl ; then
105 SSLFLAGS="`$PKG_CONFIG --cflags openssl`"
107 AC_MSG_WARN([OpenSSL not supported by pkg-config, try --with-openssl instead])
112 AC_MSG_CHECKING(for OpenSSL cflags)
113 AC_MSG_RESULT($SSLFLAGS)
114 CPPFLAGS="$SSLFLAGS $CPPFLAGS"
116 AC_CHECK_HEADER([openssl/x509.h],,AC_MSG_ERROR([unable to find openssl header files]))
124 # Thank you Solaris, really.
125 AC_MSG_CHECKING(for ctime_r)
126 if test -z "$ac_cv_ctime_args"; then
128 [AC_LANG_PROGRAM([[#include <time.h>]], [[time_t clock; char buf[26]; ctime_r(&clock, buf);]])],
129 [ac_cv_ctime_args=2],[])
132 [AC_LANG_PROGRAM([[#include <time.h>]], [[time_t clock; char buf[26]; ctime_r(&clock, buf, 26);]])],
133 [ac_cv_ctime_args=3],[])
135 if test -z "$ac_cv_ctime_args"; then
138 if test "$ac_cv_ctime_args" = 2; then
139 AC_DEFINE([HAVE_CTIME_R_2],[1],[Define if ctime_r is present with 2 parameters.])
140 elif test "$ac_cv_ctime_args" = 3; then
141 AC_DEFINE([HAVE_CTIME_R_3],[1],[Define if ctime_r is present with 3 parameters.])
143 AC_MSG_RESULT([yes, and it takes $ac_cv_ctime_args arguments])
146 # log4shib settings (favor this version over the log4cpp code)
147 AC_PATH_PROG(LOG4SHIB_CONFIG,log4shib-config)
148 AC_ARG_WITH(log4shib,
149 AS_HELP_STRING([--with-log4shib=PATH],[where log4shib-config is installed]),
151 LOG4SHIB_CONFIG="${with_log4shib}"
152 if ! test -f "${LOG4SHIB_CONFIG}"; then
153 LOG4SHIB_CONFIG="${with_log4shib}/bin/log4shib-config"
156 if test -f "${LOG4SHIB_CONFIG}" ; then
157 LIBS="`${LOG4SHIB_CONFIG} --libs` $LIBS"
158 CPPFLAGS="`${LOG4SHIB_CONFIG} --cflags` $CPPFLAGS"
159 AC_CHECK_HEADER([log4shib/CategoryStream.hh],,AC_MSG_ERROR([unable to find log4shib header files]))
161 [AC_LANG_PROGRAM([[#include <log4shib/Category.hh>
162 #include <log4shib/CategoryStream.hh>]],
163 [[log4shib::Category::getInstance("foo").errorStream() << log4shib::eol]])],
164 [AC_DEFINE([SHIBSP_LOG4SHIB],[1],[Define to 1 if log4shib library is used.])],
165 [AC_MSG_ERROR([unable to link with log4shib])])
167 AC_MSG_WARN([log4shib-config not found, may need to use --with-log4shib option])
168 AC_MSG_WARN([will look for original log4cpp library])
171 AC_PATH_PROG(LOG4CPP_CONFIG,log4cpp-config)
173 AS_HELP_STRING([--with-log4cpp=PATH],[where log4cpp-config is installed]),
175 LOG4CPP_CONFIG="${with_log4cpp}"
176 if ! test -f "${LOG4CPP_CONFIG}"; then
177 LOG4CPP_CONFIG="${with_log4cpp}/bin/log4cpp-config"
180 if test -f "${LOG4CPP_CONFIG}"; then
181 AC_MSG_WARN([will try to use log4cpp, note that most non-Internet2 supplied versions are not thread-safe])
182 LIBS="`${LOG4CPP_CONFIG} --libs` $LIBS"
183 CPPFLAGS="`${LOG4CPP_CONFIG} --cflags` $CPPFLAGS"
184 AC_CHECK_HEADER([log4cpp/CategoryStream.hh],,AC_MSG_ERROR([unable to find log4cpp header files]))
186 [AC_LANG_PROGRAM([[#include <log4cpp/Category.hh>
187 #include <log4cpp/CategoryStream.hh>]],
188 [[log4cpp::Category::getInstance("foo").errorStream() << log4cpp::eol]])],
189 [AC_DEFINE([SHIBSP_LOG4CPP],[1],[Define to 1 if log4cpp library is used.])],
190 [AC_MSG_ERROR([unable to link with log4cpp, need version 1.0 or later])])
192 AC_MSG_ERROR([log4cpp-config not found, may need to use --with-log4cpp option])
198 AS_HELP_STRING([--with-xerces=PATH],[where xerces-c is installed]),,
200 if test x_$with_xerces != x_/usr; then
201 CPPFLAGS="-I${with_xerces}/include $CPPFLAGS"
202 LIBS="-L${with_xerces}/lib -lxerces-c $LIBS"
204 LIBS="-lxerces-c $LIBS"
207 AC_CHECK_HEADER([xercesc/dom/DOM.hpp],,AC_MSG_ERROR([unable to find xerces header files]))
208 AC_MSG_CHECKING([Xerces version])
210 [AC_LANG_PROGRAM([#include <xercesc/util/XercesVersion.hpp>],
211 [#if _XERCES_VERSION >= 20700
214 #error version 2.7.0 or above required
217 [AC_MSG_FAILURE([Xerces-C v2.7.0 or higher is required, v3.x preferred])])
219 [AC_LANG_PROGRAM([[#include <xercesc/util/PlatformUtils.hpp>]],[[xercesc::XMLPlatformUtils::Initialize()]])],
220 ,[AC_MSG_ERROR([unable to link with Xerces])])
222 AC_MSG_CHECKING([whether Xerces XMLString::release(XMLByte**) exists])
224 [AC_LANG_PROGRAM([[#include <xercesc/util/XMLString.hpp>]],
225 [[using namespace XERCES_CPP_NAMESPACE; XMLByte* buf=NULL; XMLString::release(&buf);]])],
226 [AC_MSG_RESULT([yes])AC_DEFINE([SHIBSP_XERCESC_HAS_XMLBYTE_RELEASE],[1],[Define to 1 if Xerces XMLString includes XMLByte release.])],
227 [AC_MSG_RESULT([no])])
229 AC_MSG_CHECKING([whether Xerces DOMNodeFilter API returns a short])
231 [AC_LANG_PROGRAM([[#include <xercesc/dom/DOM.hpp>]],
232 [[using namespace XERCES_CPP_NAMESPACE;
233 class Blocker : public DOMNodeFilter {
235 short acceptNode(const DOMNode* node) const {
236 return FILTER_REJECT;
239 static Blocker g_Blocker;
241 [AC_MSG_RESULT([yes])AC_DEFINE([SHIBSP_XERCESC_SHORT_ACCEPTNODE],[1],[Define to 1 if Xerces DOMNodeFilter API returns a short.])],
242 [AC_MSG_RESULT([no])])
244 # XML-Security settings
246 AS_HELP_STRING([--with-xmlsec=PATH],[where xmlsec is installed]),,
248 if test x_$with_xmlsec != x_/usr; then
249 CPPFLAGS="-I${with_xmlsec}/include $CPPFLAGS"
250 XMLSEC_LIBS="-L${with_xmlsec}/lib -lxml-security-c $XMLSEC_LIBS"
252 XMLSEC_LIBS="-lxml-security-c $XMLSEC_LIBS"
255 # save and append master libs
257 LIBS="$XMLSEC_LIBS $LIBS"
259 AC_CHECK_HEADER([xsec/utils/XSECPlatformUtils.hpp],,AC_MSG_ERROR([unable to find XML-Security-C header files]))
260 AC_MSG_CHECKING([XML-Security-C version])
262 [AC_LANG_PROGRAM([#include <xsec/utils/XSECPlatformUtils.hpp>],
263 [#if XSEC_VERSION_MAJOR > 1 || (XSEC_VERSION_MAJOR == 1 && XSEC_VERSION_MEDIUM > 3)
266 #error need version 1.4.0 or later
269 [AC_MSG_FAILURE([XML-Security-C version 1.4.0 or greater is required.])])
271 [AC_LANG_PROGRAM([[#include <xsec/utils/XSECPlatformUtils.hpp>]],
272 [[XSECPlatformUtils::Initialise()]])],,
273 [AC_MSG_ERROR([unable to link with XML-Security])])
275 AC_MSG_CHECKING([whether XML-Security-C supports white/blacklisting of algorithms])
276 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <xsec/framework/XSECAlgorithmMapper.hpp>]], [[XSECAlgorithmMapper* mapper; mapper->whitelistAlgorithm(NULL);]])],[AC_MSG_RESULT([yes])
277 AC_DEFINE([SHIBSP_XMLSEC_WHITELISTING],[1],[Define to 1 if XML-Security-C supports white/blacklisting algorithms.])],[AC_MSG_RESULT([no])])
279 # restore master libs
282 #XML-Tooling settings
283 AC_ARG_WITH(xmltooling,
284 AS_HELP_STRING([--with-xmltooling=PATH],[where xmltooling is installed]),,
285 [with_xmltooling=/usr])
286 if test x_$with_xmltooling != x_/usr; then
287 CPPFLAGS="-I${with_xmltooling}/include $CPPFLAGS"
288 DX_INCLUDE="${with_xmltooling}/include"
289 LITE_LIBS="-L${with_xmltooling}/lib -lxmltooling-lite"
290 XMLSEC_LIBS="-L${with_xmltooling}/lib -lxmltooling $XMLSEC_LIBS"
292 LITE_LIBS="-lxmltooling-lite"
293 XMLSEC_LIBS="-lxmltooling $XMLSEC_LIBS"
296 AC_CHECK_HEADER([xmltooling/base.h],,AC_MSG_ERROR([unable to find xmltooling header files]))
298 # save and append master libs
300 LIBS="$XMLSEC_LIBS $LIBS"
303 [AC_LANG_PROGRAM([[#include <xmltooling/XMLToolingConfig.h>
304 #include <xmltooling/version.h>]],
305 [[#if _XMLTOOLING_VERSION >= 10500
306 xmltooling::XMLToolingConfig::getConfig();
308 #error Need XMLTooling version 1.5 or higher
310 ,[AC_MSG_ERROR([unable to link with XMLTooling, or version was too old])])
312 # restore master libs
315 # Establish location of xmltooling catalog.
317 if test "x$with_xmltooling" = "x" ; then
318 with_xmltooling="/usr"
320 if test -f $with_xmltooling/share/xml/xmltooling/catalog.xml ; then
321 XMLTOOLINGXMLDIR="$with_xmltooling"
322 elif test -f $with_xerces/share/xml/xmltooling/catalog.xml ; then
323 XMLTOOLINGXMLDIR="$with_xerces"
324 elif test -f $with_log4shib/share/xml/xmltooling/catalog.xml ; then
325 XMLTOOLINGXMLDIR="$with_log4shib"
327 if test "x$XMLTOOLINGXMLDIR" = "x" ; then
328 AC_MSG_ERROR([xmltooling XML catalog not found, may need to use --with-xmltooling option])
330 XMLTOOLINGXMLDIR="$XMLTOOLINGXMLDIR/share/xml/xmltooling"
331 AC_SUBST(XMLTOOLINGXMLDIR)
335 AS_HELP_STRING([--with-saml=PATH],[where opensaml is installed]),,
337 if test x_$with_xmltooling != x_/usr; then
338 CPPFLAGS="-I${with_saml}/include $CPPFLAGS"
339 DX_INCLUDE="$DX_INCLUDE ${with_saml}/include"
340 XMLSEC_LIBS="-L${with_saml}/lib -lsaml $XMLSEC_LIBS"
342 XMLSEC_LIBS="-lsaml $XMLSEC_LIBS"
345 # save and append master libs
347 LIBS="$XMLSEC_LIBS $LIBS"
349 AC_CHECK_HEADER([saml/saml2/metadata/Metadata.h],,AC_MSG_ERROR([unable to find OpenSAML header files]))
351 [AC_LANG_PROGRAM([[#include <saml/SAMLConfig.h>
352 #include <saml/version.h>]],
353 [[#if _OPENSAML_VERSION >= 20500
354 opensaml::SAMLConfig::getConfig();
356 #error Need OpenSAML version 2.5 or higher
358 ,[AC_MSG_ERROR([unable to link with OpenSAML, or version was too old])
361 # restore master libs
364 # Establish location of opensaml catalogs.
366 if test "x$with_saml" = "x" ; then
369 if test -f $with_saml/share/xml/opensaml/saml20-catalog.xml ; then
370 OPENSAMLXMLDIR="$with_saml"
371 elif test -f $with_xmltooling/share/xml/opensaml/saml20-catalog.xml ; then
372 OPENSAMLXMLDIR="$with_xmltooling"
373 elif test -f $with_xerces/share/xml/opensaml/saml20-catalog.xml ; then
374 OPENSAMLXMLDIR="$with_xerces"
375 elif test -f $with_log4shib/share/xml/opensaml/saml20-catalog.xml ; then
376 OPENSAMLXMLDIR="$with_log4shib"
378 if test "x$OPENSAMLXMLDIR" = "x" ; then
379 AC_MSG_ERROR([opensaml XML catalogs not found, may need to use --with-saml option])
381 OPENSAMLXMLDIR="$OPENSAMLXMLDIR/share/xml/opensaml"
382 AC_SUBST(OPENSAMLXMLDIR)
385 AC_SUBST(XMLSEC_LIBS)
387 # output the underlying makefiles
388 WANT_SUBDIRS="doc schemas configs shibsp plugins shibd util"
389 AC_CONFIG_FILES([Makefile doc/Makefile schemas/Makefile \
390 configs/Makefile shibsp/Makefile plugins/Makefile \
391 shibd/Makefile util/Makefile selinux/Makefile])
394 AC_CONFIG_FILES([adfs/Makefile])
395 AC_ARG_ENABLE([adfs],
396 AS_HELP_STRING([--disable-adfs],[don't build the ADFS module]),
397 [adfs_enabled=$enableval], [adfs_enabled=yes])
398 if test "x$adfs_enabled" = "x" ; then
401 AC_MSG_CHECKING(whether to build the ADFS module)
402 if test "$adfs_enabled" = "no" ; then
406 WANT_SUBDIRS="$WANT_SUBDIRS adfs"
411 # Build NSAPI module?
413 AC_MSG_CHECKING(for NSAPI module option)
415 AS_HELP_STRING([--with-nsapi=DIR],[Build NSAPI module for Netscape/iPlanet/SunONE]),
416 [WANT_NSAPI=$withval],[WANT_NSAPI=no])
417 AC_MSG_RESULT($WANT_NSAPI)
419 if test "$WANT_NSAPI" != "no"; then
420 if test ! -d $WANT_NSAPI/bin ; then
421 AC_MSG_ERROR([Please specify the path to the root of your Netscape/iPlanet/SunONE server using --with-nsapi=DIR])
423 AC_MSG_CHECKING(for NSAPI include files)
424 if test -d $WANT_NSAPI/include ; then
425 NSAPI_INCLUDE=$WANT_NSAPI/include
426 AC_MSG_RESULT(Netscape-Enterprise 3.x style)
427 AC_CHECK_HEADERS([$NSAPI_INCLUDE/nsapi.h],,,[#define XP_UNIX])
428 NSAPI_INCLUDE="$NSAPI_INC_DIR -I$NSAPI_INCLUDE"
430 if test -d $WANT_NSAPI/plugins/include ; then
431 test -n "$NSAPI_INCLUDE" && NSAPI_INC_DIR="-I$NSAPI_INCLUDE"
432 NSAPI_INCLUDE="$WANT_NSAPI/plugins/include"
433 AC_MSG_RESULT(iPlanet 4.x / SunONE 6.x style)
434 AC_CHECK_HEADERS([$NSAPI_INCLUDE/nsapi.h],,,[#define XP_UNIX])
435 NSAPI_INCLUDE="$NSAPI_INC_DIR -I$NSAPI_INCLUDE"
437 if test "$NSAPI_INCLUDE" = ""; then
438 AC_MSG_ERROR([Please check you have nsapi.h in either $WANT_NSAPI/include or $WANT_NSAPI/plugins/include])
442 AC_SUBST(NSAPI_INCLUDE)
444 # always output the Makefile, even if you don't use it
445 AC_CONFIG_FILES([nsapi_shib/Makefile])
446 AM_CONDITIONAL(BUILD_NSAPI,test ! "$WANT_NSAPI" = "no")
448 # add the NSAPI module to the list of wanted subdirs..
449 if test ! "$WANT_NSAPI" = "no" ; then
450 WANT_SUBDIRS="$WANT_SUBDIRS nsapi_shib"
455 # Build FastCGI support?
457 AC_MSG_CHECKING(for FastCGI support)
459 AS_HELP_STRING([--with-fastcgi=DIR],[Build FastCGI support]),
460 [WANT_FASTCGI=$withval],[WANT_FASTCGI=no])
461 AC_MSG_RESULT($WANT_FASTCGI)
463 if test "$WANT_FASTCGI" != "no"; then
464 if test "$WANT_FASTCGI" != "yes"; then
465 if test x_$WANT_FASTCGI != x_/usr; then
466 FASTCGI_INCLUDE="-I$WANT_FASTCGI/include"
467 FASTCGI_LDFLAGS="-L$WANT_FASTCGI/lib"
470 AC_CHECK_HEADER([fcgio.h],,AC_MSG_ERROR([unable to find FastCGI header files]))
471 FASTCGI_LIBS="-lfcgi -lfcgi++"
474 AC_SUBST(FASTCGI_INCLUDE)
475 AC_SUBST(FASTCGI_LDFLAGS)
476 AC_SUBST(FASTCGI_LIBS)
478 # always output the Makefile, even if you don't use it
479 AC_CONFIG_FILES([fastcgi/Makefile])
480 AM_CONDITIONAL(BUILD_FASTCGI,test ! "$WANT_FASTCGI" = "no")
482 if test ! "$WANT_FASTCGI" = "no" ; then
483 WANT_SUBDIRS="$WANT_SUBDIRS fastcgi"
487 # Build Memcached support?
489 AC_MSG_CHECKING(for Memcached support)
490 AC_ARG_WITH(memcached,
491 AS_HELP_STRING([--with-memcached=DIR],[Build Memcached support]),
492 [WANT_MEMCACHED=$withval],[WANT_MEMCACHED=no])
493 AC_MSG_RESULT($WANT_MEMCACHED)
495 if test "$WANT_MEMCACHED" != "no"; then
496 if test "$WANT_MEMCACHED" != "yes"; then
497 if test x_$WANT_MEMCACHED != x_/usr; then
498 MEMCACHED_INCLUDE="-I$WANT_MEMCACHED/include"
499 MEMCACHED_LDFLAGS="-L$WANT_MEMCACHED/lib"
502 AC_CHECK_HEADER([libmemcached/memcached.h],,
503 AC_MSG_ERROR([unable to find Memcached header files]))
504 MEMCACHED_LIBS="-lmemcached"
507 AC_SUBST(MEMCACHED_INCLUDE)
508 AC_SUBST(MEMCACHED_LDFLAGS)
509 AC_SUBST(MEMCACHED_LIBS)
511 # always output the Makefile, even if you don't use it
512 AC_CONFIG_FILES([memcache-store/Makefile])
513 AM_CONDITIONAL(BUILD_MEMCACHED,test ! "$WANT_MEMCACHED" = "no")
515 if test ! "$WANT_MEMCACHED" = "no" ; then
516 WANT_SUBDIRS="$WANT_SUBDIRS memcache-store"
521 # If no --enable-apache-xx specified
522 # find a default and fake the specific parameters
525 # simple macro to peek at an enable or a with
527 if test "[${[$1]_][$2]+set}" = set; then
528 peekval="${[$1]_[$2]}"
533 AC_MSG_CHECKING(if default apache needed)
535 Peek(enable,apache_13,need_default=no)
536 Peek(enable,apache_20,need_default=no)
537 Peek(enable,apache_22,need_default=no)
538 AC_MSG_RESULT($need_default)
540 if test "$need_default" = "yes"; then
541 # find an apxs, then the httpd
543 Peek(with,apxs,xs="$peekval")
544 Peek(with,apxs2,xs="$peekval")
545 Peek(with,apxs22,xs="$peekval")
546 if test "x$xs" = "x"; then
547 AC_PATH_PROGS(xs, apxs2 apxs,
548 AC_MSG_ERROR(No apxs, no apache found. Try --with-apxs),
549 [/usr/local/apache2/bin:/usr/local/apache/bin:/usr/sbin:$PATH])
551 # ask the daemon for the version and set parameters
552 AC_MSG_CHECKING(default apache version)
553 httpd="`$xs -q SBINDIR`/`$xs -q TARGET`"
554 if test "x$httpd" != "x" && test -f $httpd ; then
555 v=`$httpd -v|$SED -n -e 's/.*Apache\/\.*//p'`
557 1.3*) [enable_apache_13]=yes
561 2.0*) [enable_apache_20]=yes
565 2.2*) [enable_apache_22]=yes
569 *) AC_MSG_ERROR(unusable apache versions: $v. Try setting --with-apxs)
572 AC_MSG_RESULT(cannot determine version. Try setting --with-apxs)
576 # Apache 1.3 (mod_shib_13)
578 # --with-apxs (DSO build, the normal way, uses apxs to derive build flags)
580 AC_ARG_ENABLE(apache-13,
581 AS_HELP_STRING([--enable-apache-13],[enable the Apache 1.3 module]),
582 [if test "x$enableval" = "x" ; then
585 WANT_APACHE_13="$enableval"
587 ],[ WANT_APACHE_13=no ])
588 AC_MSG_CHECKING(whether to build Apache 1.3 module)
589 if test "$WANT_APACHE_13" != yes && test "$WANT_APACHE_13" != no ; then
592 AC_MSG_RESULT($WANT_APACHE_13)
594 if test "$WANT_APACHE_13" = "yes" ; then
596 AS_HELP_STRING([--with-apxs=FILE],[Specifies where to find the Apache 1.3 apxs script.]),
598 AC_MSG_CHECKING(for user-specified apxs name/location)
599 if test "$withval" != "no" ; then
600 if test "$withval" != "yes"; then
602 AC_MSG_RESULT("$withval")
607 AC_PATH_PROG(APXS, apxs, no)
608 if test "$APXS" = "no" ; then
609 for i in /usr/sbin /usr/local/apache/bin ; do
610 if test "$APXS" = "no" && test -f "$i/apxs"; then
617 AC_MSG_CHECKING([to see if apxs was located])
618 if test ! -f "$APXS" ; then
620 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.])
625 # extract settings we need from APXS -q
626 APXS_CC="`$APXS -q CC`"
627 APXS_CFLAGS="`$APXS -q CFLAGS` `$APXS -q CFLAGS_SHLIB`"
628 APXS_INCLUDE="`$APXS -q INCLUDEDIR`"
631 AC_SUBST(APXS_CFLAGS)
632 AC_SUBST(APXS_INCLUDE)
635 # Apache 2.0 (mod_shib_20)
637 # --with-apxs2 (DSO build, the normal way, uses apxs to derive build flags)
638 # --with-apr (DSO build, APR development package installed separately)
639 # --with-apu (DSO build, APR-UTIL development package installed separately)
641 AC_ARG_ENABLE(apache-20,
642 AS_HELP_STRING([--enable-apache-20],[enable the Apache 2.0 module]),
643 [if test "x$enableval" = "x" ; then
646 WANT_APACHE_20="$enableval"
648 ],[ WANT_APACHE_20=no ])
649 AC_MSG_CHECKING(whether to build Apache 2.0 module)
650 if test "$WANT_APACHE_20" != yes && test "$WANT_APACHE_20" != no ; then
653 AC_MSG_RESULT($WANT_APACHE_20)
655 if test "$WANT_APACHE_20" = "yes" ; then
657 AS_HELP_STRING([--with-apxs2=FILE],[Specifies where to find the Apache 2.0 apxs script.]),
659 AC_MSG_CHECKING(for user-specified Apache2 apxs name/location)
660 if test "$withval" != "no" ; then
661 if test "$withval" != "yes"; then
663 AC_MSG_RESULT("$withval")
668 AC_PATH_PROG(APXS2, apxs2, no)
669 if test "$APXS2" = "no" ; then
670 AC_PATH_PROG(APXS2, apxs, no)
672 if test "$APXS2" = "no" ; then
673 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
674 if test "$APXS2" = "no" && test -f "$i/apxs2" ; then
678 if test "$APXS2" = "no" ; then
679 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
680 if test "$APXS2" = "no" && test -f "$i/apxs" ; then
688 AC_MSG_CHECKING([to see if Apache2 apxs was located])
689 if test ! -f "$APXS2" ; then
691 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.])
693 AC_MSG_RESULT($APXS2)
698 AS_HELP_STRING([--with-apr=PATH],[where apr-config is installed]),
700 AC_MSG_CHECKING(for user-specified apr-config name/location)
701 if test "$withval" != "no" ; then
702 if test "$withval" != "yes"; then
704 AC_MSG_RESULT("$withval")
709 AC_PATH_PROG(APR_CONFIG, apr-config,,[`$APXS2 -q SBINDIR`]:[$PATH])
711 if test -f "${APR_CONFIG}"; then
712 APR_CFLAGS="`${APR_CONFIG} --cflags` `${APR_CONFIG} --cppflags` `${APR_CONFIG} --includes`"
714 AC_MSG_ERROR([Unable to locate apr-config, may need --with-apr option.])
719 AS_HELP_STRING([--with-apu=PATH],[where apu-config is installed]),
721 AC_MSG_CHECKING(for user-specified apu-config name/location)
722 if test "$withval" != "no" ; then
723 if test "$withval" != "yes"; then
725 AC_MSG_RESULT("$withval")
730 AC_PATH_PROG(APU_CONFIG, apu-config,,[`$APXS2 -q SBINDIR`]:[$PATH])
732 if test -f "${APU_CONFIG}"; then
733 APU_CFLAGS="`${APU_CONFIG} --includes`"
735 AC_MSG_ERROR([Unable to locate apu-config, may need --with-apu option.])
738 # extract settings we need from APXS2 -q
739 APXS2_CC="`$APXS2 -q CC`"
740 APXS2_CFLAGS="`$APXS2 -q CPPFLAGS` `$APXS2 -q CFLAGS` $APR_CFLAGS $APU_CFLAGS"
741 APXS2_INCLUDE="`$APXS2 -q INCLUDEDIR`"
744 AC_SUBST(APXS2_CFLAGS)
745 AC_SUBST(APXS2_INCLUDE)
748 # Apache 2.2 (mod_shib_22)
750 # --with-apxs22 (DSO build, the normal way, uses apxs to derive build flags)
751 # --with-apr1 (DSO build, APR development package installed separately)
752 # --with-apu1 (DSO build, APR-UTIL development package installed separately)
754 AC_ARG_ENABLE(apache-22,
755 AS_HELP_STRING([--enable-apache-22],[enable the Apache 2.2 module]),
756 [if test "x$enableval" = "x" ; then
759 WANT_APACHE_22="$enableval"
761 ],[ WANT_APACHE_22=no ])
762 AC_MSG_CHECKING(whether to build Apache 2.2 module)
763 if test "$WANT_APACHE_22" != yes && test "$WANT_APACHE_22" != no ; then
766 AC_MSG_RESULT($WANT_APACHE_22)
768 if test "$WANT_APACHE_22" = "yes" ; then
770 AS_HELP_STRING([--with-apxs22=FILE],[Specifies where to find the Apache 2.2 apxs script.]),
772 AC_MSG_CHECKING(for user-specified Apache2.2 apxs name/location)
773 if test "$withval" != "no" ; then
774 if test "$withval" != "yes"; then
776 AC_MSG_RESULT("$withval")
781 AC_PATH_PROG(APXS22, apxs2, no)
782 if test "$APXS22" = "no" ; then
783 AC_PATH_PROG(APXS22, apxs, no)
785 if test "$APXS22" = "no" ; then
786 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
787 if test "$APXS22" = "no" && test -f "$i/apxs2" ; then
791 if test "$APXS22" = "no" ; then
792 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
793 if test "$APXS22" = "no" && test -f "$i/apxs" ; then
801 AC_MSG_CHECKING([to see if Apache2.2 apxs was located])
802 if test ! -f "$APXS22" ; then
804 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.])
806 AC_MSG_RESULT($APXS22)
811 AS_HELP_STRING([--with-apr1=PATH],[where apr-1-config is installed]),
813 AC_MSG_CHECKING(for user-specified apr-1-config name/location)
814 if test "$withval" != "no" ; then
815 if test "$withval" != "yes"; then
817 AC_MSG_RESULT("$withval")
822 AC_PATH_PROG(APR1_CONFIG, apr-1-config,,[`$APXS22 -q SBINDIR`]:[$PATH])
824 if test -f "${APR1_CONFIG}"; then
825 APR1_CFLAGS="`${APR1_CONFIG} --cflags` `${APR1_CONFIG} --cppflags` `${APR1_CONFIG} --includes`"
827 AC_MSG_ERROR([Unable to locate apr-1-config, may need --with-apr1 option.])
832 AS_HELP_STRING([--with-apu1=PATH],[where apu-1-config is installed]),
834 AC_MSG_CHECKING(for user-specified apu-1-config name/location)
835 if test "$withval" != "no" ; then
836 if test "$withval" != "yes"; then
838 AC_MSG_RESULT("$withval")
843 AC_PATH_PROG(APU1_CONFIG, apu-1-config,,[`$APXS22 -q SBINDIR`]:[$PATH])
845 if test -f "${APU1_CONFIG}"; then
846 APU1_CFLAGS="`${APU1_CONFIG} --includes`"
848 AC_MSG_ERROR([Unable to locate apu-1-config, may need --with-apu1 option.])
851 # extract settings we need from APXS22 -q
852 APXS22_CC="`$APXS22 -q CC`"
853 APXS22_CFLAGS="`$APXS22 -q CPPFLAGS` `$APXS22 -q CFLAGS` $APR1_CFLAGS $APU1_CFLAGS"
854 APXS22_INCLUDE="`$APXS22 -q INCLUDEDIR`"
857 AC_SUBST(APXS22_CFLAGS)
858 AC_SUBST(APXS22_INCLUDE)
860 # always output the Makefile, even if you don't use it
861 AC_CONFIG_FILES([apache/Makefile])
862 AM_CONDITIONAL(BUILD_AP13,test "$WANT_APACHE_13" = "yes")
863 AM_CONDITIONAL(BUILD_AP20,test "$WANT_APACHE_20" = "yes")
864 AM_CONDITIONAL(BUILD_AP22,test "$WANT_APACHE_22" = "yes")
866 # add the apache module to the list of wanted subdirs..
867 if test "$WANT_APACHE_13" = "yes" || test "$WANT_APACHE_20" = "yes" || test "$WANT_APACHE_22" = "yes" ; then
868 WANT_SUBDIRS="$WANT_SUBDIRS apache"
873 # Implement the checks of the ODBC Storage Service
875 # 1) Assume the user wants ODBC; if it's not found then just continue without
876 # 2) If the user specifically requested odbc, look for it and ERROR if not found
877 # 3) If the user specifically requested no odbc, don't build it.
880 AC_CONFIG_FILES([odbc-store/Makefile])
882 # determine whether we should enable the odbc ccache
883 AC_ARG_ENABLE([odbc],
884 AS_HELP_STRING([--disable-odbc],[disable the ODBC Storage Service]),
885 [odbc_enabled=$enableval], [odbc_enabled=default])
886 if test "x$odbc_enabled" = "x" ; then
890 # Are we trying to build ODBC?
891 AC_MSG_CHECKING(whether to build the ODBC storage service)
892 if test "$odbc_enabled" = "yes" ; then
895 elif test "$odbc_enabled" = "default" ; then
897 AC_MSG_RESULT([yes, if it can be found])
903 # If we're trying to build ODBC, try to find the odbc_config program.
904 if test "$build_odbc" = "yes" ; then
907 AS_HELP_STRING([--with-odbc=PATH],[directory where odbc is installed]),
908 [if test "$with_odbc" = no ; then
909 AC_MSG_ERROR([Try running --disable-odbc instead.])
910 elif test "$with_odbc" != yes ; then
911 odbc_dir="$with_odbc/bin"
912 if test "$with_odbc" != /usr ; then
913 ODBC_CFLAGS="-I$with_odbc/include"
914 ODBC_LIBS="-L$with_odbc/lib"
918 AC_PATH_PROG(ODBC_CONFIG, odbc_config, no, $odbc_dir $PATH )
919 if test "$ODBC_CONFIG" = no ; then
920 AC_MSG_WARN([Cannot find odbc_config, will try to guess settings.])
921 ODBC_LIBS="$ODBC_LIBS -lodbc"
923 ODBC_CFLAGS=`$ODBC_CONFIG --cflags`
924 ODBC_LIBS=`$ODBC_CONFIG --libs`
927 save_CPPFLAGS="$CPPFLAGS"
928 CPPFLAGS="$CPPFLAGS $ODBC_CFLAGS"
930 AC_CHECK_HEADER([sql.h], [have_sql_h=yes], [have_sql_h=no])
931 if test "$have_sql_h" = no -a "$odbc_enabled" = "yes" ; then
932 AC_MSG_ERROR(unable to find ODBC header files)
935 if test "$have_sql_h" = yes ; then
937 LIBS="$LIBS $ODBC_LIBS"
938 AC_MSG_CHECKING(if we can link againt ODBC)
940 [AC_LANG_PROGRAM([[#include <sql.h>
942 #include <stdio.h>]],
943 [[SQLSetEnvAttr(SQL_NULL_HANDLE, SQL_ATTR_CONNECTION_POOLING, (void*)SQL_CP_ONE_PER_HENV, 0)]])],
944 [have_odbc_libs=yes],[have_odbc_libs=no])
946 if test "$have_odbc_libs" = no ; then
947 if test "$odbc_enabled" = "yes" ; then
948 AC_MSG_ERROR([unable to link with ODBC Library])
950 AC_MSG_RESULT([no, skipping ODBC])
955 CPPFLAGS="$save_CPPFLAGS"
958 # if have_odbc_libs=yes then go ahead with building ODBC
959 if test "$have_odbc_libs" = yes ; then
960 # this AC_MSG_RESULT is from above!
962 WANT_SUBDIRS="$WANT_SUBDIRS odbc-store"
963 AC_SUBST(ODBC_CFLAGS)
970 AC_ARG_WITH(gssapi-includes,
971 AS_HELP_STRING([--with-gssapi-includes=DIR],[Specify location of GSSAPI header]),
972 [ GSSAPI_INCS="-I$withval"
976 AC_ARG_WITH(gssapi-libs,
977 AS_HELP_STRING([--with-gssapi-libs=DIR],[Specify location of GSSAPI libs]),
978 [ GSSAPI_LIB_DIR="-L$withval"
983 AS_HELP_STRING([--with-gssapi=DIR],[Where to look for GSSAPI]),
984 [ GSSAPI_ROOT="$withval"
985 if test x"$GSSAPI_ROOT" != xno; then
987 if test x"$GSSAPI_ROOT" = xyes; then
988 dnl if yes, then use default root
994 save_CPPFLAGS="$CPPFLAGS"
995 AC_MSG_CHECKING([if GSSAPI support is requested])
996 if test x"$want_gss" = xyes; then
999 if test -z "$GSSAPI_INCS"; then
1000 if test -f "$GSSAPI_ROOT/bin/krb5-config"; then
1001 GSSAPI_INCS=`$GSSAPI_ROOT/bin/krb5-config --cflags gssapi`
1002 elif test "$GSSAPI_ROOT" != "yes"; then
1003 GSSAPI_INCS="-I$GSSAPI_ROOT/include"
1007 CPPFLAGS="$CPPFLAGS $GSSAPI_INCS"
1009 AC_CHECK_HEADER(gss.h,
1011 dnl found in the given dirs
1012 AC_DEFINE([SHIBSP_HAVE_GSSGNU],[1],[if you have the GNU gssapi libraries])
1016 dnl not found, check Heimdal or MIT
1017 AC_CHECK_HEADERS([gssapi/gssapi.h], [], [not_mit=1])
1019 [gssapi/gssapi_generic.h gssapi/gssapi_krb5.h],
1024 #ifdef HAVE_GSSAPI_GSSAPI_H
1025 #include <gssapi/gssapi.h>
1028 if test "x$not_mit" = "x1"; then
1029 dnl MIT not found, check for Heimdal
1030 AC_CHECK_HEADER([gssapi.h],
1033 AC_DEFINE([SHIBSP_HAVE_GSSHEIMDAL],[1],[if you have the Heimdal gssapi libraries])
1036 dnl no header found, disabling GSS
1038 AC_MSG_WARN([disabling GSSAPI since no header files was found])
1043 AC_DEFINE([SHIBSP_HAVE_GSSMIT],[1],[if you have the MIT gssapi libraries])
1044 dnl check if we have a really old MIT kerberos (<= 1.2)
1045 AC_MSG_CHECKING([if gssapi headers declare GSS_C_NT_HOSTBASED_SERVICE])
1048 #include <gssapi/gssapi.h>
1049 #include <gssapi/gssapi_generic.h>
1050 #include <gssapi/gssapi_krb5.h>
1055 GSS_C_NT_HOSTBASED_SERVICE,
1059 AC_MSG_RESULT([yes])
1062 AC_DEFINE([HAVE_OLD_GSSMIT],[1],[if you have an old MIT gssapi library, lacking GSS_C_NT_HOSTBASED_SERVICE])
1070 if test x"$want_gss" = xyes; then
1071 AC_DEFINE([SHIBSP_HAVE_GSSAPI],[1],[if you have the gssapi libraries])
1073 if test -n "$gnu_gss"; then
1074 LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
1077 if test -z "$GSSAPI_LIB_DIR"; then
1078 GSSAPI_LIB_DIR="$GSSAPI_ROOT/lib$libsuff"
1080 if test "$GSSAPI_ROOT" != "yes"; then
1081 LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff"
1083 if test -f "$GSSAPI_ROOT/bin/krb5-config"; then
1084 dnl krb5-config doesn't have --libs-only-L or similar, put everything
1086 gss_libs=`$GSSAPI_ROOT/bin/krb5-config --libs gssapi`
1088 if test "x$not_mit" = "x1"; then
1091 gss_libs="-lgssapi_krb5"
1094 LIBS="$LIBS $gss_libs"
1097 AC_MSG_CHECKING([whether GSS-API naming extensions are available])
1100 #ifdef SHIBSP_HAVE_GSSGNU
1102 #elif defined SHIBSP_HAVE_GSSMIT
1103 # include <gssapi/gssapi.h>
1104 # include <gssapi/gssapi_ext.h>
1106 # include <gssapi.h>
1108 [[gss_get_name_attribute(NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);]])],
1109 [AC_MSG_RESULT([yes])AC_DEFINE([HAVE_GSSAPI_NAMINGEXTS],[1],[Define to 1 if GSS-API naming extensions are available.])],
1110 [AC_MSG_RESULT([no])])
1112 AC_MSG_CHECKING([whether GSS-API composite name import is available])
1115 #ifdef SHIBSP_HAVE_GSSGNU
1117 #elif defined SHIBSP_HAVE_GSSMIT
1118 # include <gssapi/gssapi.h>
1119 # include <gssapi/gssapi_ext.h>
1121 # include <gssapi.h>
1126 gss_buffer_desc importbuf;
1127 gss_import_name(&minor, &importbuf, GSS_C_NT_EXPORT_NAME_COMPOSITE, &srcname);
1129 [AC_MSG_RESULT([yes])AC_DEFINE([HAVE_GSSAPI_COMPOSITE_NAME],[1],[Define to 1 if GSS-API composite name import is available.])],
1130 [AC_MSG_RESULT([no])])
1133 CPPFLAGS="$save_CPPFLAGS"
1137 AC_SUBST(WANT_SUBDIRS)
1139 if test -n "$APXS_CC" && test "$APXS_CC" != "$CC" ; then
1140 echo "=================================================================="
1141 echo "WARNING: You have chosen to compile Apache-1.3 modules with a different"
1142 echo " compiler than the one used to compile Apache."
1144 echo " Current compiler: $CC"
1145 echo " Apache's compiler: $APXS_CC"
1147 echo "This could cause problems."
1148 echo "=================================================================="
1151 if test -n "$APXS2_CC" && test "$APXS2_CC" != "$CC" ; then
1152 echo "=================================================================="
1153 echo "WARNING: You have chosen to compile Apache-2.0 modules with a different"
1154 echo " compiler than the one used to compile Apache."
1156 echo " Current compiler: $CC"
1157 echo " Apache's compiler: $APXS2_CC"
1159 echo "This could cause problems."
1160 echo "=================================================================="
1163 if test -n "$APXS22_CC" && test "$APXS22_CC" != "$CC" ; then
1164 echo "=================================================================="
1165 echo "WARNING: You have chosen to compile Apache-2.2 modules with a different"
1166 echo " compiler than the one used to compile Apache."
1168 echo " Current compiler: $CC"
1169 echo " Apache's compiler: $APXS22_CC"
1171 echo "This could cause problems."
1172 echo "=================================================================="
1175 LIBTOOL="$LIBTOOL --silent"