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]))
130 CPPFLAGS="$BOOST_CPPFLAGS $CPPFLAGS"
132 # Thank you Solaris, really.
133 AC_MSG_CHECKING(for ctime_r)
134 if test -z "$ac_cv_ctime_args"; then
136 [AC_LANG_PROGRAM([[#include <time.h>]], [[time_t clock; char buf[26]; ctime_r(&clock, buf);]])],
137 [ac_cv_ctime_args=2],[])
140 [AC_LANG_PROGRAM([[#include <time.h>]], [[time_t clock; char buf[26]; ctime_r(&clock, buf, 26);]])],
141 [ac_cv_ctime_args=3],[])
143 if test -z "$ac_cv_ctime_args"; then
146 if test "$ac_cv_ctime_args" = 2; then
147 AC_DEFINE([HAVE_CTIME_R_2],[1],[Define if ctime_r is present with 2 parameters.])
148 elif test "$ac_cv_ctime_args" = 3; then
149 AC_DEFINE([HAVE_CTIME_R_3],[1],[Define if ctime_r is present with 3 parameters.])
151 AC_MSG_RESULT([yes, and it takes $ac_cv_ctime_args arguments])
154 # log4shib settings (favor this version over the log4cpp code)
155 AC_PATH_PROG(LOG4SHIB_CONFIG,log4shib-config)
156 AC_ARG_WITH(log4shib,
157 AS_HELP_STRING([--with-log4shib=PATH],[where log4shib-config is installed]),
159 LOG4SHIB_CONFIG="${with_log4shib}"
160 if ! test -f "${LOG4SHIB_CONFIG}"; then
161 LOG4SHIB_CONFIG="${with_log4shib}/bin/log4shib-config"
164 if test -f "${LOG4SHIB_CONFIG}" ; then
165 LIBS="`${LOG4SHIB_CONFIG} --libs` $LIBS"
166 CPPFLAGS="`${LOG4SHIB_CONFIG} --cflags` $CPPFLAGS"
167 AC_CHECK_HEADER([log4shib/CategoryStream.hh],,AC_MSG_ERROR([unable to find log4shib header files]))
169 [AC_LANG_PROGRAM([[#include <log4shib/Category.hh>
170 #include <log4shib/CategoryStream.hh>]],
171 [[log4shib::Category::getInstance("foo").errorStream() << log4shib::eol]])],
172 [AC_DEFINE([SHIBSP_LOG4SHIB],[1],[Define to 1 if log4shib library is used.])],
173 [AC_MSG_ERROR([unable to link with log4shib])])
175 AC_MSG_WARN([log4shib-config not found, may need to use --with-log4shib option])
176 AC_MSG_WARN([will look for original log4cpp library])
179 AC_PATH_PROG(LOG4CPP_CONFIG,log4cpp-config)
181 AS_HELP_STRING([--with-log4cpp=PATH],[where log4cpp-config is installed]),
183 LOG4CPP_CONFIG="${with_log4cpp}"
184 if ! test -f "${LOG4CPP_CONFIG}"; then
185 LOG4CPP_CONFIG="${with_log4cpp}/bin/log4cpp-config"
188 if test -f "${LOG4CPP_CONFIG}"; then
189 AC_MSG_WARN([will try to use log4cpp, note that most non-Internet2 supplied versions are not thread-safe])
190 LIBS="`${LOG4CPP_CONFIG} --libs` $LIBS"
191 CPPFLAGS="`${LOG4CPP_CONFIG} --cflags` $CPPFLAGS"
192 AC_CHECK_HEADER([log4cpp/CategoryStream.hh],,AC_MSG_ERROR([unable to find log4cpp header files]))
194 [AC_LANG_PROGRAM([[#include <log4cpp/Category.hh>
195 #include <log4cpp/CategoryStream.hh>]],
196 [[log4cpp::Category::getInstance("foo").errorStream() << log4cpp::eol]])],
197 [AC_DEFINE([SHIBSP_LOG4CPP],[1],[Define to 1 if log4cpp library is used.])],
198 [AC_MSG_ERROR([unable to link with log4cpp, need version 1.0 or later])])
200 AC_MSG_ERROR([log4cpp-config not found, may need to use --with-log4cpp option])
206 AS_HELP_STRING([--with-xerces=PATH],[where xerces-c is installed]),,
208 if test x_$with_xerces != x_/usr; then
209 CPPFLAGS="-I${with_xerces}/include $CPPFLAGS"
210 LIBS="-L${with_xerces}/lib -lxerces-c $LIBS"
212 LIBS="-lxerces-c $LIBS"
215 AC_CHECK_HEADER([xercesc/dom/DOM.hpp],,AC_MSG_ERROR([unable to find xerces header files]))
216 AC_MSG_CHECKING([Xerces version])
218 [AC_LANG_PROGRAM([#include <xercesc/util/XercesVersion.hpp>],
219 [#if _XERCES_VERSION >= 20700
222 #error version 2.7.0 or above required
225 [AC_MSG_FAILURE([Xerces-C v2.7.0 or higher is required, v3.x preferred])])
227 [AC_LANG_PROGRAM([[#include <xercesc/util/PlatformUtils.hpp>]],[[xercesc::XMLPlatformUtils::Initialize()]])],
228 ,[AC_MSG_ERROR([unable to link with Xerces])])
230 AC_MSG_CHECKING([whether Xerces XMLString::release(XMLByte**) exists])
232 [AC_LANG_PROGRAM([[#include <xercesc/util/XMLString.hpp>]],
233 [[using namespace XERCES_CPP_NAMESPACE; XMLByte* buf=NULL; XMLString::release(&buf);]])],
234 [AC_MSG_RESULT([yes])AC_DEFINE([SHIBSP_XERCESC_HAS_XMLBYTE_RELEASE],[1],[Define to 1 if Xerces XMLString includes XMLByte release.])],
235 [AC_MSG_RESULT([no])])
237 AC_MSG_CHECKING([whether Xerces DOMNodeFilter API returns a short])
239 [AC_LANG_PROGRAM([[#include <xercesc/dom/DOM.hpp>]],
240 [[using namespace XERCES_CPP_NAMESPACE;
241 class Blocker : public DOMNodeFilter {
243 short acceptNode(const DOMNode* node) const {
244 return FILTER_REJECT;
247 static Blocker g_Blocker;
249 [AC_MSG_RESULT([yes])AC_DEFINE([SHIBSP_XERCESC_SHORT_ACCEPTNODE],[1],[Define to 1 if Xerces DOMNodeFilter API returns a short.])],
250 [AC_MSG_RESULT([no])])
252 # XML-Security settings
254 AS_HELP_STRING([--with-xmlsec=PATH],[where xmlsec is installed]),,
256 if test x_$with_xmlsec != x_/usr; then
257 CPPFLAGS="-I${with_xmlsec}/include $CPPFLAGS"
258 XMLSEC_LIBS="-L${with_xmlsec}/lib -lxml-security-c $XMLSEC_LIBS"
260 XMLSEC_LIBS="-lxml-security-c $XMLSEC_LIBS"
263 # save and append master libs
265 LIBS="$XMLSEC_LIBS $LIBS"
267 AC_CHECK_HEADER([xsec/utils/XSECPlatformUtils.hpp],,AC_MSG_ERROR([unable to find XML-Security-C header files]))
268 AC_MSG_CHECKING([XML-Security-C version])
270 [AC_LANG_PROGRAM([#include <xsec/utils/XSECPlatformUtils.hpp>],
271 [#if XSEC_VERSION_MAJOR > 1 || (XSEC_VERSION_MAJOR == 1 && XSEC_VERSION_MEDIUM > 3)
274 #error need version 1.4.0 or later
277 [AC_MSG_FAILURE([XML-Security-C version 1.4.0 or greater is required.])])
279 [AC_LANG_PROGRAM([[#include <xsec/utils/XSECPlatformUtils.hpp>]],
280 [[XSECPlatformUtils::Initialise()]])],,
281 [AC_MSG_ERROR([unable to link with XML-Security])])
283 AC_MSG_CHECKING([whether XML-Security-C supports white/blacklisting of algorithms])
284 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <xsec/framework/XSECAlgorithmMapper.hpp>]], [[XSECAlgorithmMapper* mapper; mapper->whitelistAlgorithm(NULL);]])],[AC_MSG_RESULT([yes])
285 AC_DEFINE([SHIBSP_XMLSEC_WHITELISTING],[1],[Define to 1 if XML-Security-C supports white/blacklisting algorithms.])],[AC_MSG_RESULT([no])])
287 # restore master libs
290 #XML-Tooling settings
291 AC_ARG_WITH(xmltooling,
292 AS_HELP_STRING([--with-xmltooling=PATH],[where xmltooling is installed]),,
293 [with_xmltooling=/usr])
294 if test x_$with_xmltooling != x_/usr; then
295 CPPFLAGS="-I${with_xmltooling}/include $CPPFLAGS"
296 DX_INCLUDE="${with_xmltooling}/include"
297 LITE_LIBS="-L${with_xmltooling}/lib -lxmltooling-lite"
298 XMLSEC_LIBS="-L${with_xmltooling}/lib -lxmltooling $XMLSEC_LIBS"
300 LITE_LIBS="-lxmltooling-lite"
301 XMLSEC_LIBS="-lxmltooling $XMLSEC_LIBS"
304 AC_CHECK_HEADER([xmltooling/base.h],,AC_MSG_ERROR([unable to find xmltooling header files]))
306 # save and append master libs
308 LIBS="$XMLSEC_LIBS $LIBS"
311 [AC_LANG_PROGRAM([[#include <xmltooling/XMLToolingConfig.h>
312 #include <xmltooling/version.h>]],
313 [[#if _XMLTOOLING_VERSION >= 10500
314 xmltooling::XMLToolingConfig::getConfig();
316 #error Need XMLTooling version 1.5 or higher
318 ,[AC_MSG_ERROR([unable to link with XMLTooling, or version was too old])])
320 # restore master libs
323 # Establish location of xmltooling catalog.
325 if test "x$with_xmltooling" = "x" ; then
326 with_xmltooling="/usr"
328 if test -f $with_xmltooling/share/xml/xmltooling/catalog.xml ; then
329 XMLTOOLINGXMLDIR="$with_xmltooling"
330 elif test -f $with_xerces/share/xml/xmltooling/catalog.xml ; then
331 XMLTOOLINGXMLDIR="$with_xerces"
332 elif test -f $with_log4shib/share/xml/xmltooling/catalog.xml ; then
333 XMLTOOLINGXMLDIR="$with_log4shib"
335 if test "x$XMLTOOLINGXMLDIR" = "x" ; then
336 AC_MSG_ERROR([xmltooling XML catalog not found, may need to use --with-xmltooling option])
338 XMLTOOLINGXMLDIR="$XMLTOOLINGXMLDIR/share/xml/xmltooling"
339 AC_SUBST(XMLTOOLINGXMLDIR)
343 AS_HELP_STRING([--with-saml=PATH],[where opensaml is installed]),,
345 if test x_$with_xmltooling != x_/usr; then
346 CPPFLAGS="-I${with_saml}/include $CPPFLAGS"
347 DX_INCLUDE="$DX_INCLUDE ${with_saml}/include"
348 XMLSEC_LIBS="-L${with_saml}/lib -lsaml $XMLSEC_LIBS"
350 XMLSEC_LIBS="-lsaml $XMLSEC_LIBS"
353 # save and append master libs
355 LIBS="$XMLSEC_LIBS $LIBS"
357 AC_CHECK_HEADER([saml/saml2/metadata/Metadata.h],,AC_MSG_ERROR([unable to find OpenSAML header files]))
359 [AC_LANG_PROGRAM([[#include <saml/SAMLConfig.h>
360 #include <saml/version.h>]],
361 [[#if _OPENSAML_VERSION >= 20500
362 opensaml::SAMLConfig::getConfig();
364 #error Need OpenSAML version 2.5 or higher
366 ,[AC_MSG_ERROR([unable to link with OpenSAML, or version was too old])
369 # restore master libs
372 # Establish location of opensaml catalogs.
374 if test "x$with_saml" = "x" ; then
377 if test -f $with_saml/share/xml/opensaml/saml20-catalog.xml ; then
378 OPENSAMLXMLDIR="$with_saml"
379 elif test -f $with_xmltooling/share/xml/opensaml/saml20-catalog.xml ; then
380 OPENSAMLXMLDIR="$with_xmltooling"
381 elif test -f $with_xerces/share/xml/opensaml/saml20-catalog.xml ; then
382 OPENSAMLXMLDIR="$with_xerces"
383 elif test -f $with_log4shib/share/xml/opensaml/saml20-catalog.xml ; then
384 OPENSAMLXMLDIR="$with_log4shib"
386 if test "x$OPENSAMLXMLDIR" = "x" ; then
387 AC_MSG_ERROR([opensaml XML catalogs not found, may need to use --with-saml option])
389 OPENSAMLXMLDIR="$OPENSAMLXMLDIR/share/xml/opensaml"
390 AC_SUBST(OPENSAMLXMLDIR)
393 AC_SUBST(XMLSEC_LIBS)
395 # output the underlying makefiles
396 WANT_SUBDIRS="doc schemas configs shibsp plugins shibd util"
397 AC_CONFIG_FILES([Makefile doc/Makefile schemas/Makefile \
398 configs/Makefile shibsp/Makefile plugins/Makefile \
399 shibd/Makefile util/Makefile selinux/Makefile])
402 AC_CONFIG_FILES([adfs/Makefile])
403 AC_ARG_ENABLE([adfs],
404 AS_HELP_STRING([--disable-adfs],[don't build the ADFS module]),
405 [adfs_enabled=$enableval], [adfs_enabled=yes])
406 if test "x$adfs_enabled" = "x" ; then
409 AC_MSG_CHECKING(whether to build the ADFS module)
410 if test "$adfs_enabled" = "no" ; then
414 WANT_SUBDIRS="$WANT_SUBDIRS adfs"
419 # Build NSAPI module?
421 AC_MSG_CHECKING(for NSAPI module option)
423 AS_HELP_STRING([--with-nsapi=DIR],[Build NSAPI module for Netscape/iPlanet/SunONE]),
424 [WANT_NSAPI=$withval],[WANT_NSAPI=no])
425 AC_MSG_RESULT($WANT_NSAPI)
427 if test "$WANT_NSAPI" != "no"; then
428 if test ! -d $WANT_NSAPI/bin ; then
429 AC_MSG_ERROR([Please specify the path to the root of your Netscape/iPlanet/SunONE server using --with-nsapi=DIR])
431 AC_MSG_CHECKING(for NSAPI include files)
432 if test -d $WANT_NSAPI/include ; then
433 NSAPI_INCLUDE=$WANT_NSAPI/include
434 AC_MSG_RESULT(Netscape-Enterprise 3.x style)
435 AC_CHECK_HEADERS([$NSAPI_INCLUDE/nsapi.h],,,[#define XP_UNIX])
436 NSAPI_INCLUDE="$NSAPI_INC_DIR -I$NSAPI_INCLUDE"
438 if test -d $WANT_NSAPI/plugins/include ; then
439 test -n "$NSAPI_INCLUDE" && NSAPI_INC_DIR="-I$NSAPI_INCLUDE"
440 NSAPI_INCLUDE="$WANT_NSAPI/plugins/include"
441 AC_MSG_RESULT(iPlanet 4.x / SunONE 6.x style)
442 AC_CHECK_HEADERS([$NSAPI_INCLUDE/nsapi.h],,,[#define XP_UNIX])
443 NSAPI_INCLUDE="$NSAPI_INC_DIR -I$NSAPI_INCLUDE"
445 if test "$NSAPI_INCLUDE" = ""; then
446 AC_MSG_ERROR([Please check you have nsapi.h in either $WANT_NSAPI/include or $WANT_NSAPI/plugins/include])
450 AC_SUBST(NSAPI_INCLUDE)
452 # always output the Makefile, even if you don't use it
453 AC_CONFIG_FILES([nsapi_shib/Makefile])
454 AM_CONDITIONAL(BUILD_NSAPI,test ! "$WANT_NSAPI" = "no")
456 # add the NSAPI module to the list of wanted subdirs..
457 if test ! "$WANT_NSAPI" = "no" ; then
458 WANT_SUBDIRS="$WANT_SUBDIRS nsapi_shib"
463 # Build FastCGI support?
465 AC_MSG_CHECKING(for FastCGI support)
467 AS_HELP_STRING([--with-fastcgi=DIR],[Build FastCGI support]),
468 [WANT_FASTCGI=$withval],[WANT_FASTCGI=no])
469 AC_MSG_RESULT($WANT_FASTCGI)
471 if test "$WANT_FASTCGI" != "no"; then
472 if test "$WANT_FASTCGI" != "yes"; then
473 if test x_$WANT_FASTCGI != x_/usr; then
474 FASTCGI_INCLUDE="-I$WANT_FASTCGI/include"
475 FASTCGI_LDFLAGS="-L$WANT_FASTCGI/lib"
478 AC_CHECK_HEADER([fcgio.h],,AC_MSG_ERROR([unable to find FastCGI header files]))
479 FASTCGI_LIBS="-lfcgi -lfcgi++"
482 AC_SUBST(FASTCGI_INCLUDE)
483 AC_SUBST(FASTCGI_LDFLAGS)
484 AC_SUBST(FASTCGI_LIBS)
486 # always output the Makefile, even if you don't use it
487 AC_CONFIG_FILES([fastcgi/Makefile])
488 AM_CONDITIONAL(BUILD_FASTCGI,test ! "$WANT_FASTCGI" = "no")
490 if test ! "$WANT_FASTCGI" = "no" ; then
491 WANT_SUBDIRS="$WANT_SUBDIRS fastcgi"
495 # Build Memcached support?
497 AC_MSG_CHECKING(for Memcached support)
498 AC_ARG_WITH(memcached,
499 AS_HELP_STRING([--with-memcached=DIR],[Build Memcached support]),
500 [WANT_MEMCACHED=$withval],[WANT_MEMCACHED=no])
501 AC_MSG_RESULT($WANT_MEMCACHED)
503 if test "$WANT_MEMCACHED" != "no"; then
504 if test "$WANT_MEMCACHED" != "yes"; then
505 if test x_$WANT_MEMCACHED != x_/usr; then
506 MEMCACHED_INCLUDE="-I$WANT_MEMCACHED/include"
507 MEMCACHED_LDFLAGS="-L$WANT_MEMCACHED/lib"
510 AC_CHECK_HEADER([libmemcached/memcached.h],,
511 AC_MSG_ERROR([unable to find Memcached header files]))
512 MEMCACHED_LIBS="-lmemcached"
515 AC_SUBST(MEMCACHED_INCLUDE)
516 AC_SUBST(MEMCACHED_LDFLAGS)
517 AC_SUBST(MEMCACHED_LIBS)
519 # always output the Makefile, even if you don't use it
520 AC_CONFIG_FILES([memcache-store/Makefile])
521 AM_CONDITIONAL(BUILD_MEMCACHED,test ! "$WANT_MEMCACHED" = "no")
523 if test ! "$WANT_MEMCACHED" = "no" ; then
524 WANT_SUBDIRS="$WANT_SUBDIRS memcache-store"
529 # If no --enable-apache-xx specified
530 # find a default and fake the specific parameters
533 # simple macro to peek at an enable or a with
535 if test "[${[$1]_][$2]+set}" = set; then
536 peekval="${[$1]_[$2]}"
541 AC_MSG_CHECKING(if default apache needed)
543 Peek(enable,apache_13,need_default=no)
544 Peek(enable,apache_20,need_default=no)
545 Peek(enable,apache_22,need_default=no)
546 AC_MSG_RESULT($need_default)
548 if test "$need_default" = "yes"; then
549 # find an apxs, then the httpd
551 Peek(with,apxs,xs="$peekval")
552 Peek(with,apxs2,xs="$peekval")
553 Peek(with,apxs22,xs="$peekval")
554 if test "x$xs" = "x"; then
555 AC_PATH_PROGS(xs, apxs2 apxs,
556 AC_MSG_ERROR(No apxs, no apache found. Try --with-apxs),
557 [/usr/local/apache2/bin:/usr/local/apache/bin:/usr/sbin:$PATH])
559 # ask the daemon for the version and set parameters
560 AC_MSG_CHECKING(default apache version)
561 httpd="`$xs -q SBINDIR`/`$xs -q TARGET`"
562 if test "x$httpd" != "x" && test -f $httpd ; then
563 v=`$httpd -v|$SED -n -e 's/.*Apache\/\.*//p'`
565 1.3*) [enable_apache_13]=yes
569 2.0*) [enable_apache_20]=yes
573 2.2*) [enable_apache_22]=yes
577 *) AC_MSG_ERROR(unusable apache versions: $v. Try setting --with-apxs)
580 AC_MSG_RESULT(cannot determine version. Try setting --with-apxs)
584 # Apache 1.3 (mod_shib_13)
586 # --with-apxs (DSO build, the normal way, uses apxs to derive build flags)
588 AC_ARG_ENABLE(apache-13,
589 AS_HELP_STRING([--enable-apache-13],[enable the Apache 1.3 module]),
590 [if test "x$enableval" = "x" ; then
593 WANT_APACHE_13="$enableval"
595 ],[ WANT_APACHE_13=no ])
596 AC_MSG_CHECKING(whether to build Apache 1.3 module)
597 if test "$WANT_APACHE_13" != yes && test "$WANT_APACHE_13" != no ; then
600 AC_MSG_RESULT($WANT_APACHE_13)
602 if test "$WANT_APACHE_13" = "yes" ; then
604 AS_HELP_STRING([--with-apxs=FILE],[Specifies where to find the Apache 1.3 apxs script.]),
606 AC_MSG_CHECKING(for user-specified apxs name/location)
607 if test "$withval" != "no" ; then
608 if test "$withval" != "yes"; then
610 AC_MSG_RESULT("$withval")
615 AC_PATH_PROG(APXS, apxs, no)
616 if test "$APXS" = "no" ; then
617 for i in /usr/sbin /usr/local/apache/bin ; do
618 if test "$APXS" = "no" && test -f "$i/apxs"; then
625 AC_MSG_CHECKING([to see if apxs was located])
626 if test ! -f "$APXS" ; then
628 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.])
633 # extract settings we need from APXS -q
634 APXS_CC="`$APXS -q CC`"
635 APXS_CFLAGS="`$APXS -q CFLAGS` `$APXS -q CFLAGS_SHLIB`"
636 APXS_INCLUDE="`$APXS -q INCLUDEDIR`"
639 AC_SUBST(APXS_CFLAGS)
640 AC_SUBST(APXS_INCLUDE)
643 # Apache 2.0 (mod_shib_20)
645 # --with-apxs2 (DSO build, the normal way, uses apxs to derive build flags)
646 # --with-apr (DSO build, APR development package installed separately)
647 # --with-apu (DSO build, APR-UTIL development package installed separately)
649 AC_ARG_ENABLE(apache-20,
650 AS_HELP_STRING([--enable-apache-20],[enable the Apache 2.0 module]),
651 [if test "x$enableval" = "x" ; then
654 WANT_APACHE_20="$enableval"
656 ],[ WANT_APACHE_20=no ])
657 AC_MSG_CHECKING(whether to build Apache 2.0 module)
658 if test "$WANT_APACHE_20" != yes && test "$WANT_APACHE_20" != no ; then
661 AC_MSG_RESULT($WANT_APACHE_20)
663 if test "$WANT_APACHE_20" = "yes" ; then
665 AS_HELP_STRING([--with-apxs2=FILE],[Specifies where to find the Apache 2.0 apxs script.]),
667 AC_MSG_CHECKING(for user-specified Apache2 apxs name/location)
668 if test "$withval" != "no" ; then
669 if test "$withval" != "yes"; then
671 AC_MSG_RESULT("$withval")
676 AC_PATH_PROG(APXS2, apxs2, no)
677 if test "$APXS2" = "no" ; then
678 AC_PATH_PROG(APXS2, apxs, no)
680 if test "$APXS2" = "no" ; then
681 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
682 if test "$APXS2" = "no" && test -f "$i/apxs2" ; then
686 if test "$APXS2" = "no" ; then
687 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
688 if test "$APXS2" = "no" && test -f "$i/apxs" ; then
696 AC_MSG_CHECKING([to see if Apache2 apxs was located])
697 if test ! -f "$APXS2" ; then
699 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.])
701 AC_MSG_RESULT($APXS2)
706 AS_HELP_STRING([--with-apr=PATH],[where apr-config is installed]),
708 AC_MSG_CHECKING(for user-specified apr-config name/location)
709 if test "$withval" != "no" ; then
710 if test "$withval" != "yes"; then
712 AC_MSG_RESULT("$withval")
717 AC_PATH_PROG(APR_CONFIG, apr-config,,[`$APXS2 -q SBINDIR`]:[$PATH])
719 if test -f "${APR_CONFIG}"; then
720 APR_CFLAGS="`${APR_CONFIG} --cflags` `${APR_CONFIG} --cppflags` `${APR_CONFIG} --includes`"
722 AC_MSG_ERROR([Unable to locate apr-config, may need --with-apr option.])
727 AS_HELP_STRING([--with-apu=PATH],[where apu-config is installed]),
729 AC_MSG_CHECKING(for user-specified apu-config name/location)
730 if test "$withval" != "no" ; then
731 if test "$withval" != "yes"; then
733 AC_MSG_RESULT("$withval")
738 AC_PATH_PROG(APU_CONFIG, apu-config,,[`$APXS2 -q SBINDIR`]:[$PATH])
740 if test -f "${APU_CONFIG}"; then
741 APU_CFLAGS="`${APU_CONFIG} --includes`"
743 AC_MSG_ERROR([Unable to locate apu-config, may need --with-apu option.])
746 # extract settings we need from APXS2 -q
747 APXS2_CC="`$APXS2 -q CC`"
748 APXS2_CFLAGS="`$APXS2 -q CPPFLAGS` `$APXS2 -q CFLAGS` $APR_CFLAGS $APU_CFLAGS"
749 APXS2_INCLUDE="`$APXS2 -q INCLUDEDIR`"
752 AC_SUBST(APXS2_CFLAGS)
753 AC_SUBST(APXS2_INCLUDE)
756 # Apache 2.2 (mod_shib_22)
758 # --with-apxs22 (DSO build, the normal way, uses apxs to derive build flags)
759 # --with-apr1 (DSO build, APR development package installed separately)
760 # --with-apu1 (DSO build, APR-UTIL development package installed separately)
762 AC_ARG_ENABLE(apache-22,
763 AS_HELP_STRING([--enable-apache-22],[enable the Apache 2.2 module]),
764 [if test "x$enableval" = "x" ; then
767 WANT_APACHE_22="$enableval"
769 ],[ WANT_APACHE_22=no ])
770 AC_MSG_CHECKING(whether to build Apache 2.2 module)
771 if test "$WANT_APACHE_22" != yes && test "$WANT_APACHE_22" != no ; then
774 AC_MSG_RESULT($WANT_APACHE_22)
776 if test "$WANT_APACHE_22" = "yes" ; then
778 AS_HELP_STRING([--with-apxs22=FILE],[Specifies where to find the Apache 2.2 apxs script.]),
780 AC_MSG_CHECKING(for user-specified Apache2.2 apxs name/location)
781 if test "$withval" != "no" ; then
782 if test "$withval" != "yes"; then
784 AC_MSG_RESULT("$withval")
789 AC_PATH_PROG(APXS22, apxs2, no)
790 if test "$APXS22" = "no" ; then
791 AC_PATH_PROG(APXS22, apxs, no)
793 if test "$APXS22" = "no" ; then
794 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
795 if test "$APXS22" = "no" && test -f "$i/apxs2" ; then
799 if test "$APXS22" = "no" ; then
800 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
801 if test "$APXS22" = "no" && test -f "$i/apxs" ; then
809 AC_MSG_CHECKING([to see if Apache2.2 apxs was located])
810 if test ! -f "$APXS22" ; then
812 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.])
814 AC_MSG_RESULT($APXS22)
819 AS_HELP_STRING([--with-apr1=PATH],[where apr-1-config is installed]),
821 AC_MSG_CHECKING(for user-specified apr-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(APR1_CONFIG, apr-1-config,,[`$APXS22 -q SBINDIR`]:[$PATH])
832 if test -f "${APR1_CONFIG}"; then
833 APR1_CFLAGS="`${APR1_CONFIG} --cflags` `${APR1_CONFIG} --cppflags` `${APR1_CONFIG} --includes`"
835 AC_MSG_ERROR([Unable to locate apr-1-config, may need --with-apr1 option.])
840 AS_HELP_STRING([--with-apu1=PATH],[where apu-1-config is installed]),
842 AC_MSG_CHECKING(for user-specified apu-1-config name/location)
843 if test "$withval" != "no" ; then
844 if test "$withval" != "yes"; then
846 AC_MSG_RESULT("$withval")
851 AC_PATH_PROG(APU1_CONFIG, apu-1-config,,[`$APXS22 -q SBINDIR`]:[$PATH])
853 if test -f "${APU1_CONFIG}"; then
854 APU1_CFLAGS="`${APU1_CONFIG} --includes`"
856 AC_MSG_ERROR([Unable to locate apu-1-config, may need --with-apu1 option.])
859 # extract settings we need from APXS22 -q
860 APXS22_CC="`$APXS22 -q CC`"
861 APXS22_CFLAGS="`$APXS22 -q CPPFLAGS` `$APXS22 -q CFLAGS` $APR1_CFLAGS $APU1_CFLAGS"
862 APXS22_INCLUDE="`$APXS22 -q INCLUDEDIR`"
865 AC_SUBST(APXS22_CFLAGS)
866 AC_SUBST(APXS22_INCLUDE)
868 # always output the Makefile, even if you don't use it
869 AC_CONFIG_FILES([apache/Makefile])
870 AM_CONDITIONAL(BUILD_AP13,test "$WANT_APACHE_13" = "yes")
871 AM_CONDITIONAL(BUILD_AP20,test "$WANT_APACHE_20" = "yes")
872 AM_CONDITIONAL(BUILD_AP22,test "$WANT_APACHE_22" = "yes")
874 # add the apache module to the list of wanted subdirs..
875 if test "$WANT_APACHE_13" = "yes" || test "$WANT_APACHE_20" = "yes" || test "$WANT_APACHE_22" = "yes" ; then
876 WANT_SUBDIRS="$WANT_SUBDIRS apache"
881 # Implement the checks of the ODBC Storage Service
883 # 1) Assume the user wants ODBC; if it's not found then just continue without
884 # 2) If the user specifically requested odbc, look for it and ERROR if not found
885 # 3) If the user specifically requested no odbc, don't build it.
888 AC_CONFIG_FILES([odbc-store/Makefile])
890 # determine whether we should enable the odbc ccache
891 AC_ARG_ENABLE([odbc],
892 AS_HELP_STRING([--disable-odbc],[disable the ODBC Storage Service]),
893 [odbc_enabled=$enableval], [odbc_enabled=default])
894 if test "x$odbc_enabled" = "x" ; then
898 # Are we trying to build ODBC?
899 AC_MSG_CHECKING(whether to build the ODBC storage service)
900 if test "$odbc_enabled" = "yes" ; then
903 elif test "$odbc_enabled" = "default" ; then
905 AC_MSG_RESULT([yes, if it can be found])
911 # If we're trying to build ODBC, try to find the odbc_config program.
912 if test "$build_odbc" = "yes" ; then
915 AS_HELP_STRING([--with-odbc=PATH],[directory where odbc is installed]),
916 [if test "$with_odbc" = no ; then
917 AC_MSG_ERROR([Try running --disable-odbc instead.])
918 elif test "$with_odbc" != yes ; then
919 odbc_dir="$with_odbc/bin"
920 if test "$with_odbc" != /usr ; then
921 ODBC_CFLAGS="-I$with_odbc/include"
922 ODBC_LIBS="-L$with_odbc/lib"
926 AC_PATH_PROG(ODBC_CONFIG, odbc_config, no, $odbc_dir $PATH )
927 if test "$ODBC_CONFIG" = no ; then
928 AC_MSG_WARN([Cannot find odbc_config, will try to guess settings.])
929 ODBC_LIBS="$ODBC_LIBS -lodbc"
931 ODBC_CFLAGS=`$ODBC_CONFIG --cflags`
932 ODBC_LIBS=`$ODBC_CONFIG --libs`
935 save_CPPFLAGS="$CPPFLAGS"
936 CPPFLAGS="$CPPFLAGS $ODBC_CFLAGS"
938 AC_CHECK_HEADER([sql.h], [have_sql_h=yes], [have_sql_h=no])
939 if test "$have_sql_h" = no -a "$odbc_enabled" = "yes" ; then
940 AC_MSG_ERROR(unable to find ODBC header files)
943 if test "$have_sql_h" = yes ; then
945 LIBS="$LIBS $ODBC_LIBS"
946 AC_MSG_CHECKING(if we can link againt ODBC)
948 [AC_LANG_PROGRAM([[#include <sql.h>
950 #include <stdio.h>]],
951 [[SQLSetEnvAttr(SQL_NULL_HANDLE, SQL_ATTR_CONNECTION_POOLING, (void*)SQL_CP_ONE_PER_HENV, 0)]])],
952 [have_odbc_libs=yes],[have_odbc_libs=no])
954 if test "$have_odbc_libs" = no ; then
955 if test "$odbc_enabled" = "yes" ; then
956 AC_MSG_ERROR([unable to link with ODBC Library])
958 AC_MSG_RESULT([no, skipping ODBC])
963 CPPFLAGS="$save_CPPFLAGS"
966 # if have_odbc_libs=yes then go ahead with building ODBC
967 if test "$have_odbc_libs" = yes ; then
968 # this AC_MSG_RESULT is from above!
970 WANT_SUBDIRS="$WANT_SUBDIRS odbc-store"
971 AC_SUBST(ODBC_CFLAGS)
978 AC_ARG_WITH(gssapi-includes,
979 AS_HELP_STRING([--with-gssapi-includes=DIR],[Specify location of GSSAPI header]),
980 [ GSSAPI_INCS="-I$withval"
984 AC_ARG_WITH(gssapi-libs,
985 AS_HELP_STRING([--with-gssapi-libs=DIR],[Specify location of GSSAPI libs]),
986 [ GSSAPI_LIB_DIR="-L$withval"
991 AS_HELP_STRING([--with-gssapi=DIR],[Where to look for GSSAPI]),
992 [ GSSAPI_ROOT="$withval"
993 if test x"$GSSAPI_ROOT" != xno; then
995 if test x"$GSSAPI_ROOT" = xyes; then
996 dnl if yes, then use default root
1002 save_CPPFLAGS="$CPPFLAGS"
1003 AC_MSG_CHECKING([if GSSAPI support is requested])
1004 if test x"$want_gss" = xyes; then
1007 if test -z "$GSSAPI_INCS"; then
1008 if test -f "$GSSAPI_ROOT/bin/krb5-config"; then
1009 GSSAPI_INCS=`$GSSAPI_ROOT/bin/krb5-config --cflags gssapi`
1010 elif test "$GSSAPI_ROOT" != "yes"; then
1011 GSSAPI_INCS="-I$GSSAPI_ROOT/include"
1015 CPPFLAGS="$CPPFLAGS $GSSAPI_INCS"
1017 AC_CHECK_HEADER(gss.h,
1019 dnl found in the given dirs
1020 AC_DEFINE([SHIBSP_HAVE_GSSGNU],[1],[if you have the GNU gssapi libraries])
1024 dnl not found, check Heimdal or MIT
1025 AC_CHECK_HEADERS([gssapi/gssapi.h], [], [not_mit=1])
1027 [gssapi/gssapi_generic.h gssapi/gssapi_krb5.h],
1032 #ifdef HAVE_GSSAPI_GSSAPI_H
1033 #include <gssapi/gssapi.h>
1036 if test "x$not_mit" = "x1"; then
1037 dnl MIT not found, check for Heimdal
1038 AC_CHECK_HEADER([gssapi.h],
1041 AC_DEFINE([SHIBSP_HAVE_GSSHEIMDAL],[1],[if you have the Heimdal gssapi libraries])
1044 dnl no header found, disabling GSS
1046 AC_MSG_WARN([disabling GSSAPI since no header files was found])
1051 AC_DEFINE([SHIBSP_HAVE_GSSMIT],[1],[if you have the MIT gssapi libraries])
1052 dnl check if we have a really old MIT kerberos (<= 1.2)
1053 AC_MSG_CHECKING([if gssapi headers declare GSS_C_NT_HOSTBASED_SERVICE])
1056 #include <gssapi/gssapi.h>
1057 #include <gssapi/gssapi_generic.h>
1058 #include <gssapi/gssapi_krb5.h>
1063 GSS_C_NT_HOSTBASED_SERVICE,
1067 AC_MSG_RESULT([yes])
1070 AC_DEFINE([HAVE_OLD_GSSMIT],[1],[if you have an old MIT gssapi library, lacking GSS_C_NT_HOSTBASED_SERVICE])
1078 if test x"$want_gss" = xyes; then
1079 AC_DEFINE([SHIBSP_HAVE_GSSAPI],[1],[if you have the gssapi libraries])
1081 if test -n "$gnu_gss"; then
1082 LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
1085 if test -z "$GSSAPI_LIB_DIR"; then
1086 GSSAPI_LIB_DIR="$GSSAPI_ROOT/lib$libsuff"
1088 if test "$GSSAPI_ROOT" != "yes"; then
1089 LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff"
1091 if test -f "$GSSAPI_ROOT/bin/krb5-config"; then
1092 dnl krb5-config doesn't have --libs-only-L or similar, put everything
1094 gss_libs=`$GSSAPI_ROOT/bin/krb5-config --libs gssapi`
1096 if test "x$not_mit" = "x1"; then
1099 gss_libs="-lgssapi_krb5"
1102 LIBS="$LIBS $gss_libs"
1105 AC_MSG_CHECKING([whether GSS-API naming extensions are available])
1108 #ifdef SHIBSP_HAVE_GSSGNU
1110 #elif defined SHIBSP_HAVE_GSSMIT
1111 # include <gssapi/gssapi.h>
1112 # include <gssapi/gssapi_ext.h>
1114 # include <gssapi.h>
1116 [[gss_get_name_attribute(NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);]])],
1117 [AC_MSG_RESULT([yes])AC_DEFINE([HAVE_GSSAPI_NAMINGEXTS],[1],[Define to 1 if GSS-API naming extensions are available.])],
1118 [AC_MSG_RESULT([no])])
1120 AC_MSG_CHECKING([whether GSS-API composite name import is available])
1123 #ifdef SHIBSP_HAVE_GSSGNU
1125 #elif defined SHIBSP_HAVE_GSSMIT
1126 # include <gssapi/gssapi.h>
1127 # include <gssapi/gssapi_ext.h>
1129 # include <gssapi.h>
1134 gss_buffer_desc importbuf;
1135 gss_import_name(&minor, &importbuf, GSS_C_NT_EXPORT_NAME_COMPOSITE, &srcname);
1137 [AC_MSG_RESULT([yes])AC_DEFINE([HAVE_GSSAPI_COMPOSITE_NAME],[1],[Define to 1 if GSS-API composite name import is available.])],
1138 [AC_MSG_RESULT([no])])
1141 CPPFLAGS="$save_CPPFLAGS"
1145 AC_SUBST(WANT_SUBDIRS)
1147 if test -n "$APXS_CC" && test "$APXS_CC" != "$CC" ; then
1148 echo "=================================================================="
1149 echo "WARNING: You have chosen to compile Apache-1.3 modules with a different"
1150 echo " compiler than the one used to compile Apache."
1152 echo " Current compiler: $CC"
1153 echo " Apache's compiler: $APXS_CC"
1155 echo "This could cause problems."
1156 echo "=================================================================="
1159 if test -n "$APXS2_CC" && test "$APXS2_CC" != "$CC" ; then
1160 echo "=================================================================="
1161 echo "WARNING: You have chosen to compile Apache-2.0 modules with a different"
1162 echo " compiler than the one used to compile Apache."
1164 echo " Current compiler: $CC"
1165 echo " Apache's compiler: $APXS2_CC"
1167 echo "This could cause problems."
1168 echo "=================================================================="
1171 if test -n "$APXS22_CC" && test "$APXS22_CC" != "$CC" ; then
1172 echo "=================================================================="
1173 echo "WARNING: You have chosen to compile Apache-2.2 modules with a different"
1174 echo " compiler than the one used to compile Apache."
1176 echo " Current compiler: $CC"
1177 echo " Apache's compiler: $APXS22_CC"
1179 echo "This could cause problems."
1180 echo "=================================================================="
1183 LIBTOOL="$LIBTOOL --silent"