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]))
132 CPPFLAGS="$BOOST_CPPFLAGS $CPPFLAGS"
134 # Thank you Solaris, really.
135 AC_MSG_CHECKING(for ctime_r)
136 if test -z "$ac_cv_ctime_args"; then
138 [AC_LANG_PROGRAM([[#include <time.h>]], [[time_t clock; char buf[26]; ctime_r(&clock, buf);]])],
139 [ac_cv_ctime_args=2],[])
142 [AC_LANG_PROGRAM([[#include <time.h>]], [[time_t clock; char buf[26]; ctime_r(&clock, buf, 26);]])],
143 [ac_cv_ctime_args=3],[])
145 if test -z "$ac_cv_ctime_args"; then
148 if test "$ac_cv_ctime_args" = 2; then
149 AC_DEFINE([HAVE_CTIME_R_2],[1],[Define if ctime_r is present with 2 parameters.])
150 elif test "$ac_cv_ctime_args" = 3; then
151 AC_DEFINE([HAVE_CTIME_R_3],[1],[Define if ctime_r is present with 3 parameters.])
153 AC_MSG_RESULT([yes, and it takes $ac_cv_ctime_args arguments])
156 # log4shib settings (favor this version over the log4cpp code)
157 AC_PATH_PROG(LOG4SHIB_CONFIG,log4shib-config)
158 AC_ARG_WITH(log4shib,
159 AS_HELP_STRING([--with-log4shib=PATH],[where log4shib-config is installed]),
161 LOG4SHIB_CONFIG="${with_log4shib}"
162 if ! test -f "${LOG4SHIB_CONFIG}"; then
163 LOG4SHIB_CONFIG="${with_log4shib}/bin/log4shib-config"
166 if test -f "${LOG4SHIB_CONFIG}" ; then
167 LIBS="`${LOG4SHIB_CONFIG} --libs` $LIBS"
168 CPPFLAGS="`${LOG4SHIB_CONFIG} --cflags` $CPPFLAGS"
169 AC_CHECK_HEADER([log4shib/CategoryStream.hh],,AC_MSG_ERROR([unable to find log4shib header files]))
171 [AC_LANG_PROGRAM([[#include <log4shib/Category.hh>
172 #include <log4shib/CategoryStream.hh>]],
173 [[log4shib::Category::getInstance("foo").errorStream() << log4shib::eol]])],
174 [AC_DEFINE([SHIBSP_LOG4SHIB],[1],[Define to 1 if log4shib library is used.])],
175 [AC_MSG_ERROR([unable to link with log4shib])])
177 AC_MSG_WARN([log4shib-config not found, may need to use --with-log4shib option])
178 AC_MSG_WARN([will look for original log4cpp library])
181 AC_PATH_PROG(LOG4CPP_CONFIG,log4cpp-config)
183 AS_HELP_STRING([--with-log4cpp=PATH],[where log4cpp-config is installed]),
185 LOG4CPP_CONFIG="${with_log4cpp}"
186 if ! test -f "${LOG4CPP_CONFIG}"; then
187 LOG4CPP_CONFIG="${with_log4cpp}/bin/log4cpp-config"
190 if test -f "${LOG4CPP_CONFIG}"; then
191 AC_MSG_WARN([will try to use log4cpp, note that most non-Internet2 supplied versions are not thread-safe])
192 LIBS="`${LOG4CPP_CONFIG} --libs` $LIBS"
193 CPPFLAGS="`${LOG4CPP_CONFIG} --cflags` $CPPFLAGS"
194 AC_CHECK_HEADER([log4cpp/CategoryStream.hh],,AC_MSG_ERROR([unable to find log4cpp header files]))
196 [AC_LANG_PROGRAM([[#include <log4cpp/Category.hh>
197 #include <log4cpp/CategoryStream.hh>]],
198 [[log4cpp::Category::getInstance("foo").errorStream() << log4cpp::eol]])],
199 [AC_DEFINE([SHIBSP_LOG4CPP],[1],[Define to 1 if log4cpp library is used.])],
200 [AC_MSG_ERROR([unable to link with log4cpp, need version 1.0 or later])])
202 AC_MSG_ERROR([log4cpp-config not found, may need to use --with-log4cpp option])
208 AS_HELP_STRING([--with-xerces=PATH],[where xerces-c is installed]),,
210 if test x_$with_xerces != x_/usr; then
211 CPPFLAGS="-I${with_xerces}/include $CPPFLAGS"
212 LIBS="-L${with_xerces}/lib -lxerces-c $LIBS"
214 LIBS="-lxerces-c $LIBS"
217 AC_CHECK_HEADER([xercesc/dom/DOM.hpp],,AC_MSG_ERROR([unable to find xerces header files]))
218 AC_MSG_CHECKING([Xerces version])
220 [AC_LANG_PROGRAM([#include <xercesc/util/XercesVersion.hpp>],
221 [#if _XERCES_VERSION >= 20700
224 #error version 2.7.0 or above required
227 [AC_MSG_FAILURE([Xerces-C v2.7.0 or higher is required, v3.x preferred])])
229 [AC_LANG_PROGRAM([[#include <xercesc/util/PlatformUtils.hpp>]],[[xercesc::XMLPlatformUtils::Initialize()]])],
230 ,[AC_MSG_ERROR([unable to link with Xerces])])
232 AC_MSG_CHECKING([whether Xerces XMLString::release(XMLByte**) exists])
234 [AC_LANG_PROGRAM([[#include <xercesc/util/XMLString.hpp>]],
235 [[using namespace XERCES_CPP_NAMESPACE; XMLByte* buf=NULL; XMLString::release(&buf);]])],
236 [AC_MSG_RESULT([yes])AC_DEFINE([SHIBSP_XERCESC_HAS_XMLBYTE_RELEASE],[1],[Define to 1 if Xerces XMLString includes XMLByte release.])],
237 [AC_MSG_RESULT([no])])
239 AC_MSG_CHECKING([whether Xerces DOMNodeFilter API returns a short])
241 [AC_LANG_PROGRAM([[#include <xercesc/dom/DOM.hpp>]],
242 [[using namespace XERCES_CPP_NAMESPACE;
243 class Blocker : public DOMNodeFilter {
245 short acceptNode(const DOMNode* node) const {
246 return FILTER_REJECT;
249 static Blocker g_Blocker;
251 [AC_MSG_RESULT([yes])AC_DEFINE([SHIBSP_XERCESC_SHORT_ACCEPTNODE],[1],[Define to 1 if Xerces DOMNodeFilter API returns a short.])],
252 [AC_MSG_RESULT([no])])
254 # XML-Security settings
256 AS_HELP_STRING([--with-xmlsec=PATH],[where xmlsec is installed]),,
258 if test x_$with_xmlsec != x_/usr; then
259 CPPFLAGS="-I${with_xmlsec}/include $CPPFLAGS"
260 XMLSEC_LIBS="-L${with_xmlsec}/lib -lxml-security-c $XMLSEC_LIBS"
262 XMLSEC_LIBS="-lxml-security-c $XMLSEC_LIBS"
265 # save and append master libs
267 LIBS="$XMLSEC_LIBS $LIBS"
269 AC_CHECK_HEADER([xsec/utils/XSECPlatformUtils.hpp],,AC_MSG_ERROR([unable to find XML-Security-C header files]))
270 AC_MSG_CHECKING([XML-Security-C version])
272 [AC_LANG_PROGRAM([#include <xsec/utils/XSECPlatformUtils.hpp>],
273 [#if XSEC_VERSION_MAJOR > 1 || (XSEC_VERSION_MAJOR == 1 && XSEC_VERSION_MEDIUM > 3)
276 #error need version 1.4.0 or later
279 [AC_MSG_FAILURE([XML-Security-C version 1.4.0 or greater is required.])])
281 [AC_LANG_PROGRAM([[#include <xsec/utils/XSECPlatformUtils.hpp>]],
282 [[XSECPlatformUtils::Initialise()]])],,
283 [AC_MSG_ERROR([unable to link with XML-Security])])
285 AC_MSG_CHECKING([whether XML-Security-C supports white/blacklisting of algorithms])
286 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <xsec/framework/XSECAlgorithmMapper.hpp>]], [[XSECAlgorithmMapper* mapper; mapper->whitelistAlgorithm(NULL);]])],[AC_MSG_RESULT([yes])
287 AC_DEFINE([SHIBSP_XMLSEC_WHITELISTING],[1],[Define to 1 if XML-Security-C supports white/blacklisting algorithms.])],[AC_MSG_RESULT([no])])
289 # restore master libs
292 #XML-Tooling settings
293 AC_ARG_WITH(xmltooling,
294 AS_HELP_STRING([--with-xmltooling=PATH],[where xmltooling is installed]),,
295 [with_xmltooling=/usr])
296 if test x_$with_xmltooling != x_/usr; then
297 CPPFLAGS="-I${with_xmltooling}/include $CPPFLAGS"
298 DX_INCLUDE="${with_xmltooling}/include"
299 LITE_LIBS="-L${with_xmltooling}/lib -lxmltooling-lite"
300 XMLSEC_LIBS="-L${with_xmltooling}/lib -lxmltooling $XMLSEC_LIBS"
302 LITE_LIBS="-lxmltooling-lite"
303 XMLSEC_LIBS="-lxmltooling $XMLSEC_LIBS"
306 AC_CHECK_HEADER([xmltooling/base.h],,AC_MSG_ERROR([unable to find xmltooling header files]))
308 # save and append master libs
310 LIBS="$XMLSEC_LIBS $LIBS"
313 [AC_LANG_PROGRAM([[#include <xmltooling/XMLToolingConfig.h>
314 #include <xmltooling/version.h>]],
315 [[#if _XMLTOOLING_VERSION >= 10500
316 xmltooling::XMLToolingConfig::getConfig();
318 #error Need XMLTooling version 1.5 or higher
320 ,[AC_MSG_ERROR([unable to link with XMLTooling, or version was too old])])
322 # restore master libs
325 # Establish location of xmltooling catalog.
327 if test "x$with_xmltooling" = "x" ; then
328 with_xmltooling="/usr"
330 if test -f $with_xmltooling/share/xml/xmltooling/catalog.xml ; then
331 XMLTOOLINGXMLDIR="$with_xmltooling"
332 elif test -f $with_xerces/share/xml/xmltooling/catalog.xml ; then
333 XMLTOOLINGXMLDIR="$with_xerces"
334 elif test -f $with_log4shib/share/xml/xmltooling/catalog.xml ; then
335 XMLTOOLINGXMLDIR="$with_log4shib"
337 if test "x$XMLTOOLINGXMLDIR" = "x" ; then
338 AC_MSG_ERROR([xmltooling XML catalog not found, may need to use --with-xmltooling option])
340 XMLTOOLINGXMLDIR="$XMLTOOLINGXMLDIR/share/xml/xmltooling"
341 AC_SUBST(XMLTOOLINGXMLDIR)
345 AS_HELP_STRING([--with-saml=PATH],[where opensaml is installed]),,
347 if test x_$with_xmltooling != x_/usr; then
348 CPPFLAGS="-I${with_saml}/include $CPPFLAGS"
349 DX_INCLUDE="$DX_INCLUDE ${with_saml}/include"
350 XMLSEC_LIBS="-L${with_saml}/lib -lsaml $XMLSEC_LIBS"
352 XMLSEC_LIBS="-lsaml $XMLSEC_LIBS"
355 # save and append master libs
357 LIBS="$XMLSEC_LIBS $LIBS"
359 AC_CHECK_HEADER([saml/saml2/metadata/Metadata.h],,AC_MSG_ERROR([unable to find OpenSAML header files]))
361 [AC_LANG_PROGRAM([[#include <saml/SAMLConfig.h>
362 #include <saml/version.h>]],
363 [[#if _OPENSAML_VERSION >= 20500
364 opensaml::SAMLConfig::getConfig();
366 #error Need OpenSAML version 2.5 or higher
368 ,[AC_MSG_ERROR([unable to link with OpenSAML, or version was too old])
371 # restore master libs
374 # Establish location of opensaml catalogs.
376 if test "x$with_saml" = "x" ; then
379 if test -f $with_saml/share/xml/opensaml/saml20-catalog.xml ; then
380 OPENSAMLXMLDIR="$with_saml"
381 elif test -f $with_xmltooling/share/xml/opensaml/saml20-catalog.xml ; then
382 OPENSAMLXMLDIR="$with_xmltooling"
383 elif test -f $with_xerces/share/xml/opensaml/saml20-catalog.xml ; then
384 OPENSAMLXMLDIR="$with_xerces"
385 elif test -f $with_log4shib/share/xml/opensaml/saml20-catalog.xml ; then
386 OPENSAMLXMLDIR="$with_log4shib"
388 if test "x$OPENSAMLXMLDIR" = "x" ; then
389 AC_MSG_ERROR([opensaml XML catalogs not found, may need to use --with-saml option])
391 OPENSAMLXMLDIR="$OPENSAMLXMLDIR/share/xml/opensaml"
392 AC_SUBST(OPENSAMLXMLDIR)
395 AC_SUBST(XMLSEC_LIBS)
397 # output the underlying makefiles
398 WANT_SUBDIRS="doc schemas configs shibsp plugins shibd util"
399 AC_CONFIG_FILES([Makefile doc/Makefile schemas/Makefile \
400 configs/Makefile shibsp/Makefile plugins/Makefile \
401 shibd/Makefile util/Makefile selinux/Makefile])
404 AC_CONFIG_FILES([adfs/Makefile])
405 AC_ARG_ENABLE([adfs],
406 AS_HELP_STRING([--disable-adfs],[don't build the ADFS module]),
407 [adfs_enabled=$enableval], [adfs_enabled=yes])
408 if test "x$adfs_enabled" = "x" ; then
411 AC_MSG_CHECKING(whether to build the ADFS module)
412 if test "$adfs_enabled" = "no" ; then
416 WANT_SUBDIRS="$WANT_SUBDIRS adfs"
421 # Build NSAPI module?
423 AC_MSG_CHECKING(for NSAPI module option)
425 AS_HELP_STRING([--with-nsapi=DIR],[Build NSAPI module for Netscape/iPlanet/SunONE]),
426 [WANT_NSAPI=$withval],[WANT_NSAPI=no])
427 AC_MSG_RESULT($WANT_NSAPI)
429 if test "$WANT_NSAPI" != "no"; then
430 if test ! -d $WANT_NSAPI/bin ; then
431 AC_MSG_ERROR([Please specify the path to the root of your Netscape/iPlanet/SunONE server using --with-nsapi=DIR])
433 AC_MSG_CHECKING(for NSAPI include files)
434 if test -d $WANT_NSAPI/include ; then
435 NSAPI_INCLUDE=$WANT_NSAPI/include
436 AC_MSG_RESULT(Netscape-Enterprise 3.x style)
437 AC_CHECK_HEADERS([$NSAPI_INCLUDE/nsapi.h],,,[#define XP_UNIX])
438 NSAPI_INCLUDE="$NSAPI_INC_DIR -I$NSAPI_INCLUDE"
440 if test -d $WANT_NSAPI/plugins/include ; then
441 test -n "$NSAPI_INCLUDE" && NSAPI_INC_DIR="-I$NSAPI_INCLUDE"
442 NSAPI_INCLUDE="$WANT_NSAPI/plugins/include"
443 AC_MSG_RESULT(iPlanet 4.x / SunONE 6.x style)
444 AC_CHECK_HEADERS([$NSAPI_INCLUDE/nsapi.h],,,[#define XP_UNIX])
445 NSAPI_INCLUDE="$NSAPI_INC_DIR -I$NSAPI_INCLUDE"
447 if test "$NSAPI_INCLUDE" = ""; then
448 AC_MSG_ERROR([Please check you have nsapi.h in either $WANT_NSAPI/include or $WANT_NSAPI/plugins/include])
452 AC_SUBST(NSAPI_INCLUDE)
454 # always output the Makefile, even if you don't use it
455 AC_CONFIG_FILES([nsapi_shib/Makefile])
456 AM_CONDITIONAL(BUILD_NSAPI,test ! "$WANT_NSAPI" = "no")
458 # add the NSAPI module to the list of wanted subdirs..
459 if test ! "$WANT_NSAPI" = "no" ; then
460 WANT_SUBDIRS="$WANT_SUBDIRS nsapi_shib"
465 # Build FastCGI support?
467 AC_MSG_CHECKING(for FastCGI support)
469 AS_HELP_STRING([--with-fastcgi=DIR],[Build FastCGI support]),
470 [WANT_FASTCGI=$withval],[WANT_FASTCGI=no])
471 AC_MSG_RESULT($WANT_FASTCGI)
473 if test "$WANT_FASTCGI" != "no"; then
474 if test "$WANT_FASTCGI" != "yes"; then
475 if test x_$WANT_FASTCGI != x_/usr; then
476 FASTCGI_INCLUDE="-I$WANT_FASTCGI/include"
477 FASTCGI_LDFLAGS="-L$WANT_FASTCGI/lib"
480 AC_CHECK_HEADER([fcgio.h],,AC_MSG_ERROR([unable to find FastCGI header files]))
481 FASTCGI_LIBS="-lfcgi -lfcgi++"
484 AC_SUBST(FASTCGI_INCLUDE)
485 AC_SUBST(FASTCGI_LDFLAGS)
486 AC_SUBST(FASTCGI_LIBS)
488 # always output the Makefile, even if you don't use it
489 AC_CONFIG_FILES([fastcgi/Makefile])
490 AM_CONDITIONAL(BUILD_FASTCGI,test ! "$WANT_FASTCGI" = "no")
492 if test ! "$WANT_FASTCGI" = "no" ; then
493 WANT_SUBDIRS="$WANT_SUBDIRS fastcgi"
497 # Build Memcached support?
499 AC_MSG_CHECKING(for Memcached support)
500 AC_ARG_WITH(memcached,
501 AS_HELP_STRING([--with-memcached=DIR],[Build Memcached support]),
502 [WANT_MEMCACHED=$withval],[WANT_MEMCACHED=no])
503 AC_MSG_RESULT($WANT_MEMCACHED)
505 if test "$WANT_MEMCACHED" != "no"; then
506 if test "$WANT_MEMCACHED" != "yes"; then
507 if test x_$WANT_MEMCACHED != x_/usr; then
508 MEMCACHED_INCLUDE="-I$WANT_MEMCACHED/include"
509 MEMCACHED_LDFLAGS="-L$WANT_MEMCACHED/lib"
512 AC_CHECK_HEADER([libmemcached/memcached.h],,
513 AC_MSG_ERROR([unable to find Memcached header files]))
514 MEMCACHED_LIBS="-lmemcached"
517 AC_SUBST(MEMCACHED_INCLUDE)
518 AC_SUBST(MEMCACHED_LDFLAGS)
519 AC_SUBST(MEMCACHED_LIBS)
521 # always output the Makefile, even if you don't use it
522 AC_CONFIG_FILES([memcache-store/Makefile])
523 AM_CONDITIONAL(BUILD_MEMCACHED,test ! "$WANT_MEMCACHED" = "no")
525 if test ! "$WANT_MEMCACHED" = "no" ; then
526 WANT_SUBDIRS="$WANT_SUBDIRS memcache-store"
531 # If no --enable-apache-xx specified
532 # find a default and fake the specific parameters
535 # simple macro to peek at an enable or a with
537 if test "[${[$1]_][$2]+set}" = set; then
538 peekval="${[$1]_[$2]}"
543 AC_MSG_CHECKING(if default apache needed)
545 Peek(enable,apache_13,need_default=no)
546 Peek(enable,apache_20,need_default=no)
547 Peek(enable,apache_22,need_default=no)
548 AC_MSG_RESULT($need_default)
550 if test "$need_default" = "yes"; then
551 # find an apxs, then the httpd
553 Peek(with,apxs,xs="$peekval")
554 Peek(with,apxs2,xs="$peekval")
555 Peek(with,apxs22,xs="$peekval")
556 if test "x$xs" = "x"; then
557 AC_PATH_PROGS(xs, apxs2 apxs,
558 AC_MSG_ERROR(No apxs, no apache found. Try --with-apxs),
559 [/usr/local/apache2/bin:/usr/local/apache/bin:/usr/sbin:$PATH])
561 # ask the daemon for the version and set parameters
562 AC_MSG_CHECKING(default apache version)
563 httpd="`$xs -q SBINDIR`/`$xs -q TARGET`"
564 if test "x$httpd" != "x" && test -f $httpd ; then
565 v=`$httpd -v|$SED -n -e 's/.*Apache\/\.*//p'`
567 1.3*) [enable_apache_13]=yes
571 2.0*) [enable_apache_20]=yes
575 2.2*) [enable_apache_22]=yes
579 *) AC_MSG_ERROR(unusable apache versions: $v. Try setting --with-apxs)
582 AC_MSG_RESULT(cannot determine version. Try setting --with-apxs)
586 # Apache 1.3 (mod_shib_13)
588 # --with-apxs (DSO build, the normal way, uses apxs to derive build flags)
590 AC_ARG_ENABLE(apache-13,
591 AS_HELP_STRING([--enable-apache-13],[enable the Apache 1.3 module]),
592 [if test "x$enableval" = "x" ; then
595 WANT_APACHE_13="$enableval"
597 ],[ WANT_APACHE_13=no ])
598 AC_MSG_CHECKING(whether to build Apache 1.3 module)
599 if test "$WANT_APACHE_13" != yes && test "$WANT_APACHE_13" != no ; then
602 AC_MSG_RESULT($WANT_APACHE_13)
604 if test "$WANT_APACHE_13" = "yes" ; then
606 AS_HELP_STRING([--with-apxs=FILE],[Specifies where to find the Apache 1.3 apxs script.]),
608 AC_MSG_CHECKING(for user-specified apxs name/location)
609 if test "$withval" != "no" ; then
610 if test "$withval" != "yes"; then
612 AC_MSG_RESULT("$withval")
617 AC_PATH_PROG(APXS, apxs, no)
618 if test "$APXS" = "no" ; then
619 for i in /usr/sbin /usr/local/apache/bin ; do
620 if test "$APXS" = "no" && test -f "$i/apxs"; then
627 AC_MSG_CHECKING([to see if apxs was located])
628 if test ! -f "$APXS" ; then
630 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.])
635 # extract settings we need from APXS -q
636 APXS_CC="`$APXS -q CC`"
637 APXS_CFLAGS="`$APXS -q CFLAGS` `$APXS -q CFLAGS_SHLIB`"
638 APXS_INCLUDE="`$APXS -q INCLUDEDIR`"
641 AC_SUBST(APXS_CFLAGS)
642 AC_SUBST(APXS_INCLUDE)
645 # Apache 2.0 (mod_shib_20)
647 # --with-apxs2 (DSO build, the normal way, uses apxs to derive build flags)
648 # --with-apr (DSO build, APR development package installed separately)
649 # --with-apu (DSO build, APR-UTIL development package installed separately)
651 AC_ARG_ENABLE(apache-20,
652 AS_HELP_STRING([--enable-apache-20],[enable the Apache 2.0 module]),
653 [if test "x$enableval" = "x" ; then
656 WANT_APACHE_20="$enableval"
658 ],[ WANT_APACHE_20=no ])
659 AC_MSG_CHECKING(whether to build Apache 2.0 module)
660 if test "$WANT_APACHE_20" != yes && test "$WANT_APACHE_20" != no ; then
663 AC_MSG_RESULT($WANT_APACHE_20)
665 if test "$WANT_APACHE_20" = "yes" ; then
667 AS_HELP_STRING([--with-apxs2=FILE],[Specifies where to find the Apache 2.0 apxs script.]),
669 AC_MSG_CHECKING(for user-specified Apache2 apxs name/location)
670 if test "$withval" != "no" ; then
671 if test "$withval" != "yes"; then
673 AC_MSG_RESULT("$withval")
678 AC_PATH_PROG(APXS2, apxs2, no)
679 if test "$APXS2" = "no" ; then
680 AC_PATH_PROG(APXS2, apxs, no)
682 if test "$APXS2" = "no" ; then
683 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
684 if test "$APXS2" = "no" && test -f "$i/apxs2" ; then
688 if test "$APXS2" = "no" ; then
689 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
690 if test "$APXS2" = "no" && test -f "$i/apxs" ; then
698 AC_MSG_CHECKING([to see if Apache2 apxs was located])
699 if test ! -f "$APXS2" ; then
701 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.])
703 AC_MSG_RESULT($APXS2)
708 AS_HELP_STRING([--with-apr=PATH],[where apr-config is installed]),
710 AC_MSG_CHECKING(for user-specified apr-config name/location)
711 if test "$withval" != "no" ; then
712 if test "$withval" != "yes"; then
714 AC_MSG_RESULT("$withval")
719 AC_PATH_PROG(APR_CONFIG, apr-config,,[`$APXS2 -q SBINDIR`]:[$PATH])
721 if test -f "${APR_CONFIG}"; then
722 APR_CFLAGS="`${APR_CONFIG} --cflags` `${APR_CONFIG} --cppflags` `${APR_CONFIG} --includes`"
724 AC_MSG_ERROR([Unable to locate apr-config, may need --with-apr option.])
729 AS_HELP_STRING([--with-apu=PATH],[where apu-config is installed]),
731 AC_MSG_CHECKING(for user-specified apu-config name/location)
732 if test "$withval" != "no" ; then
733 if test "$withval" != "yes"; then
735 AC_MSG_RESULT("$withval")
740 AC_PATH_PROG(APU_CONFIG, apu-config,,[`$APXS2 -q SBINDIR`]:[$PATH])
742 if test -f "${APU_CONFIG}"; then
743 APU_CFLAGS="`${APU_CONFIG} --includes`"
745 AC_MSG_ERROR([Unable to locate apu-config, may need --with-apu option.])
748 # extract settings we need from APXS2 -q
749 APXS2_CC="`$APXS2 -q CC`"
750 APXS2_CFLAGS="`$APXS2 -q CPPFLAGS` `$APXS2 -q CFLAGS` $APR_CFLAGS $APU_CFLAGS"
751 APXS2_INCLUDE="`$APXS2 -q INCLUDEDIR`"
754 AC_SUBST(APXS2_CFLAGS)
755 AC_SUBST(APXS2_INCLUDE)
758 # Apache 2.2 (mod_shib_22)
760 # --with-apxs22 (DSO build, the normal way, uses apxs to derive build flags)
761 # --with-apr1 (DSO build, APR development package installed separately)
762 # --with-apu1 (DSO build, APR-UTIL development package installed separately)
764 AC_ARG_ENABLE(apache-22,
765 AS_HELP_STRING([--enable-apache-22],[enable the Apache 2.2 module]),
766 [if test "x$enableval" = "x" ; then
769 WANT_APACHE_22="$enableval"
771 ],[ WANT_APACHE_22=no ])
772 AC_MSG_CHECKING(whether to build Apache 2.2 module)
773 if test "$WANT_APACHE_22" != yes && test "$WANT_APACHE_22" != no ; then
776 AC_MSG_RESULT($WANT_APACHE_22)
778 if test "$WANT_APACHE_22" = "yes" ; then
780 AS_HELP_STRING([--with-apxs22=FILE],[Specifies where to find the Apache 2.2 apxs script.]),
782 AC_MSG_CHECKING(for user-specified Apache2.2 apxs name/location)
783 if test "$withval" != "no" ; then
784 if test "$withval" != "yes"; then
786 AC_MSG_RESULT("$withval")
791 AC_PATH_PROG(APXS22, apxs2, no)
792 if test "$APXS22" = "no" ; then
793 AC_PATH_PROG(APXS22, apxs, no)
795 if test "$APXS22" = "no" ; then
796 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
797 if test "$APXS22" = "no" && test -f "$i/apxs2" ; then
801 if test "$APXS22" = "no" ; then
802 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
803 if test "$APXS22" = "no" && test -f "$i/apxs" ; then
811 AC_MSG_CHECKING([to see if Apache2.2 apxs was located])
812 if test ! -f "$APXS22" ; then
814 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.])
816 AC_MSG_RESULT($APXS22)
821 AS_HELP_STRING([--with-apr1=PATH],[where apr-1-config is installed]),
823 AC_MSG_CHECKING(for user-specified apr-1-config name/location)
824 if test "$withval" != "no" ; then
825 if test "$withval" != "yes"; then
827 AC_MSG_RESULT("$withval")
832 AC_PATH_PROG(APR1_CONFIG, apr-1-config,,[`$APXS22 -q SBINDIR`]:[$PATH])
834 if test -f "${APR1_CONFIG}"; then
835 APR1_CFLAGS="`${APR1_CONFIG} --cflags` `${APR1_CONFIG} --cppflags` `${APR1_CONFIG} --includes`"
837 AC_MSG_ERROR([Unable to locate apr-1-config, may need --with-apr1 option.])
842 AS_HELP_STRING([--with-apu1=PATH],[where apu-1-config is installed]),
844 AC_MSG_CHECKING(for user-specified apu-1-config name/location)
845 if test "$withval" != "no" ; then
846 if test "$withval" != "yes"; then
848 AC_MSG_RESULT("$withval")
853 AC_PATH_PROG(APU1_CONFIG, apu-1-config,,[`$APXS22 -q SBINDIR`]:[$PATH])
855 if test -f "${APU1_CONFIG}"; then
856 APU1_CFLAGS="`${APU1_CONFIG} --includes`"
858 AC_MSG_ERROR([Unable to locate apu-1-config, may need --with-apu1 option.])
861 # extract settings we need from APXS22 -q
862 APXS22_CC="`$APXS22 -q CC`"
863 APXS22_CFLAGS="`$APXS22 -q CPPFLAGS` `$APXS22 -q CFLAGS` $APR1_CFLAGS $APU1_CFLAGS"
864 APXS22_INCLUDE="`$APXS22 -q INCLUDEDIR`"
867 AC_SUBST(APXS22_CFLAGS)
868 AC_SUBST(APXS22_INCLUDE)
870 # always output the Makefile, even if you don't use it
871 AC_CONFIG_FILES([apache/Makefile])
872 AM_CONDITIONAL(BUILD_AP13,test "$WANT_APACHE_13" = "yes")
873 AM_CONDITIONAL(BUILD_AP20,test "$WANT_APACHE_20" = "yes")
874 AM_CONDITIONAL(BUILD_AP22,test "$WANT_APACHE_22" = "yes")
876 # add the apache module to the list of wanted subdirs..
877 if test "$WANT_APACHE_13" = "yes" || test "$WANT_APACHE_20" = "yes" || test "$WANT_APACHE_22" = "yes" ; then
878 WANT_SUBDIRS="$WANT_SUBDIRS apache"
883 # Implement the checks of the ODBC Storage Service
885 # 1) Assume the user wants ODBC; if it's not found then just continue without
886 # 2) If the user specifically requested odbc, look for it and ERROR if not found
887 # 3) If the user specifically requested no odbc, don't build it.
890 AC_CONFIG_FILES([odbc-store/Makefile])
892 # determine whether we should enable the odbc ccache
893 AC_ARG_ENABLE([odbc],
894 AS_HELP_STRING([--disable-odbc],[disable the ODBC Storage Service]),
895 [odbc_enabled=$enableval], [odbc_enabled=default])
896 if test "x$odbc_enabled" = "x" ; then
900 # Are we trying to build ODBC?
901 AC_MSG_CHECKING(whether to build the ODBC storage service)
902 if test "$odbc_enabled" = "yes" ; then
905 elif test "$odbc_enabled" = "default" ; then
907 AC_MSG_RESULT([yes, if it can be found])
913 # If we're trying to build ODBC, try to find the odbc_config program.
914 if test "$build_odbc" = "yes" ; then
917 AS_HELP_STRING([--with-odbc=PATH],[directory where odbc is installed]),
918 [if test "$with_odbc" = no ; then
919 AC_MSG_ERROR([Try running --disable-odbc instead.])
920 elif test "$with_odbc" != yes ; then
921 odbc_dir="$with_odbc/bin"
922 if test "$with_odbc" != /usr ; then
923 ODBC_CFLAGS="-I$with_odbc/include"
924 ODBC_LIBS="-L$with_odbc/lib"
928 AC_PATH_PROG(ODBC_CONFIG, odbc_config, no, $odbc_dir $PATH )
929 if test "$ODBC_CONFIG" = no ; then
930 AC_MSG_WARN([Cannot find odbc_config, will try to guess settings.])
931 ODBC_LIBS="$ODBC_LIBS -lodbc"
933 ODBC_CFLAGS=`$ODBC_CONFIG --cflags`
934 ODBC_LIBS=`$ODBC_CONFIG --libs`
937 save_CPPFLAGS="$CPPFLAGS"
938 CPPFLAGS="$CPPFLAGS $ODBC_CFLAGS"
940 AC_CHECK_HEADER([sql.h], [have_sql_h=yes], [have_sql_h=no])
941 if test "$have_sql_h" = no -a "$odbc_enabled" = "yes" ; then
942 AC_MSG_ERROR(unable to find ODBC header files)
945 if test "$have_sql_h" = yes ; then
947 LIBS="$LIBS $ODBC_LIBS"
948 AC_MSG_CHECKING(if we can link againt ODBC)
950 [AC_LANG_PROGRAM([[#include <sql.h>
952 #include <stdio.h>]],
953 [[SQLSetEnvAttr(SQL_NULL_HANDLE, SQL_ATTR_CONNECTION_POOLING, (void*)SQL_CP_ONE_PER_HENV, 0)]])],
954 [have_odbc_libs=yes],[have_odbc_libs=no])
956 if test "$have_odbc_libs" = no ; then
957 if test "$odbc_enabled" = "yes" ; then
958 AC_MSG_ERROR([unable to link with ODBC Library])
960 AC_MSG_RESULT([no, skipping ODBC])
965 CPPFLAGS="$save_CPPFLAGS"
968 # if have_odbc_libs=yes then go ahead with building ODBC
969 if test "$have_odbc_libs" = yes ; then
970 # this AC_MSG_RESULT is from above!
972 WANT_SUBDIRS="$WANT_SUBDIRS odbc-store"
973 AC_SUBST(ODBC_CFLAGS)
980 AC_ARG_WITH(gssapi-includes,
981 AS_HELP_STRING([--with-gssapi-includes=DIR],[Specify location of GSSAPI header]),
982 [ GSSAPI_INCS="-I$withval"
986 AC_ARG_WITH(gssapi-libs,
987 AS_HELP_STRING([--with-gssapi-libs=DIR],[Specify location of GSSAPI libs]),
988 [ GSSAPI_LIB_DIR="-L$withval"
993 AS_HELP_STRING([--with-gssapi=DIR],[Where to look for GSSAPI]),
994 [ GSSAPI_ROOT="$withval"
995 if test x"$GSSAPI_ROOT" != xno; then
997 if test x"$GSSAPI_ROOT" = xyes; then
998 dnl if yes, then use default root
1004 save_CPPFLAGS="$CPPFLAGS"
1005 AC_MSG_CHECKING([if GSSAPI support is requested])
1006 if test x"$want_gss" = xyes; then
1009 if test -z "$GSSAPI_INCS"; then
1010 if test -f "$GSSAPI_ROOT/bin/krb5-config"; then
1011 GSSAPI_INCS=`$GSSAPI_ROOT/bin/krb5-config --cflags gssapi`
1012 elif test "$GSSAPI_ROOT" != "yes"; then
1013 GSSAPI_INCS="-I$GSSAPI_ROOT/include"
1017 CPPFLAGS="$CPPFLAGS $GSSAPI_INCS"
1019 AC_CHECK_HEADER(gss.h,
1021 dnl found in the given dirs
1022 AC_DEFINE([SHIBSP_HAVE_GSSGNU],[1],[if you have the GNU gssapi libraries])
1026 dnl not found, check Heimdal or MIT
1027 AC_CHECK_HEADERS([gssapi/gssapi.h], [], [not_mit=1])
1029 [gssapi/gssapi_generic.h gssapi/gssapi_krb5.h],
1034 #ifdef HAVE_GSSAPI_GSSAPI_H
1035 #include <gssapi/gssapi.h>
1038 if test "x$not_mit" = "x1"; then
1039 dnl MIT not found, check for Heimdal
1040 AC_CHECK_HEADER([gssapi.h],
1043 AC_DEFINE([SHIBSP_HAVE_GSSHEIMDAL],[1],[if you have the Heimdal gssapi libraries])
1046 dnl no header found, disabling GSS
1048 AC_MSG_WARN([disabling GSSAPI since no header files was found])
1053 AC_DEFINE([SHIBSP_HAVE_GSSMIT],[1],[if you have the MIT gssapi libraries])
1054 dnl check if we have a really old MIT kerberos (<= 1.2)
1055 AC_MSG_CHECKING([if gssapi headers declare GSS_C_NT_HOSTBASED_SERVICE])
1058 #include <gssapi/gssapi.h>
1059 #include <gssapi/gssapi_generic.h>
1060 #include <gssapi/gssapi_krb5.h>
1065 GSS_C_NT_HOSTBASED_SERVICE,
1069 AC_MSG_RESULT([yes])
1072 AC_DEFINE([HAVE_OLD_GSSMIT],[1],[if you have an old MIT gssapi library, lacking GSS_C_NT_HOSTBASED_SERVICE])
1080 if test x"$want_gss" = xyes; then
1081 AC_DEFINE([SHIBSP_HAVE_GSSAPI],[1],[if you have the gssapi libraries])
1083 if test -n "$gnu_gss"; then
1084 LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
1087 if test -z "$GSSAPI_LIB_DIR"; then
1088 GSSAPI_LIB_DIR="$GSSAPI_ROOT/lib$libsuff"
1090 if test "$GSSAPI_ROOT" != "yes"; then
1091 LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff"
1093 if test -f "$GSSAPI_ROOT/bin/krb5-config"; then
1094 dnl krb5-config doesn't have --libs-only-L or similar, put everything
1096 gss_libs=`$GSSAPI_ROOT/bin/krb5-config --libs gssapi`
1098 if test "x$not_mit" = "x1"; then
1101 gss_libs="-lgssapi_krb5"
1104 LIBS="$LIBS $gss_libs"
1107 AC_MSG_CHECKING([whether GSS-API naming extensions are available])
1110 #ifdef SHIBSP_HAVE_GSSGNU
1112 #elif defined SHIBSP_HAVE_GSSMIT
1113 # include <gssapi/gssapi.h>
1114 # include <gssapi/gssapi_ext.h>
1116 # include <gssapi.h>
1118 [[gss_get_name_attribute(NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);]])],
1119 [AC_MSG_RESULT([yes])AC_DEFINE([HAVE_GSSAPI_NAMINGEXTS],[1],[Define to 1 if GSS-API naming extensions are available.])],
1120 [AC_MSG_RESULT([no])])
1122 AC_MSG_CHECKING([whether GSS-API composite name import is available])
1125 #ifdef SHIBSP_HAVE_GSSGNU
1127 #elif defined SHIBSP_HAVE_GSSMIT
1128 # include <gssapi/gssapi.h>
1129 # include <gssapi/gssapi_ext.h>
1131 # include <gssapi.h>
1136 gss_buffer_desc importbuf;
1137 gss_import_name(&minor, &importbuf, GSS_C_NT_EXPORT_NAME_COMPOSITE, &srcname);
1139 [AC_MSG_RESULT([yes])AC_DEFINE([HAVE_GSSAPI_COMPOSITE_NAME],[1],[Define to 1 if GSS-API composite name import is available.])],
1140 [AC_MSG_RESULT([no])])
1143 CPPFLAGS="$save_CPPFLAGS"
1147 AC_SUBST(WANT_SUBDIRS)
1149 if test -n "$APXS_CC" && test "$APXS_CC" != "$CC" ; then
1150 echo "=================================================================="
1151 echo "WARNING: You have chosen to compile Apache-1.3 modules with a different"
1152 echo " compiler than the one used to compile Apache."
1154 echo " Current compiler: $CC"
1155 echo " Apache's compiler: $APXS_CC"
1157 echo "This could cause problems."
1158 echo "=================================================================="
1161 if test -n "$APXS2_CC" && test "$APXS2_CC" != "$CC" ; then
1162 echo "=================================================================="
1163 echo "WARNING: You have chosen to compile Apache-2.0 modules with a different"
1164 echo " compiler than the one used to compile Apache."
1166 echo " Current compiler: $CC"
1167 echo " Apache's compiler: $APXS2_CC"
1169 echo "This could cause problems."
1170 echo "=================================================================="
1173 if test -n "$APXS22_CC" && test "$APXS22_CC" != "$CC" ; then
1174 echo "=================================================================="
1175 echo "WARNING: You have chosen to compile Apache-2.2 modules with a different"
1176 echo " compiler than the one used to compile Apache."
1178 echo " Current compiler: $CC"
1179 echo " Apache's compiler: $APXS22_CC"
1181 echo "This could cause problems."
1182 echo "=================================================================="
1185 LIBTOOL="$LIBTOOL --silent"