2 AC_INIT([shibboleth], [2.0], [shibboleth-users@internet2.edu], [shibboleth])
3 AM_CONFIG_HEADER(config.h)
4 AM_INIT_AUTOMAKE([shibboleth],[2.0])
7 sinclude(acx_pthread.m4)
18 DX_INIT_DOXYGEN(shibboleth, doxygen.cfg, doc/api)
22 AC_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_PROG_CC([gcc gcc3 cc])
35 AC_PROG_CXX([g++ g++3 c++ CC])
38 if test "$GCC" = "yes" ; then
39 # AC_HAVE_GCC_VERSION(4,0,0,0,
41 # AC_DEFINE(GCC_HASCLASSVISIBILITY,1,
42 # [Define to enable class visibility control in gcc.])
43 # GCC_CFLAGS="$GCC_CFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
44 # GCC_CXXFLAGS="$GCC_CXXFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
46 CFLAGS="-Wall $GCC_CFLAGS"
47 CXXFLAGS="-Wall $GCC_CXXFLAGS"
49 # Fix for Sun Workshop compiler in debug mode, may be Sun case #6360993
50 case "${host_cpu}-${host_os}" in
52 if test "$CXX" = "CC" ; then
53 CXXFLAGS="$CXXFLAGS -Qoption ccfe -stabs=no%dfltlit+no%dflthlp"
64 # Checks for typedefs, structures, and compiler characteristics.
69 # Checks for library functions.
72 AC_CHECK_FUNCS([strchr strdup strstr timegm gmtime_r ctime_r strtok_r strcasecmp])
75 ACX_PTHREAD([enable_threads="pthread"],[enable_threads="no"])
76 if test $enable_threads != "pthread"; then
77 AC_MSG_ERROR([unable to find pthreads, currently this is required])
79 AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.])
80 LIBS="$PTHREAD_LIBS $LIBS"
81 CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
82 CXXFLAGS="$PTHREAD_CFLAGS $CXXFLAGS"
91 # log4shib settings (favor this version over the log4cpp code)
92 AC_PATH_PROG(LOG4SHIB_CONFIG,log4shib-config)
94 AC_HELP_STRING([--with-log4shib=PATH], [where log4shib-config is installed]),
96 LOG4SHIB_CONFIG="${with_log4shib}"
97 if ! test -f "${LOG4SHIB_CONFIG}" ; then
98 LOG4SHIB_CONFIG="${with_log4shib}/bin/log4shib-config"
101 if test -f "${LOG4SHIB_CONFIG}"; then
102 LDFLAGS="`${LOG4SHIB_CONFIG} --libs` $LDFLAGS"
103 CPPFLAGS="`${LOG4SHIB_CONFIG} --cflags` $CPPFLAGS"
104 AC_CHECK_HEADER([log4shib/CategoryStream.hh],,AC_MSG_ERROR([unable to find log4shib header files]))
106 [#include <log4shib/Category.hh>
107 #include <log4shib/CategoryStream.hh>],
108 [log4shib::Category::getInstance("foo").errorStream() << log4shib::eol],
109 [AC_DEFINE(SHIBSP_LOG4SHIB,1,[Define if log4shib library is used.])],
110 [AC_MSG_ERROR([unable to link with log4shib])])
112 AC_MSG_WARN([log4shib-config not found, may need to use --with-log4shib option])
113 AC_MSG_WARN([will look for original log4cpp library])
116 AC_PATH_PROG(LOG4CPP_CONFIG,log4cpp-config)
118 AC_HELP_STRING([--with-log4cpp=PATH], [where log4cpp-config is installed]),
120 LOG4CPP_CONFIG="${with_log4cpp}"
121 if ! test -f "${LOG4CPP_CONFIG}" ; then
122 LOG4CPP_CONFIG="${with_log4cpp}/bin/log4cpp-config"
125 if test -f "${LOG4CPP_CONFIG}"; then
126 AC_MSG_WARN([will try to use log4cpp, note that most non-Internet2 supplied versions are not thread-safe])
127 LDFLAGS="`${LOG4CPP_CONFIG} --libs` $LDFLAGS"
128 CPPFLAGS="`${LOG4CPP_CONFIG} --cflags` $CPPFLAGS"
129 AC_CHECK_HEADER([log4cpp/CategoryStream.hh],,AC_MSG_ERROR([unable to find log4cpp header files]))
131 [#include <log4cpp/Category.hh>
132 #include <log4cpp/CategoryStream.hh>],
133 [log4cpp::Category::getInstance("foo").errorStream() << log4cpp::eol],
134 [AC_DEFINE(SHIBSP_LOG4CPP,1,[Define if log4cpp library is used.])],
135 [AC_MSG_ERROR([unable to link with log4cpp, need version 1.0 or later])])
137 AC_MSG_ERROR([log4cpp-config not found, may need to use --with-log4cpp option])
143 AC_HELP_STRING([--with-xerces=PATH], [where xerces-c is installed]),
144 [if test x_$with_xerces != x_/usr; then
145 LDFLAGS="-L${with_xerces}/lib $LDFLAGS"
146 CPPFLAGS="-I${with_xerces}/include $CPPFLAGS"
148 LIBS="-lxerces-c $LIBS"
149 AC_CHECK_HEADER([xercesc/dom/DOM.hpp],,
150 AC_MSG_ERROR([unable to find xerces header files]))
151 AC_MSG_CHECKING([Xerces version])
153 [AC_LANG_PROGRAM([#include <xercesc/util/XercesVersion.hpp>],
154 [#if _XERCES_VERSION != 20600
157 #error cannot use version 2.6.0
160 [AC_MSG_FAILURE([Xerces-C v2.6.0 has bugs that inhibit use with signed XML, please use a newer version])])
162 [#include <xercesc/util/PlatformUtils.hpp>],
163 [xercesc::XMLPlatformUtils::Initialize()],
164 [AC_DEFINE(HAVE_LIBXERCESC,1,[Define if Xerces-C library was found])],
165 [AC_MSG_ERROR([unable to link with Xerces])])
168 #XML-Tooling settings
169 AC_ARG_WITH(xmltooling,
170 AC_HELP_STRING([--with-xmltooling=PATH], [where xmltooling-c is installed]),
171 [if test x_$with_xmltooling != x_/usr; then
172 LDFLAGS="-L${with_xmltooling}/lib $LDFLAGS"
173 CPPFLAGS="-I${with_xmltooling}/include $CPPFLAGS"
175 LITE_LIBS="-lxmltooling-lite"
176 XMLSEC_LIBS="-lxmltooling"
177 AC_CHECK_HEADER([xmltooling/base.h],,
178 AC_MSG_ERROR([unable to find xmltooling header files]))
181 # XML-Security settings
183 AC_HELP_STRING([--with-xmlsec=PATH], [where xmlsec is installed]),,
186 if test x_$with_xmlsec != x_/usr; then
187 LDFLAGS="-L${with_xmlsec}/lib $LDFLAGS"
188 CPPFLAGS="-I${with_xmlsec}/include $CPPFLAGS"
190 XMLSEC_LIBS="-lxml-security-c $XMLSEC_LIBS"
192 # save and append master libs
194 LIBS="$XMLSEC_LIBS $LIBS"
196 AC_CHECK_HEADER([xsec/utils/XSECPlatformUtils.hpp],,AC_MSG_ERROR([unable to find XML-Security header files]))
197 AC_MSG_CHECKING([XML-Security version])
199 [AC_LANG_PROGRAM([#include <xsec/utils/XSECPlatformUtils.hpp>],
200 [#if XSEC_VERSION_MAJOR > 1 || (XSEC_VERSION_MAJOR == 1 && XSEC_VERSION_MEDIUM > 3)
203 #error need version 1.4.0 or later
206 [AC_MSG_FAILURE([XML-Security version 1.4.0 or greater is required.])])
208 [#include <xsec/utils/XSECPlatformUtils.hpp>],
209 [XSECPlatformUtils::Initialise()],,
210 [AC_MSG_ERROR([unable to link with XML-Security])])
212 # restore master libs
217 AC_HELP_STRING([--with-saml=PATH], [where saml is installed]),
218 [if test x_$with_saml != x_/usr; then
219 LDFLAGS="-L${with_saml}/lib $LDFLAGS"
220 CPPFLAGS="-I${with_saml}/include $CPPFLAGS"
222 XMLSEC_LIBS="-lsaml $XMLSEC_LIBS"
224 # save and append master libs
226 LIBS="$XMLSEC_LIBS $LIBS"
228 AC_CHECK_HEADER([saml/saml2/metadata/Metadata.h],,
229 AC_MSG_ERROR([unable to find OpenSAML header files]))
231 [#include <saml/SAMLConfig.h>
232 #include <saml/version.h>],
233 [#if _OPENSAML_VERSION >= 20000
234 opensaml::SAMLConfig::getConfig();
236 #error Need OpenSAML version 2.0 or higher
238 [AC_DEFINE(HAVE_SAML,1,[Define if saml library was found])],
239 [AC_MSG_ERROR([unable to link with OpenSAML, or version was too old])])
241 # restore master libs
245 AC_SUBST(XMLSEC_LIBS)
247 # output the underlying makefiles
248 WANT_SUBDIRS="doc schemas configs shibsp shibd util"
249 AC_CONFIG_FILES([Makefile doc/Makefile schemas/Makefile \
250 configs/Makefile shibsp/Makefile shibd/Makefile \
251 util/Makefile selinux/Makefile])
254 AC_CONFIG_FILES([adfs/Makefile])
255 AC_ARG_ENABLE([adfs],
256 AC_HELP_STRING([--disable-adfs], [don't build the ADFS module]),
257 [adfs_enabled=$enableval], [adfs_enabled=yes])
258 if test "x$adfs_enabled" = "x" ; then
261 AC_MSG_CHECKING(whether to build the ADFS module)
262 if test "$adfs_enabled" = "no" ; then
266 WANT_SUBDIRS="$WANT_SUBDIRS adfs"
271 # Build NSAPI module?
273 AC_MSG_CHECKING(for NSAPI module option)
275 AC_HELP_STRING([--with-nsapi=DIR], [Build NSAPI module for Netscape/iPlanet/SunONE]),
276 [WANT_NSAPI=$withval],[WANT_NSAPI=no])
277 AC_MSG_RESULT($WANT_NSAPI)
279 if test "$WANT_NSAPI" != "no"; then
280 if test ! -d $WANT_NSAPI/bin ; then
281 AC_MSG_ERROR(Please specify the path to the root of your Netscape/iPlanet/SunONE server using --with-nsapi=DIR)
283 AC_MSG_CHECKING(for NSAPI include files)
284 if test -d $WANT_NSAPI/include ; then
285 NSAPI_INCLUDE=$WANT_NSAPI/include
286 AC_MSG_RESULT(Netscape-Enterprise 3.x style)
287 AC_CHECK_HEADERS([$NSAPI_INCLUDE/nsapi.h])
288 NSAPI_INCLUDE="$NSAPI_INC_DIR -I$NSAPI_INCLUDE"
290 if test -d $WANT_NSAPI/plugins/include ; then
291 test -n "$NSAPI_INCLUDE" && NSAPI_INC_DIR="-I$NSAPI_INCLUDE"
292 NSAPI_INCLUDE="$WANT_NSAPI/plugins/include"
293 AC_MSG_RESULT(iPlanet 4.x / SunONE 6.x style)
294 AC_CHECK_HEADERS([$NSAPI_INCLUDE/nsapi.h])
295 NSAPI_INCLUDE="$NSAPI_INC_DIR -I$NSAPI_INCLUDE"
297 if test "$NSAPI_INCLUDE" = ""; then
298 AC_MSG_ERROR(Please check you have nsapi.h in either $WANT_NSAPI/include or $WANT_NSAPI/plugins/include)
302 AC_SUBST(NSAPI_INCLUDE)
304 # always output the Makefile, even if you don't use it
305 AC_CONFIG_FILES([nsapi_shib/Makefile])
306 AM_CONDITIONAL(BUILD_NSAPI,test ! "$WANT_NSAPI" = "no")
308 # add the NSAPI module to the list of wanted subdirs..
309 if test ! "$WANT_NSAPI" = "no" ; then
310 WANT_SUBDIRS="$WANT_SUBDIRS nsapi_shib"
315 # Build FastCGI support?
317 AC_MSG_CHECKING(for FastCGI support)
319 AC_HELP_STRING([--with-fastcgi=DIR], [Build FastCGI support]),
320 [WANT_FASTCGI=$withval],[WANT_FASTCGI=no])
321 AC_MSG_RESULT($WANT_FASTCGI)
323 if test "$WANT_FASTCGI" != "no"; then
324 if test "$WANT_FASTCGI" != "yes"; then
325 if test x_$WANT_FASTCGI != x_/usr; then
326 FASTCGI_INCLUDE="-I$WANT_FASTCGI/include"
327 FASTCGI_LDFLAGS="-L$WANT_FASTCGI/lib"
330 AC_CHECK_HEADER([fcgio.h],,
331 AC_MSG_ERROR([unable to find FastCGI header files]))
332 FASTCGI_LIBS="-lfcgi -lfcgi++"
335 AC_SUBST(FASTCGI_INCLUDE)
336 AC_SUBST(FASTCGI_LDFLAGS)
337 AC_SUBST(FASTCGI_LIBS)
339 # always output the Makefile, even if you don't use it
340 AC_CONFIG_FILES([fastcgi/Makefile])
341 AM_CONDITIONAL(BUILD_FASTCGI,test ! "$WANT_FASTCGI" = "no")
343 if test ! "$WANT_FASTCGI" = "no" ; then
344 WANT_SUBDIRS="$WANT_SUBDIRS fastcgi"
349 # If no --enable-apache-xx specified
350 # find a default and fake the specific parameters
353 # simple macro to peek at an enable or a with
355 if test "[${[$1]_][$2]+set}" = set; then
356 peekval="${[$1]_[$2]}"
361 AC_MSG_CHECKING(if default apache needed)
363 Peek(enable,apache_13,need_default=no)
364 Peek(enable,apache_20,need_default=no)
365 Peek(enable,apache_22,need_default=no)
366 AC_MSG_RESULT($need_default)
368 if test "$need_default" = "yes"; then
369 # find an apxs, then the httpd
371 Peek(with,apxs,xs="$peekval")
372 Peek(with,apxs2,xs="$peekval")
373 Peek(with,apxs22,xs="$peekval")
374 if test "x$xs" = "x"; then
375 AC_PATH_PROGS(xs, apxs2 apxs,
376 AC_MSG_ERROR(No apxs, no apache found. Try --with-apxs),
377 [/usr/local/apache2/bin:/usr/local/apache/bin:/usr/sbin:$PATH])
379 # ask the daemon for the version and set parameters
380 AC_MSG_CHECKING(default apache version)
381 httpd="`$xs -q SBINDIR`/`$xs -q TARGET`"
382 if test "x$httpd" != "x" && test -f $httpd ; then
383 v=`$httpd -v|$SED -n -e 's/.*Apache\/\.*//p'`
385 1.3*) [enable_apache_13]=yes
389 2.0*) [enable_apache_20]=yes
393 2.2*) [enable_apache_22]=yes
397 *) AC_MSG_ERROR(unusable apache versions: $v. Try setting --with-apxs)
400 AC_MSG_RESULT(cannot determine version. Try setting --with-apxs)
404 # Apache 1.3 (mod_shib_13)
406 # --with-apxs (DSO build, the normal way, uses apxs to derive build flags)
408 AC_ARG_ENABLE(apache-13,
409 AC_HELP_STRING([--enable-apache-13], [enable the Apache 1.3 module]),
410 [ if test "x$enableval" = "x" ; then
413 WANT_APACHE_13="$enableval"
415 ],[ WANT_APACHE_13=no ])
416 AC_MSG_CHECKING(whether to build Apache 1.3 module)
417 if test "$WANT_APACHE_13" != yes && test "$WANT_APACHE_13" != no ; then
420 AC_MSG_RESULT($WANT_APACHE_13)
422 if test "$WANT_APACHE_13" = "yes" ; then
424 AC_HELP_STRING([--with-apxs=FILE], [Specifies where to find the Apache 1.3 apxs script.]),
426 AC_MSG_CHECKING(for user-specified apxs name/location)
427 if test "$withval" != "no" ; then
428 if test "$withval" != "yes"; then
430 AC_MSG_RESULT("$withval")
435 AC_PATH_PROG(APXS, apxs, no)
436 if test "$APXS" = "no" ; then
437 for i in /usr/sbin /usr/local/apache/bin ; do
438 if test "$APXS" = "no" && test -f "$i/apxs"; then
445 AC_MSG_CHECKING([to see if apxs was located])
446 if test ! -f "$APXS" ; then
448 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.])
453 # extract settings we need from APXS -q
454 APXS_CC="`$APXS -q CC`"
455 APXS_CFLAGS="`$APXS -q CPPFLAGS` `$APXS -q CFLAGS` `$APXS -q CFLAGS_SHLIB`"
456 APXS_INCLUDE="`$APXS -q INCLUDEDIR`"
459 AC_SUBST(APXS_CFLAGS)
460 AC_SUBST(APXS_INCLUDE)
463 # Apache 2.0 (mod_shib_20)
465 # --with-apxs2 (DSO build, the normal way, uses apxs to derive build flags)
466 # --with-apr (DSO build, APR development package installed separately)
468 AC_ARG_ENABLE(apache-20,
469 AC_HELP_STRING([--enable-apache-20], [enable the Apache 2.0 module]),
470 [ if test "x$enableval" = "x" ; then
473 WANT_APACHE_20="$enableval"
475 ],[ WANT_APACHE_20=no ])
476 AC_MSG_CHECKING(whether to build Apache 2.0 module)
477 if test "$WANT_APACHE_20" != yes && test "$WANT_APACHE_20" != no ; then
480 AC_MSG_RESULT($WANT_APACHE_20)
482 if test "$WANT_APACHE_20" = "yes" ; then
484 AC_HELP_STRING([--with-apxs2=FILE], [Specifies where to find the Apache 2.0 apxs script.]),
486 AC_MSG_CHECKING(for user-specified Apache2 apxs name/location)
487 if test "$withval" != "no" ; then
488 if test "$withval" != "yes"; then
490 AC_MSG_RESULT("$withval")
495 AC_PATH_PROG(APXS2, apxs2, no)
496 if test "$APXS2" = "no" ; then
497 AC_PATH_PROG(APXS2, apxs, no)
499 if test "$APXS2" = "no" ; then
500 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
501 if test "$APXS2" = "no" && test -f "$i/apxs2" ; then
505 if test "$APXS2" = "no" ; then
506 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
507 if test "$APXS2" = "no" && test -f "$i/apxs" ; then
515 AC_MSG_CHECKING([to see if Apache2 apxs was located])
516 if test ! -f "$APXS2" ; then
518 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.])
520 AC_MSG_RESULT($APXS2)
525 AC_HELP_STRING([--with-apr=PATH], [where apr-config is installed]),
527 AC_MSG_CHECKING(for user-specified apr-config name/location)
528 if test "$withval" != "no" ; then
529 if test "$withval" != "yes"; then
531 AC_MSG_RESULT("$withval")
536 AC_PATH_PROG(APR_CONFIG, apr-config)
538 if test -f "${APR_CONFIG}"; then
539 APR_CFLAGS="`${APR_CONFIG} --cflags` `${APR_CONFIG} --cppflags` `${APR_CONFIG} --includes`"
541 AC_MSG_ERROR([Unable to locate apr-config, may need --with-apr option.])
544 # extract settings we need from APXS2 -q
545 APXS2_CC="`$APXS2 -q CC`"
546 APXS2_CFLAGS="`$APXS2 -q CPPFLAGS` `$APXS2 -q CFLAGS` `$APXS2 -q CFLAGS_SHLIB` $APR_CFLAGS"
547 APXS2_INCLUDE="`$APXS2 -q INCLUDEDIR`"
550 AC_SUBST(APXS2_CFLAGS)
551 AC_SUBST(APXS2_INCLUDE)
554 # Apache 2.2 (mod_shib_22)
556 # --with-apxs22 (DSO build, the normal way, uses apxs to derive build flags)
557 # --with-apr1 (DSO build, APR development package installed separately)
559 AC_ARG_ENABLE(apache-22,
560 AC_HELP_STRING([--enable-apache-22], [enable the Apache 2.2 module]),
561 [ if test "x$enableval" = "x" ; then
564 WANT_APACHE_22="$enableval"
566 ],[ WANT_APACHE_22=no ])
567 AC_MSG_CHECKING(whether to build Apache 2.2 module)
568 if test "$WANT_APACHE_22" != yes && test "$WANT_APACHE_22" != no ; then
571 AC_MSG_RESULT($WANT_APACHE_22)
573 if test "$WANT_APACHE_22" = "yes" ; then
575 AC_HELP_STRING([--with-apxs22=FILE], [Specifies where to find the Apache 2.2 apxs script.]),
577 AC_MSG_CHECKING(for user-specified Apache2.2 apxs name/location)
578 if test "$withval" != "no" ; then
579 if test "$withval" != "yes"; then
581 AC_MSG_RESULT("$withval")
586 AC_PATH_PROG(APXS22, apxs2, no)
587 if test "$APXS22" = "no" ; then
588 AC_PATH_PROG(APXS22, apxs, no)
590 if test "$APXS22" = "no" ; then
591 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
592 if test "$APXS22" = "no" && test -f "$i/apxs2" ; then
596 if test "$APXS22" = "no" ; then
597 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
598 if test "$APXS22" = "no" && test -f "$i/apxs" ; then
606 AC_MSG_CHECKING([to see if Apache2.2 apxs was located])
607 if test ! -f "$APXS22" ; then
609 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.])
611 AC_MSG_RESULT($APXS22)
616 AC_HELP_STRING([--with-apr1=PATH], [where apr-1-config is installed]),
618 AC_MSG_CHECKING(for user-specified apr-1-config name/location)
619 if test "$withval" != "no" ; then
620 if test "$withval" != "yes"; then
622 AC_MSG_RESULT("$withval")
627 AC_PATH_PROG(APR1_CONFIG, apr-1-config)
629 if test -f "${APR1_CONFIG}"; then
630 APR1_CFLAGS="`${APR1_CONFIG} --cflags` `${APR1_CONFIG} --cppflags` `${APR1_CONFIG} --includes`"
632 AC_MSG_ERROR([Unable to locate apr-1-config, may need --with-apr1 option.])
635 # extract settings we need from APXS22 -q
636 APXS22_CC="`$APXS22 -q CC`"
637 APXS22_CFLAGS="`$APXS22 -q CPPFLAGS` `$APXS22 -q CFLAGS` `$APXS22 -q CFLAGS_SHLIB` $APR1_CFLAGS"
638 APXS22_INCLUDE="`$APXS22 -q INCLUDEDIR`"
641 AC_SUBST(APXS22_CFLAGS)
642 AC_SUBST(APXS22_INCLUDE)
644 # always output the Makefile, even if you don't use it
645 AC_CONFIG_FILES([apache/Makefile])
646 AM_CONDITIONAL(BUILD_AP13,test "$WANT_APACHE_13" = "yes")
647 AM_CONDITIONAL(BUILD_AP20,test "$WANT_APACHE_20" = "yes")
648 AM_CONDITIONAL(BUILD_AP22,test "$WANT_APACHE_22" = "yes")
650 # add the apache module to the list of wanted subdirs..
651 if test "$WANT_APACHE_13" = "yes" || test "$WANT_APACHE_20" = "yes" || test "$WANT_APACHE_22" = "yes" ; then
652 WANT_SUBDIRS="$WANT_SUBDIRS apache"
657 # Implement the checks of the ODBC Storage Service
659 # 1) Assume the user wants ODBC; if it's not found then just continue without
660 # 2) If the user specifically requested odbc, look for it and ERROR if not found
661 # 3) If the user specifically requested no odbc, don't build it.
664 AC_CONFIG_FILES([odbc-store/Makefile])
666 # determine whether we should enable the odbc ccache
667 AC_ARG_ENABLE([odbc],
668 AC_HELP_STRING([--disable-odbc], [disable the ODBC Storage Service]),
669 [odbc_enabled=$enableval], [odbc_enabled=default])
671 if test "x$odbc_enabled" = "x" ; then
675 # Are we trying to build ODBC?
676 AC_MSG_CHECKING(whether to build the ODBC storage service)
677 if test "$odbc_enabled" = "yes" ; then
680 elif test "$odbc_enabled" = "default" ; then
682 AC_MSG_RESULT([yes, if it can be found])
688 # If we're trying to build ODBC, try to find the odbc_config program.
689 if test "$build_odbc" = "yes" ; then
692 AC_HELP_STRING([--with-odbc=PATH], [directory where odbc is installed]),
693 [if test "$with_odbc" = no ; then
694 AC_MSG_ERROR([Try running --disable-odbc instead.])
695 elif test "$with_odbc" != yes ; then
696 odbc_dir="$with_odbc/bin"
699 AC_PATH_PROG(ODBC_CONFIG, odbc_config, no, $odbc_dir $PATH )
701 if test "$ODBC_CONFIG" = no ; then
702 if test "$odbc_enabled" = "yes" ; then
703 AC_MSG_ERROR(Cannot find odbc_config)
705 AC_MSG_WARN(ODBC not found, skipping.)
710 if test "$build_odbc" = yes ; then
711 ODBC_CFLAGS=`$ODBC_CONFIG --cflags`
712 ODBC_CFLAGS=`eval echo $ODBC_CFLAGS`
713 ODBC_LIBS=`$ODBC_CONFIG --libs`
714 ODBC_LIBS=`eval echo $ODBC_LIBS`
716 save_CPPFLAGS="$CPPFLAGS"
717 CPPFLAGS="$CPPFLAGS $ODBC_CFLAGS"
719 AC_CHECK_HEADER([sql.h], [have_sql_h=yes], [have_sql_h=no])
720 if test "$have_sql_h" = no -a "$odbc_enabled" = "yes" ; then
721 AC_MSG_ERROR(unable to find ODBC header files)
724 if test "$have_sql_h" = yes ; then
726 LIBS="$LIBS $ODBC_LIBS"
727 AC_MSG_CHECKING(if we can link againt ODBC)
732 [SQLSetEnvAttr(SQL_NULL_HANDLE, SQL_ATTR_CONNECTION_POOLING, (void*)SQL_CP_ONE_PER_HENV, 0)],
733 [have_odbc_libs=yes],
737 if test "$have_odbc_libs" = no ; then
738 if test "$odbc_enabled" = "yes" ; then
739 AC_MSG_ERROR([unable to link with ODBC Library])
741 AC_MSG_RESULT(no, skipping ODBC)
746 CPPFLAGS="$save_CPPFLAGS"
749 # if have_odbc_libs=yes then go ahead with building ODBC
750 if test "$have_odbc_libs" = yes ; then
751 # this AC_MSG_RESULT is from above!
753 WANT_SUBDIRS="$WANT_SUBDIRS odbc-store"
754 AC_SUBST(ODBC_CFLAGS)
759 AC_SUBST(WANT_SUBDIRS)
761 if test -n "$APXS_CC" && test "$APXS_CC" != "$CC" ; then
762 echo "=================================================================="
763 echo "WARNING: You have chosen to compile Apache-1.3 modules with a different"
764 echo " compiler than the one used to compile Apache."
766 echo " Current compiler: $CC"
767 echo " Apache's compiler: $APXS_CC"
769 echo "This could cause problems."
770 echo "=================================================================="
773 if test -n "$APXS2_CC" && test "$APXS2_CC" != "$CC" ; then
774 echo "=================================================================="
775 echo "WARNING: You have chosen to compile Apache-2.0 modules with a different"
776 echo " compiler than the one used to compile Apache."
778 echo " Current compiler: $CC"
779 echo " Apache's compiler: $APXS2_CC"
781 echo "This could cause problems."
782 echo "=================================================================="
785 if test -n "$APXS22_CC" && test "$APXS22_CC" != "$CC" ; then
786 echo "=================================================================="
787 echo "WARNING: You have chosen to compile Apache-2.2 modules with a different"
788 echo " compiler than the one used to compile Apache."
790 echo " Current compiler: $CC"
791 echo " Apache's compiler: $APXS22_CC"
793 echo "This could cause problems."
794 echo "=================================================================="
797 LIBTOOL="$LIBTOOL --silent"