2 AC_INIT([shibboleth],[2.4],[https://bugs.internet2.edu/],[shibboleth])
3 AC_CONFIG_SRCDIR(shibsp)
4 AC_CONFIG_AUX_DIR(build-aux)
5 AC_CONFIG_MACRO_DIR(m4)
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])
35 AC_CONFIG_FILES([shibboleth.spec pkginfo Portfile])
37 AC_PROG_CC([gcc gcc3 cc])
38 AC_PROG_CXX([g++ g++3 c++ CC])
41 if test "$GCC" = "yes" ; then
42 # AC_HAVE_GCC_VERSION(4,0,0,0,
44 # AC_DEFINE(GCC_HASCLASSVISIBILITY,1,
45 # [Define to enable class visibility control in gcc.])
46 # GCC_CFLAGS="$GCC_CFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
47 # GCC_CXXFLAGS="$GCC_CXXFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
49 CFLAGS="-Wall $GCC_CFLAGS"
50 CXXFLAGS="-Wall $GCC_CXXFLAGS"
52 # Fix for Sun Workshop compiler in debug mode, may be Sun case #6360993
53 case "${host_cpu}-${host_os}" in
55 if test "$CXX" = "CC" ; then
56 CXXFLAGS="$CXXFLAGS -Qoption ccfe -stabs=no%dfltlit+no%dflthlp"
60 CXXFLAGS="$CXXFLAGS -D_POSIX_PII_SOCKET"
67 # Checks for typedefs, structures, and compiler characteristics.
72 # Checks for library functions.
75 AC_CHECK_HEADERS([sys/utsname.h])
76 AC_CHECK_FUNCS([strchr strdup strstr timegm gmtime_r strtok_r strcasecmp])
79 ACX_PTHREAD([enable_threads="pthread"],[enable_threads="no"])
80 if test $enable_threads != "pthread"; then
81 AC_MSG_ERROR([unable to find pthreads, currently this is required])
83 AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])
84 LIBS="$PTHREAD_LIBS $LIBS"
85 CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
86 CXXFLAGS="$PTHREAD_CFLAGS $CXXFLAGS"
91 AS_HELP_STRING([--with-openssl=PATH],[where openssl is installed]),
92 [if test x_$with_openssl != x_/usr; then
93 SSLFLAGS="-I${with_openssl}/include"
96 if test "x$with_openssl" = "x" ; then
97 AC_PATH_PROG(PKG_CONFIG, pkg-config)
98 if test "x$PKG_CONFIG" != x && test "x$PKG_CONFIG" != "xno" ; then
99 if pkg-config openssl ; then
100 SSLFLAGS="`$PKG_CONFIG --cflags openssl`"
102 AC_MSG_WARN([OpenSSL not supported by pkg-config, try --with-openssl instead])
107 AC_MSG_CHECKING(for OpenSSL cflags)
108 AC_MSG_RESULT($SSLFLAGS)
109 CPPFLAGS="$SSLFLAGS $CPPFLAGS"
111 AC_CHECK_HEADER([openssl/x509.h],,AC_MSG_ERROR([unable to find openssl header files]))
119 # Thank you Solaris, really.
120 AC_MSG_CHECKING(for ctime_r)
121 if test -z "$ac_cv_ctime_args"; then
123 [AC_LANG_PROGRAM([[#include <time.h>]], [[time_t clock; char buf[26]; ctime_r(&clock, buf);]])],
124 [ac_cv_ctime_args=2],[])
127 [AC_LANG_PROGRAM([[#include <time.h>]], [[time_t clock; char buf[26]; ctime_r(&clock, buf, 26);]])],
128 [ac_cv_ctime_args=3],[])
130 if test -z "$ac_cv_ctime_args"; then
133 if test "$ac_cv_ctime_args" = 2; then
134 AC_DEFINE([HAVE_CTIME_R_2],[1],[Define if ctime_r is present with 2 parameters.])
135 elif test "$ac_cv_ctime_args" = 3; then
136 AC_DEFINE([HAVE_CTIME_R_3],[1],[Define if ctime_r is present with 3 parameters.])
138 AC_MSG_RESULT([yes, and it takes $ac_cv_ctime_args arguments])
141 # log4shib settings (favor this version over the log4cpp code)
142 AC_PATH_PROG(LOG4SHIB_CONFIG,log4shib-config)
143 AC_ARG_WITH(log4shib,
144 AS_HELP_STRING([--with-log4shib=PATH],[where log4shib-config is installed]),
146 LOG4SHIB_CONFIG="${with_log4shib}"
147 if ! test -f "${LOG4SHIB_CONFIG}"; then
148 LOG4SHIB_CONFIG="${with_log4shib}/bin/log4shib-config"
151 if test -f "${LOG4SHIB_CONFIG}" ; then
152 LIBS="`${LOG4SHIB_CONFIG} --libs` $LIBS"
153 CPPFLAGS="`${LOG4SHIB_CONFIG} --cflags` $CPPFLAGS"
154 AC_CHECK_HEADER([log4shib/CategoryStream.hh],,AC_MSG_ERROR([unable to find log4shib header files]))
156 [AC_LANG_PROGRAM([[#include <log4shib/Category.hh>
157 #include <log4shib/CategoryStream.hh>]],
158 [[log4shib::Category::getInstance("foo").errorStream() << log4shib::eol]])],
159 [AC_DEFINE([SHIBSP_LOG4SHIB],[1],[Define to 1 if log4shib library is used.])],
160 [AC_MSG_ERROR([unable to link with log4shib])])
162 AC_MSG_WARN([log4shib-config not found, may need to use --with-log4shib option])
163 AC_MSG_WARN([will look for original log4cpp library])
166 AC_PATH_PROG(LOG4CPP_CONFIG,log4cpp-config)
168 AS_HELP_STRING([--with-log4cpp=PATH],[where log4cpp-config is installed]),
170 LOG4CPP_CONFIG="${with_log4cpp}"
171 if ! test -f "${LOG4CPP_CONFIG}"; then
172 LOG4CPP_CONFIG="${with_log4cpp}/bin/log4cpp-config"
175 if test -f "${LOG4CPP_CONFIG}"; then
176 AC_MSG_WARN([will try to use log4cpp, note that most non-Internet2 supplied versions are not thread-safe])
177 LIBS="`${LOG4CPP_CONFIG} --libs` $LIBS"
178 CPPFLAGS="`${LOG4CPP_CONFIG} --cflags` $CPPFLAGS"
179 AC_CHECK_HEADER([log4cpp/CategoryStream.hh],,AC_MSG_ERROR([unable to find log4cpp header files]))
181 [AC_LANG_PROGRAM([[#include <log4cpp/Category.hh>
182 #include <log4cpp/CategoryStream.hh>]],
183 [[log4cpp::Category::getInstance("foo").errorStream() << log4cpp::eol]])],
184 [AC_DEFINE([SHIBSP_LOG4CPP],[1],[Define to 1 if log4cpp library is used.])],
185 [AC_MSG_ERROR([unable to link with log4cpp, need version 1.0 or later])])
187 AC_MSG_ERROR([log4cpp-config not found, may need to use --with-log4cpp option])
193 AS_HELP_STRING([--with-xerces=PATH],[where xerces-c is installed]),
194 [if test x_$with_xerces != x_/usr; then
195 LDFLAGS="-L${with_xerces}/lib $LDFLAGS"
196 CPPFLAGS="-I${with_xerces}/include $CPPFLAGS"
198 LIBS="-lxerces-c $LIBS"
199 AC_CHECK_HEADER([xercesc/dom/DOM.hpp],,AC_MSG_ERROR([unable to find xerces header files]))
200 AC_MSG_CHECKING([Xerces version])
202 [AC_LANG_PROGRAM([#include <xercesc/util/XercesVersion.hpp>],
203 [#if _XERCES_VERSION != 20600
206 #error cannot use version 2.6.0
209 [AC_MSG_FAILURE([Xerces-C v2.6.0 has bugs that inhibit use with signed XML, please use a newer version])])
211 [AC_LANG_PROGRAM([[#include <xercesc/util/PlatformUtils.hpp>]],[[xercesc::XMLPlatformUtils::Initialize()]])],
212 ,[AC_MSG_ERROR([unable to link with Xerces])])
214 AC_MSG_CHECKING([whether Xerces XMLString::release(XMLByte**) exists])
216 [AC_LANG_PROGRAM([[#include <xercesc/util/XMLString.hpp>]],
217 [[using namespace XERCES_CPP_NAMESPACE; XMLByte* buf=NULL; XMLString::release(&buf);]])],
218 [AC_MSG_RESULT([yes])AC_DEFINE([SHIBSP_XERCESC_HAS_XMLBYTE_RELEASE],[1],[Define to 1 if Xerces XMLString includes XMLByte release.])],
219 [AC_MSG_RESULT([no])])
221 AC_MSG_CHECKING([whether Xerces DOMNodeFilter API returns a short])
223 [AC_LANG_PROGRAM([[#include <xercesc/dom/DOM.hpp>]],
224 [[using namespace XERCES_CPP_NAMESPACE;
225 class Blocker : public DOMNodeFilter {
227 short acceptNode(const DOMNode* node) const {
228 return FILTER_REJECT;
231 static Blocker g_Blocker;
233 [AC_MSG_RESULT([yes])AC_DEFINE([SHIBSP_XERCESC_SHORT_ACCEPTNODE],[1],[Define to 1 if Xerces DOMNodeFilter API returns a short.])],
234 [AC_MSG_RESULT([no])])
236 #XML-Tooling settings
237 AC_ARG_WITH(xmltooling,
238 AS_HELP_STRING([--with-xmltooling=PATH],[where xmltooling is installed]),
239 [if test x_$with_xmltooling != x_/usr; then
240 LDFLAGS="-L${with_xmltooling}/lib $LDFLAGS"
241 CPPFLAGS="-I${with_xmltooling}/include $CPPFLAGS"
242 DX_INCLUDE="${with_xmltooling}/include"
244 LITE_LIBS="-lxmltooling-lite"
245 XMLSEC_LIBS="-lxmltooling"
246 AC_CHECK_HEADER([xmltooling/base.h],,AC_MSG_ERROR([unable to find xmltooling header files]))
249 # save and append master libs
251 LIBS="$XMLSEC_LIBS $LIBS"
254 [AC_LANG_PROGRAM([[#include <xmltooling/XMLToolingConfig.h>
255 #include <xmltooling/version.h>]],
256 [[#if _XMLTOOLING_VERSION >= 10400
257 xmltooling::XMLToolingConfig::getConfig();
259 #error Need XMLTooling version 1.4 or higher
261 ,[AC_MSG_ERROR([unable to link with XMLTooling, or version was too old])])
263 # restore master libs
266 # Establish location of xmltooling catalog.
268 if test "x$with_xmltooling" = "x" ; then
269 with_xmltooling="/usr"
271 if test -f $with_xmltooling/share/xml/xmltooling/catalog.xml ; then
272 XMLTOOLINGXMLDIR="$with_xmltooling"
273 elif test -f $with_xerces/share/xml/xmltooling/catalog.xml ; then
274 XMLTOOLINGXMLDIR="$with_xerces"
275 elif test -f $with_log4shib/share/xml/xmltooling/catalog.xml ; then
276 XMLTOOLINGXMLDIR="$with_log4shib"
278 if test "x$XMLTOOLINGXMLDIR" = "x" ; then
279 AC_MSG_ERROR([xmltooling XML catalog not found, may need to use --with-xmltooling option])
281 XMLTOOLINGXMLDIR="$XMLTOOLINGXMLDIR/share/xml/xmltooling"
282 AC_SUBST(XMLTOOLINGXMLDIR)
284 # XML-Security settings
286 AS_HELP_STRING([--with-xmlsec=PATH],[where xmlsec is installed]),,
289 if test x_$with_xmlsec != x_/usr; then
290 LDFLAGS="-L${with_xmlsec}/lib $LDFLAGS"
291 CPPFLAGS="-I${with_xmlsec}/include $CPPFLAGS"
293 XMLSEC_LIBS="-lxml-security-c $XMLSEC_LIBS"
295 # save and append master libs
297 LIBS="$XMLSEC_LIBS $LIBS"
299 AC_CHECK_HEADER([xsec/utils/XSECPlatformUtils.hpp],,AC_MSG_ERROR([unable to find XML-Security-C header files]))
300 AC_MSG_CHECKING([XML-Security-C version])
302 [AC_LANG_PROGRAM([#include <xsec/utils/XSECPlatformUtils.hpp>],
303 [#if XSEC_VERSION_MAJOR > 1 || (XSEC_VERSION_MAJOR == 1 && XSEC_VERSION_MEDIUM > 3)
306 #error need version 1.4.0 or later
309 [AC_MSG_FAILURE([XML-Security-C version 1.4.0 or greater is required.])])
311 [AC_LANG_PROGRAM([[#include <xsec/utils/XSECPlatformUtils.hpp>]],
312 [[XSECPlatformUtils::Initialise()]])],,
313 [AC_MSG_ERROR([unable to link with XML-Security])])
316 AC_MSG_CHECKING([whether XML-Security-C supports white/blacklisting of algorithms])
317 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <xsec/framework/XSECAlgorithmMapper.hpp>]], [[XSECAlgorithmMapper* mapper; mapper->whitelistAlgorithm(NULL);]])],[AC_MSG_RESULT([yes])
318 AC_DEFINE([SHIBSP_XMLSEC_WHITELISTING],[1],[Define to 1 if XML-Security-C supports white/blacklisting algorithms.])],[AC_MSG_RESULT([no])])
321 # restore master libs
326 AS_HELP_STRING([--with-saml=PATH],[where saml is installed]),
327 [if test x_$with_saml != x_/usr; then
328 LDFLAGS="-L${with_saml}/lib $LDFLAGS"
329 CPPFLAGS="-I${with_saml}/include $CPPFLAGS"
330 DX_INCLUDE="$DX_INCLUDE ${with_saml}/include"
332 XMLSEC_LIBS="-lsaml $XMLSEC_LIBS"
334 # save and append master libs
336 LIBS="$XMLSEC_LIBS $LIBS"
338 AC_CHECK_HEADER([saml/saml2/metadata/Metadata.h],,AC_MSG_ERROR([unable to find OpenSAML header files]))
340 [AC_LANG_PROGRAM([[#include <saml/SAMLConfig.h>
341 #include <saml/version.h>]],
342 [[#if _OPENSAML_VERSION >= 20400
343 opensaml::SAMLConfig::getConfig();
345 #error Need OpenSAML version 2.4 or higher
347 ,[AC_MSG_ERROR([unable to link with OpenSAML, or version was too old])
350 # restore master libs
353 # Establish location of opensaml catalogs.
355 if test "x$with_saml" = "x" ; then
358 if test -f $with_saml/share/xml/opensaml/saml20-catalog.xml ; then
359 OPENSAMLXMLDIR="$with_saml"
360 elif test -f $with_xmltooling/share/xml/opensaml/saml20-catalog.xml ; then
361 OPENSAMLXMLDIR="$with_xmltooling"
362 elif test -f $with_xerces/share/xml/opensaml/saml20-catalog.xml ; then
363 OPENSAMLXMLDIR="$with_xerces"
364 elif test -f $with_log4shib/share/xml/opensaml/saml20-catalog.xml ; then
365 OPENSAMLXMLDIR="$with_log4shib"
367 if test "x$OPENSAMLXMLDIR" = "x" ; then
368 AC_MSG_ERROR([opensaml XML catalogs not found, may need to use --with-saml option])
370 OPENSAMLXMLDIR="$OPENSAMLXMLDIR/share/xml/opensaml"
371 AC_SUBST(OPENSAMLXMLDIR)
374 AC_SUBST(XMLSEC_LIBS)
376 # output the underlying makefiles
377 WANT_SUBDIRS="doc schemas configs shibsp shibd util"
378 AC_CONFIG_FILES([Makefile doc/Makefile schemas/Makefile \
379 configs/Makefile shibsp/Makefile shibd/Makefile \
380 util/Makefile selinux/Makefile])
383 AC_CONFIG_FILES([adfs/Makefile])
384 AC_ARG_ENABLE([adfs],
385 AS_HELP_STRING([--disable-adfs],[don't build the ADFS module]),
386 [adfs_enabled=$enableval], [adfs_enabled=yes])
387 if test "x$adfs_enabled" = "x" ; then
390 AC_MSG_CHECKING(whether to build the ADFS module)
391 if test "$adfs_enabled" = "no" ; then
395 WANT_SUBDIRS="$WANT_SUBDIRS adfs"
400 # Build NSAPI module?
402 AC_MSG_CHECKING(for NSAPI module option)
404 AS_HELP_STRING([--with-nsapi=DIR],[Build NSAPI module for Netscape/iPlanet/SunONE]),
405 [WANT_NSAPI=$withval],[WANT_NSAPI=no])
406 AC_MSG_RESULT($WANT_NSAPI)
408 if test "$WANT_NSAPI" != "no"; then
409 if test ! -d $WANT_NSAPI/bin ; then
410 AC_MSG_ERROR([Please specify the path to the root of your Netscape/iPlanet/SunONE server using --with-nsapi=DIR])
412 AC_MSG_CHECKING(for NSAPI include files)
413 if test -d $WANT_NSAPI/include ; then
414 NSAPI_INCLUDE=$WANT_NSAPI/include
415 AC_MSG_RESULT(Netscape-Enterprise 3.x style)
416 AC_CHECK_HEADERS([$NSAPI_INCLUDE/nsapi.h],,,[#define XP_UNIX])
417 NSAPI_INCLUDE="$NSAPI_INC_DIR -I$NSAPI_INCLUDE"
419 if test -d $WANT_NSAPI/plugins/include ; then
420 test -n "$NSAPI_INCLUDE" && NSAPI_INC_DIR="-I$NSAPI_INCLUDE"
421 NSAPI_INCLUDE="$WANT_NSAPI/plugins/include"
422 AC_MSG_RESULT(iPlanet 4.x / SunONE 6.x style)
423 AC_CHECK_HEADERS([$NSAPI_INCLUDE/nsapi.h],,,[#define XP_UNIX])
424 NSAPI_INCLUDE="$NSAPI_INC_DIR -I$NSAPI_INCLUDE"
426 if test "$NSAPI_INCLUDE" = ""; then
427 AC_MSG_ERROR([Please check you have nsapi.h in either $WANT_NSAPI/include or $WANT_NSAPI/plugins/include])
431 AC_SUBST(NSAPI_INCLUDE)
433 # always output the Makefile, even if you don't use it
434 AC_CONFIG_FILES([nsapi_shib/Makefile])
435 AM_CONDITIONAL(BUILD_NSAPI,test ! "$WANT_NSAPI" = "no")
437 # add the NSAPI module to the list of wanted subdirs..
438 if test ! "$WANT_NSAPI" = "no" ; then
439 WANT_SUBDIRS="$WANT_SUBDIRS nsapi_shib"
444 # Build FastCGI support?
446 AC_MSG_CHECKING(for FastCGI support)
448 AS_HELP_STRING([--with-fastcgi=DIR],[Build FastCGI support]),
449 [WANT_FASTCGI=$withval],[WANT_FASTCGI=no])
450 AC_MSG_RESULT($WANT_FASTCGI)
452 if test "$WANT_FASTCGI" != "no"; then
453 if test "$WANT_FASTCGI" != "yes"; then
454 if test x_$WANT_FASTCGI != x_/usr; then
455 FASTCGI_INCLUDE="-I$WANT_FASTCGI/include"
456 FASTCGI_LDFLAGS="-L$WANT_FASTCGI/lib"
459 AC_CHECK_HEADER([fcgio.h],,AC_MSG_ERROR([unable to find FastCGI header files]))
460 FASTCGI_LIBS="-lfcgi -lfcgi++"
463 AC_SUBST(FASTCGI_INCLUDE)
464 AC_SUBST(FASTCGI_LDFLAGS)
465 AC_SUBST(FASTCGI_LIBS)
467 # always output the Makefile, even if you don't use it
468 AC_CONFIG_FILES([fastcgi/Makefile])
469 AM_CONDITIONAL(BUILD_FASTCGI,test ! "$WANT_FASTCGI" = "no")
471 if test ! "$WANT_FASTCGI" = "no" ; then
472 WANT_SUBDIRS="$WANT_SUBDIRS fastcgi"
476 # Build Memcached support?
478 AC_MSG_CHECKING(for Memcached support)
479 AC_ARG_WITH(memcached,
480 AS_HELP_STRING([--with-memcached=DIR],[Build Memcached support]),
481 [WANT_MEMCACHED=$withval],[WANT_MEMCACHED=no])
482 AC_MSG_RESULT($WANT_MEMCACHED)
484 if test "$WANT_MEMCACHED" != "no"; then
485 if test "$WANT_MEMCACHED" != "yes"; then
486 if test x_$WANT_MEMCACHED != x_/usr; then
487 MEMCACHED_INCLUDE="-I$WANT_MEMCACHED/include"
488 MEMCACHED_LDFLAGS="-L$WANT_MEMCACHED/lib"
491 AC_CHECK_HEADER([libmemcached/memcached.h],,
492 AC_MSG_ERROR([unable to find Memcached header files]))
493 MEMCACHED_LIBS="-lmemcached"
496 AC_SUBST(MEMCACHED_INCLUDE)
497 AC_SUBST(MEMCACHED_LDFLAGS)
498 AC_SUBST(MEMCACHED_LIBS)
500 # always output the Makefile, even if you don't use it
501 AC_CONFIG_FILES([memcache-store/Makefile])
502 AM_CONDITIONAL(BUILD_MEMCACHED,test ! "$WANT_MEMCACHED" = "no")
504 if test ! "$WANT_MEMCACHED" = "no" ; then
505 WANT_SUBDIRS="$WANT_SUBDIRS memcache-store"
510 # If no --enable-apache-xx specified
511 # find a default and fake the specific parameters
514 # simple macro to peek at an enable or a with
516 if test "[${[$1]_][$2]+set}" = set; then
517 peekval="${[$1]_[$2]}"
522 AC_MSG_CHECKING(if default apache needed)
524 Peek(enable,apache_13,need_default=no)
525 Peek(enable,apache_20,need_default=no)
526 Peek(enable,apache_22,need_default=no)
527 AC_MSG_RESULT($need_default)
529 if test "$need_default" = "yes"; then
530 # find an apxs, then the httpd
532 Peek(with,apxs,xs="$peekval")
533 Peek(with,apxs2,xs="$peekval")
534 Peek(with,apxs22,xs="$peekval")
535 if test "x$xs" = "x"; then
536 AC_PATH_PROGS(xs, apxs2 apxs,
537 AC_MSG_ERROR(No apxs, no apache found. Try --with-apxs),
538 [/usr/local/apache2/bin:/usr/local/apache/bin:/usr/sbin:$PATH])
540 # ask the daemon for the version and set parameters
541 AC_MSG_CHECKING(default apache version)
542 httpd="`$xs -q SBINDIR`/`$xs -q TARGET`"
543 if test "x$httpd" != "x" && test -f $httpd ; then
544 v=`$httpd -v|$SED -n -e 's/.*Apache\/\.*//p'`
546 1.3*) [enable_apache_13]=yes
550 2.0*) [enable_apache_20]=yes
554 2.2*) [enable_apache_22]=yes
558 *) AC_MSG_ERROR(unusable apache versions: $v. Try setting --with-apxs)
561 AC_MSG_RESULT(cannot determine version. Try setting --with-apxs)
565 # Apache 1.3 (mod_shib_13)
567 # --with-apxs (DSO build, the normal way, uses apxs to derive build flags)
569 AC_ARG_ENABLE(apache-13,
570 AS_HELP_STRING([--enable-apache-13],[enable the Apache 1.3 module]),
571 [if test "x$enableval" = "x" ; then
574 WANT_APACHE_13="$enableval"
576 ],[ WANT_APACHE_13=no ])
577 AC_MSG_CHECKING(whether to build Apache 1.3 module)
578 if test "$WANT_APACHE_13" != yes && test "$WANT_APACHE_13" != no ; then
581 AC_MSG_RESULT($WANT_APACHE_13)
583 if test "$WANT_APACHE_13" = "yes" ; then
585 AS_HELP_STRING([--with-apxs=FILE],[Specifies where to find the Apache 1.3 apxs script.]),
587 AC_MSG_CHECKING(for user-specified apxs name/location)
588 if test "$withval" != "no" ; then
589 if test "$withval" != "yes"; then
591 AC_MSG_RESULT("$withval")
596 AC_PATH_PROG(APXS, apxs, no)
597 if test "$APXS" = "no" ; then
598 for i in /usr/sbin /usr/local/apache/bin ; do
599 if test "$APXS" = "no" && test -f "$i/apxs"; then
606 AC_MSG_CHECKING([to see if apxs was located])
607 if test ! -f "$APXS" ; then
609 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.])
614 # extract settings we need from APXS -q
615 APXS_CC="`$APXS -q CC`"
616 APXS_CFLAGS="`$APXS -q CFLAGS` `$APXS -q CFLAGS_SHLIB`"
617 APXS_INCLUDE="`$APXS -q INCLUDEDIR`"
620 AC_SUBST(APXS_CFLAGS)
621 AC_SUBST(APXS_INCLUDE)
624 # Apache 2.0 (mod_shib_20)
626 # --with-apxs2 (DSO build, the normal way, uses apxs to derive build flags)
627 # --with-apr (DSO build, APR development package installed separately)
628 # --with-apu (DSO build, APR-UTIL development package installed separately)
630 AC_ARG_ENABLE(apache-20,
631 AS_HELP_STRING([--enable-apache-20],[enable the Apache 2.0 module]),
632 [if test "x$enableval" = "x" ; then
635 WANT_APACHE_20="$enableval"
637 ],[ WANT_APACHE_20=no ])
638 AC_MSG_CHECKING(whether to build Apache 2.0 module)
639 if test "$WANT_APACHE_20" != yes && test "$WANT_APACHE_20" != no ; then
642 AC_MSG_RESULT($WANT_APACHE_20)
644 if test "$WANT_APACHE_20" = "yes" ; then
646 AS_HELP_STRING([--with-apxs2=FILE],[Specifies where to find the Apache 2.0 apxs script.]),
648 AC_MSG_CHECKING(for user-specified Apache2 apxs name/location)
649 if test "$withval" != "no" ; then
650 if test "$withval" != "yes"; then
652 AC_MSG_RESULT("$withval")
657 AC_PATH_PROG(APXS2, apxs2, no)
658 if test "$APXS2" = "no" ; then
659 AC_PATH_PROG(APXS2, apxs, no)
661 if test "$APXS2" = "no" ; then
662 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
663 if test "$APXS2" = "no" && test -f "$i/apxs2" ; then
667 if test "$APXS2" = "no" ; then
668 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
669 if test "$APXS2" = "no" && test -f "$i/apxs" ; then
677 AC_MSG_CHECKING([to see if Apache2 apxs was located])
678 if test ! -f "$APXS2" ; then
680 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.])
682 AC_MSG_RESULT($APXS2)
687 AS_HELP_STRING([--with-apr=PATH],[where apr-config is installed]),
689 AC_MSG_CHECKING(for user-specified apr-config name/location)
690 if test "$withval" != "no" ; then
691 if test "$withval" != "yes"; then
693 AC_MSG_RESULT("$withval")
698 AC_PATH_PROG(APR_CONFIG, apr-config,,[`$APXS2 -q SBINDIR`]:[$PATH])
700 if test -f "${APR_CONFIG}"; then
701 APR_CFLAGS="`${APR_CONFIG} --cflags` `${APR_CONFIG} --cppflags` `${APR_CONFIG} --includes`"
703 AC_MSG_ERROR([Unable to locate apr-config, may need --with-apr option.])
708 AS_HELP_STRING([--with-apu=PATH],[where apu-config is installed]),
710 AC_MSG_CHECKING(for user-specified apu-config name/location)
711 if test "$withval" != "no" ; then
712 if test "$withval" != "yes"; then
714 AC_MSG_RESULT("$withval")
719 AC_PATH_PROG(APU_CONFIG, apu-config,,[`$APXS2 -q SBINDIR`]:[$PATH])
721 if test -f "${APU_CONFIG}"; then
722 APU_CFLAGS="`${APU_CONFIG} --includes`"
724 AC_MSG_ERROR([Unable to locate apu-config, may need --with-apu option.])
727 # extract settings we need from APXS2 -q
728 APXS2_CC="`$APXS2 -q CC`"
729 APXS2_CFLAGS="`$APXS2 -q CPPFLAGS` `$APXS2 -q CFLAGS` $APR_CFLAGS $APU_CFLAGS"
730 APXS2_INCLUDE="`$APXS2 -q INCLUDEDIR`"
733 AC_SUBST(APXS2_CFLAGS)
734 AC_SUBST(APXS2_INCLUDE)
737 # Apache 2.2 (mod_shib_22)
739 # --with-apxs22 (DSO build, the normal way, uses apxs to derive build flags)
740 # --with-apr1 (DSO build, APR development package installed separately)
741 # --with-apu1 (DSO build, APR-UTIL development package installed separately)
743 AC_ARG_ENABLE(apache-22,
744 AS_HELP_STRING([--enable-apache-22],[enable the Apache 2.2 module]),
745 [if test "x$enableval" = "x" ; then
748 WANT_APACHE_22="$enableval"
750 ],[ WANT_APACHE_22=no ])
751 AC_MSG_CHECKING(whether to build Apache 2.2 module)
752 if test "$WANT_APACHE_22" != yes && test "$WANT_APACHE_22" != no ; then
755 AC_MSG_RESULT($WANT_APACHE_22)
757 if test "$WANT_APACHE_22" = "yes" ; then
759 AS_HELP_STRING([--with-apxs22=FILE],[Specifies where to find the Apache 2.2 apxs script.]),
761 AC_MSG_CHECKING(for user-specified Apache2.2 apxs name/location)
762 if test "$withval" != "no" ; then
763 if test "$withval" != "yes"; then
765 AC_MSG_RESULT("$withval")
770 AC_PATH_PROG(APXS22, apxs2, no)
771 if test "$APXS22" = "no" ; then
772 AC_PATH_PROG(APXS22, apxs, no)
774 if test "$APXS22" = "no" ; then
775 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
776 if test "$APXS22" = "no" && test -f "$i/apxs2" ; then
780 if test "$APXS22" = "no" ; then
781 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
782 if test "$APXS22" = "no" && test -f "$i/apxs" ; then
790 AC_MSG_CHECKING([to see if Apache2.2 apxs was located])
791 if test ! -f "$APXS22" ; then
793 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.])
795 AC_MSG_RESULT($APXS22)
800 AS_HELP_STRING([--with-apr1=PATH],[where apr-1-config is installed]),
802 AC_MSG_CHECKING(for user-specified apr-1-config name/location)
803 if test "$withval" != "no" ; then
804 if test "$withval" != "yes"; then
806 AC_MSG_RESULT("$withval")
811 AC_PATH_PROG(APR1_CONFIG, apr-1-config,,[`$APXS22 -q SBINDIR`]:[$PATH])
813 if test -f "${APR1_CONFIG}"; then
814 APR1_CFLAGS="`${APR1_CONFIG} --cflags` `${APR1_CONFIG} --cppflags` `${APR1_CONFIG} --includes`"
816 AC_MSG_ERROR([Unable to locate apr-1-config, may need --with-apr1 option.])
821 AS_HELP_STRING([--with-apu1=PATH],[where apu-1-config is installed]),
823 AC_MSG_CHECKING(for user-specified apu-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(APU1_CONFIG, apu-1-config,,[`$APXS22 -q SBINDIR`]:[$PATH])
834 if test -f "${APU1_CONFIG}"; then
835 APU1_CFLAGS="`${APU1_CONFIG} --includes`"
837 AC_MSG_ERROR([Unable to locate apu-1-config, may need --with-apu1 option.])
840 # extract settings we need from APXS22 -q
841 APXS22_CC="`$APXS22 -q CC`"
842 APXS22_CFLAGS="`$APXS22 -q CPPFLAGS` `$APXS22 -q CFLAGS` $APR1_CFLAGS $APU1_CFLAGS"
843 APXS22_INCLUDE="`$APXS22 -q INCLUDEDIR`"
846 AC_SUBST(APXS22_CFLAGS)
847 AC_SUBST(APXS22_INCLUDE)
849 # always output the Makefile, even if you don't use it
850 AC_CONFIG_FILES([apache/Makefile])
851 AM_CONDITIONAL(BUILD_AP13,test "$WANT_APACHE_13" = "yes")
852 AM_CONDITIONAL(BUILD_AP20,test "$WANT_APACHE_20" = "yes")
853 AM_CONDITIONAL(BUILD_AP22,test "$WANT_APACHE_22" = "yes")
855 # add the apache module to the list of wanted subdirs..
856 if test "$WANT_APACHE_13" = "yes" || test "$WANT_APACHE_20" = "yes" || test "$WANT_APACHE_22" = "yes" ; then
857 WANT_SUBDIRS="$WANT_SUBDIRS apache"
862 # Implement the checks of the ODBC Storage Service
864 # 1) Assume the user wants ODBC; if it's not found then just continue without
865 # 2) If the user specifically requested odbc, look for it and ERROR if not found
866 # 3) If the user specifically requested no odbc, don't build it.
869 AC_CONFIG_FILES([odbc-store/Makefile])
871 # determine whether we should enable the odbc ccache
872 AC_ARG_ENABLE([odbc],
873 AS_HELP_STRING([--disable-odbc],[disable the ODBC Storage Service]),
874 [odbc_enabled=$enableval], [odbc_enabled=default])
875 if test "x$odbc_enabled" = "x" ; then
879 # Are we trying to build ODBC?
880 AC_MSG_CHECKING(whether to build the ODBC storage service)
881 if test "$odbc_enabled" = "yes" ; then
884 elif test "$odbc_enabled" = "default" ; then
886 AC_MSG_RESULT([yes, if it can be found])
892 # If we're trying to build ODBC, try to find the odbc_config program.
893 if test "$build_odbc" = "yes" ; then
896 AS_HELP_STRING([--with-odbc=PATH],[directory where odbc is installed]),
897 [if test "$with_odbc" = no ; then
898 AC_MSG_ERROR([Try running --disable-odbc instead.])
899 elif test "$with_odbc" != yes ; then
900 odbc_dir="$with_odbc/bin"
901 if test "$with_odbc" != /usr ; then
902 ODBC_CFLAGS="-I$with_odbc/include"
903 ODBC_LIBS="-L$with_odbc/lib"
907 AC_PATH_PROG(ODBC_CONFIG, odbc_config, no, $odbc_dir $PATH )
908 if test "$ODBC_CONFIG" = no ; then
909 AC_MSG_WARN([Cannot find odbc_config, will try to guess settings.])
910 ODBC_LIBS="$ODBC_LIBS -lodbc"
912 ODBC_CFLAGS=`$ODBC_CONFIG --cflags`
913 ODBC_LIBS=`$ODBC_CONFIG --libs`
916 save_CPPFLAGS="$CPPFLAGS"
917 CPPFLAGS="$CPPFLAGS $ODBC_CFLAGS"
919 AC_CHECK_HEADER([sql.h], [have_sql_h=yes], [have_sql_h=no])
920 if test "$have_sql_h" = no -a "$odbc_enabled" = "yes" ; then
921 AC_MSG_ERROR(unable to find ODBC header files)
924 if test "$have_sql_h" = yes ; then
926 LIBS="$LIBS $ODBC_LIBS"
927 AC_MSG_CHECKING(if we can link againt ODBC)
929 [AC_LANG_PROGRAM([[#include <sql.h>
931 #include <stdio.h>]],
932 [[SQLSetEnvAttr(SQL_NULL_HANDLE, SQL_ATTR_CONNECTION_POOLING, (void*)SQL_CP_ONE_PER_HENV, 0)]])],
933 [have_odbc_libs=yes],[have_odbc_libs=no])
935 if test "$have_odbc_libs" = no ; then
936 if test "$odbc_enabled" = "yes" ; then
937 AC_MSG_ERROR([unable to link with ODBC Library])
939 AC_MSG_RESULT([no, skipping ODBC])
944 CPPFLAGS="$save_CPPFLAGS"
947 # if have_odbc_libs=yes then go ahead with building ODBC
948 if test "$have_odbc_libs" = yes ; then
949 # this AC_MSG_RESULT is from above!
951 WANT_SUBDIRS="$WANT_SUBDIRS odbc-store"
952 AC_SUBST(ODBC_CFLAGS)
959 AC_ARG_WITH(gssapi-includes,
960 AS_HELP_STRING([--with-gssapi-includes=DIR],[Specify location of GSSAPI header]),
961 [ GSSAPI_INCS="-I$withval"
965 AC_ARG_WITH(gssapi-libs,
966 AS_HELP_STRING([--with-gssapi-libs=DIR],[Specify location of GSSAPI libs]),
967 [ GSSAPI_LIB_DIR="-L$withval"
972 AS_HELP_STRING([--with-gssapi=DIR],[Where to look for GSSAPI]),
973 [ GSSAPI_ROOT="$withval"
974 if test x"$GSSAPI_ROOT" != xno; then
976 if test x"$GSSAPI_ROOT" = xyes; then
977 dnl if yes, then use default root
983 save_CPPFLAGS="$CPPFLAGS"
984 AC_MSG_CHECKING([if GSSAPI support is requested])
985 if test x"$want_gss" = xyes; then
988 if test -z "$GSSAPI_INCS"; then
989 if test -f "$GSSAPI_ROOT/bin/krb5-config"; then
990 GSSAPI_INCS=`$GSSAPI_ROOT/bin/krb5-config --cflags gssapi`
991 elif test "$GSSAPI_ROOT" != "yes"; then
992 GSSAPI_INCS="-I$GSSAPI_ROOT/include"
996 CPPFLAGS="$CPPFLAGS $GSSAPI_INCS"
998 AC_CHECK_HEADER(gss.h,
1000 dnl found in the given dirs
1001 AC_DEFINE([HAVE_GSSGNU],[1],[if you have the GNU gssapi libraries])
1005 dnl not found, check Heimdal or MIT
1006 AC_CHECK_HEADERS([gssapi/gssapi.h], [], [not_mit=1])
1008 [gssapi/gssapi_generic.h gssapi/gssapi_krb5.h],
1013 #ifdef HAVE_GSSAPI_GSSAPI_H
1014 #include <gssapi/gssapi.h>
1017 if test "x$not_mit" = "x1"; then
1018 dnl MIT not found, check for Heimdal
1019 AC_CHECK_HEADER([gssapi.h],
1022 AC_DEFINE([HAVE_GSSHEIMDAL],[1],[if you have the Heimdal gssapi libraries])
1025 dnl no header found, disabling GSS
1027 AC_MSG_WARN([disabling GSSAPI since no header files was found])
1032 AC_DEFINE([HAVE_GSSMIT],[1],[if you have the MIT gssapi libraries])
1033 dnl check if we have a really old MIT kerberos (<= 1.2)
1034 AC_MSG_CHECKING([if gssapi headers declare GSS_C_NT_HOSTBASED_SERVICE])
1037 #include <gssapi/gssapi.h>
1038 #include <gssapi/gssapi_generic.h>
1039 #include <gssapi/gssapi_krb5.h>
1044 GSS_C_NT_HOSTBASED_SERVICE,
1048 AC_MSG_RESULT([yes])
1051 AC_DEFINE([HAVE_OLD_GSSMIT],[1],[if you have an old MIT gssapi library, lacking GSS_C_NT_HOSTBASED_SERVICE])
1059 if test x"$want_gss" = xyes; then
1060 AC_DEFINE([HAVE_GSSAPI],[1],[if you have the gssapi libraries])
1062 if test -n "$gnu_gss"; then
1063 LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
1065 elif test -z "$GSSAPI_LIB_DIR"; then
1068 LIBS="$LIBS -lgssapi_krb5 -lresolv"
1071 if test -f "$GSSAPI_ROOT/bin/krb5-config"; then
1072 dnl krb5-config doesn't have --libs-only-L or similar, put everything
1074 gss_libs=`$GSSAPI_ROOT/bin/krb5-config --libs gssapi`
1075 LIBS="$LIBS $gss_libs"
1076 elif test "$GSSAPI_ROOT" != "yes"; then
1077 LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff"
1078 LIBS="$LIBS -lgssapi"
1080 LIBS="$LIBS -lgssapi"
1085 LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
1086 LIBS="$LIBS -lgssapi"
1089 CPPFLAGS="$save_CPPFLAGS"
1093 AC_SUBST(WANT_SUBDIRS)
1095 if test -n "$APXS_CC" && test "$APXS_CC" != "$CC" ; then
1096 echo "=================================================================="
1097 echo "WARNING: You have chosen to compile Apache-1.3 modules with a different"
1098 echo " compiler than the one used to compile Apache."
1100 echo " Current compiler: $CC"
1101 echo " Apache's compiler: $APXS_CC"
1103 echo "This could cause problems."
1104 echo "=================================================================="
1107 if test -n "$APXS2_CC" && test "$APXS2_CC" != "$CC" ; then
1108 echo "=================================================================="
1109 echo "WARNING: You have chosen to compile Apache-2.0 modules with a different"
1110 echo " compiler than the one used to compile Apache."
1112 echo " Current compiler: $CC"
1113 echo " Apache's compiler: $APXS2_CC"
1115 echo "This could cause problems."
1116 echo "=================================================================="
1119 if test -n "$APXS22_CC" && test "$APXS22_CC" != "$CC" ; then
1120 echo "=================================================================="
1121 echo "WARNING: You have chosen to compile Apache-2.2 modules with a different"
1122 echo " compiler than the one used to compile Apache."
1124 echo " Current compiler: $CC"
1125 echo " Apache's compiler: $APXS22_CC"
1127 echo "This could cause problems."
1128 echo "=================================================================="
1131 LIBTOOL="$LIBTOOL --silent"