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> #include <log4shib/CategoryStream.hh>],
107 [log4shib::Category::getInstance("foo").errorStream() << log4shib::eol],
108 [AC_DEFINE(SHIBSP_LOG4SHIB,1,[Define if log4shib library is used.])],
109 [AC_MSG_ERROR([unable to link with log4shib])])
111 AC_MSG_WARN([log4shib-config not found, may need to use --with-log4shib option])
112 AC_MSG_WARN([will look for original log4cpp library])
115 AC_PATH_PROG(LOG4CPP_CONFIG,log4cpp-config)
117 AC_HELP_STRING([--with-log4cpp=PATH], [where log4cpp-config is installed]),
119 LOG4CPP_CONFIG="${with_log4cpp}"
120 if ! test -f "${LOG4CPP_CONFIG}" ; then
121 LOG4CPP_CONFIG="${with_log4cpp}/bin/log4cpp-config"
124 if test -f "${LOG4CPP_CONFIG}"; then
125 AC_MSG_WARN([will try to use log4cpp, note that most non-Internet2 supplied versions are not thread-safe])
126 LDFLAGS="`${LOG4CPP_CONFIG} --libs` $LDFLAGS"
127 CPPFLAGS="`${LOG4CPP_CONFIG} --cflags` $CPPFLAGS"
128 AC_CHECK_HEADER([log4cpp/CategoryStream.hh],,AC_MSG_ERROR([unable to find log4cpp header files]))
130 [#include <log4cpp/Category.hh> #include <log4cpp/CategoryStream.hh>],
131 [log4cpp::Category::getInstance("foo").errorStream() << log4cpp::eol],
132 [AC_DEFINE(SHIBSP_LOG4CPP,1,[Define if log4cpp library is used.])],
133 [AC_MSG_ERROR([unable to link with log4cpp, need version 1.0 or later])])
135 AC_MSG_ERROR([log4cpp-config not found, may need to use --with-log4cpp option])
141 AC_HELP_STRING([--with-xerces=PATH], [where xerces-c is installed]),
142 [if test x_$with_xerces != x_/usr; then
143 LDFLAGS="-L${with_xerces}/lib $LDFLAGS"
144 CPPFLAGS="-I${with_xerces}/include $CPPFLAGS"
146 LIBS="-lxerces-c $LIBS"
147 AC_CHECK_HEADER([xercesc/dom/DOM.hpp],,
148 AC_MSG_ERROR([unable to find xerces header files]))
149 AC_MSG_CHECKING([Xerces version])
151 [AC_LANG_PROGRAM([#include <xercesc/util/XercesVersion.hpp>],
152 [#if _XERCES_VERSION != 20600
155 #error cannot use version 2.6.0
158 [AC_MSG_FAILURE([Xerces-C v2.6.0 has bugs that inhibit use with signed XML, please use a newer version])])
160 [#include <xercesc/util/PlatformUtils.hpp>],
161 [xercesc::XMLPlatformUtils::Initialize()],
162 [AC_DEFINE(HAVE_LIBXERCESC,1,[Define if Xerces-C library was found])],
163 [AC_MSG_ERROR([unable to link with Xerces])])
166 #XML-Tooling settings
167 AC_ARG_WITH(xmltooling,
168 AC_HELP_STRING([--with-xmltooling=PATH], [where xmltooling-c is installed]),
169 [if test x_$with_xmltooling != x_/usr; then
170 LDFLAGS="-L${with_xmltooling}/lib $LDFLAGS"
171 CPPFLAGS="-I${with_xmltooling}/include $CPPFLAGS"
173 LITE_LIBS="-lxmltooling-lite"
174 XMLSEC_LIBS="-lxmltooling"
175 AC_CHECK_HEADER([xmltooling/base.h],,
176 AC_MSG_ERROR([unable to find xmltooling header files]))
179 # XML-Security settings
181 AC_HELP_STRING([--with-xmlsec=PATH], [where xmlsec is installed]),,
184 if test x_$with_xmlsec != x_/usr; then
185 LDFLAGS="-L${with_xmlsec}/lib $LDFLAGS"
186 CPPFLAGS="-I${with_xmlsec}/include $CPPFLAGS"
188 XMLSEC_LIBS="-lxml-security-c $XMLSEC_LIBS"
190 # save and append master libs
192 LIBS="$XMLSEC_LIBS $LIBS"
194 AC_CHECK_HEADER([xsec/utils/XSECPlatformUtils.hpp],,AC_MSG_ERROR([unable to find XML-Security header files]))
195 AC_MSG_CHECKING([XML-Security version])
197 [AC_LANG_PROGRAM([#include <xsec/utils/XSECPlatformUtils.hpp>],
198 [#if XSEC_VERSION_MAJOR > 1 || (XSEC_VERSION_MAJOR == 1 && XSEC_VERSION_MEDIUM > 3)
201 #error need version 1.4.0 or later
204 [AC_MSG_FAILURE([XML-Security version 1.4.0 or greater is required.])])
206 [#include <xsec/utils/XSECPlatformUtils.hpp>],
207 [XSECPlatformUtils::Initialise()],,
208 [AC_MSG_ERROR([unable to link with XML-Security])])
210 # restore master libs
215 AC_HELP_STRING([--with-saml=PATH], [where saml is installed]),
216 [if test x_$with_saml != x_/usr; then
217 LDFLAGS="-L${with_saml}/lib $LDFLAGS"
218 CPPFLAGS="-I${with_saml}/include $CPPFLAGS"
220 XMLSEC_LIBS="-lsaml $XMLSEC_LIBS"
222 # save and append master libs
224 LIBS="$XMLSEC_LIBS $LIBS"
226 AC_CHECK_HEADER([saml/saml2/metadata/Metadata.h],,
227 AC_MSG_ERROR([unable to find OpenSAML header files]))
229 [#include <saml/SAMLConfig.h>
230 #include <saml/version.h>],
231 [#if _OPENSAML_VERSION >= 20000
232 opensaml::SAMLConfig::getConfig();
234 #error Need OpenSAML version 2.0 or higher
236 [AC_DEFINE(HAVE_SAML,1,[Define if saml library was found])],
237 [AC_MSG_ERROR([unable to link with OpenSAML, or version was too old])])
239 # restore master libs
243 AC_SUBST(XMLSEC_LIBS)
245 # output the underlying makefiles
246 WANT_SUBDIRS="doc schemas configs shibsp shibd util"
247 AC_CONFIG_FILES([Makefile doc/Makefile schemas/Makefile \
248 configs/Makefile shibsp/Makefile shibd/Makefile \
249 util/Makefile selinux/Makefile])
252 AC_CONFIG_FILES([adfs/Makefile])
253 AC_ARG_ENABLE([adfs],
254 AC_HELP_STRING([--disable-adfs], [don't build the ADFS module]),
255 [adfs_enabled=$enableval], [adfs_enabled=yes])
256 if test "x$adfs_enabled" = "x" ; then
259 AC_MSG_CHECKING(whether to build the ADFS module)
260 if test "$adfs_enabled" = "no" ; then
264 WANT_SUBDIRS="$WANT_SUBDIRS adfs"
269 # Build NSAPI module?
271 AC_MSG_CHECKING(for NSAPI module option)
273 AC_HELP_STRING([--with-nsapi=DIR], [Build NSAPI module for Netscape/iPlanet/SunONE]),
274 [WANT_NSAPI=$withval],[WANT_NSAPI=no])
275 AC_MSG_RESULT($WANT_NSAPI)
277 if test "$WANT_NSAPI" != "no"; then
278 if test ! -d $WANT_NSAPI/bin ; then
279 AC_MSG_ERROR(Please specify the path to the root of your Netscape/iPlanet/SunONE server using --with-nsapi=DIR)
281 AC_MSG_CHECKING(for NSAPI include files)
282 if test -d $WANT_NSAPI/include ; then
283 NSAPI_INCLUDE=$WANT_NSAPI/include
284 AC_MSG_RESULT(Netscape-Enterprise 3.x style)
285 AC_CHECK_HEADERS([$NSAPI_INCLUDE/nsapi.h])
286 NSAPI_INCLUDE="$NSAPI_INC_DIR -I$NSAPI_INCLUDE"
288 if test -d $WANT_NSAPI/plugins/include ; then
289 test -n "$NSAPI_INCLUDE" && NSAPI_INC_DIR="-I$NSAPI_INCLUDE"
290 NSAPI_INCLUDE="$WANT_NSAPI/plugins/include"
291 AC_MSG_RESULT(iPlanet 4.x / SunONE 6.x style)
292 AC_CHECK_HEADERS([$NSAPI_INCLUDE/nsapi.h])
293 NSAPI_INCLUDE="$NSAPI_INC_DIR -I$NSAPI_INCLUDE"
295 if test "$NSAPI_INCLUDE" = ""; then
296 AC_MSG_ERROR(Please check you have nsapi.h in either $WANT_NSAPI/include or $WANT_NSAPI/plugins/include)
300 AC_SUBST(NSAPI_INCLUDE)
302 # always output the Makefile, even if you don't use it
303 AC_CONFIG_FILES([nsapi_shib/Makefile])
304 AM_CONDITIONAL(BUILD_NSAPI,test ! "$WANT_NSAPI" = "no")
306 # add the NSAPI module to the list of wanted subdirs..
307 if test ! "$WANT_NSAPI" = "no" ; then
308 WANT_SUBDIRS="$WANT_SUBDIRS nsapi_shib"
313 # Build FastCGI support?
315 AC_MSG_CHECKING(for FastCGI support)
317 AC_HELP_STRING([--with-fastcgi=DIR], [Build FastCGI support]),
318 [WANT_FASTCGI=$withval],[WANT_FASTCGI=no])
319 AC_MSG_RESULT($WANT_FASTCGI)
321 if test "$WANT_FASTCGI" != "no"; then
322 if test "$WANT_FASTCGI" != "yes"; then
323 if test x_$WANT_FASTCGI != x_/usr; then
324 FASTCGI_INCLUDE="-I$WANT_FASTCGI/include"
325 FASTCGI_LDFLAGS="-L$WANT_FASTCGI/lib"
328 AC_CHECK_HEADER([fcgio.h],,
329 AC_MSG_ERROR([unable to find FastCGI header files]))
330 FASTCGI_LIBS="-lfcgi -lfcgi++"
333 AC_SUBST(FASTCGI_INCLUDE)
334 AC_SUBST(FASTCGI_LDFLAGS)
335 AC_SUBST(FASTCGI_LIBS)
337 # always output the Makefile, even if you don't use it
338 AC_CONFIG_FILES([fastcgi/Makefile])
339 AM_CONDITIONAL(BUILD_FASTCGI,test ! "$WANT_FASTCGI" = "no")
341 if test ! "$WANT_FASTCGI" = "no" ; then
342 WANT_SUBDIRS="$WANT_SUBDIRS fastcgi"
347 # If no --enable-apache-xx specified
348 # find a default and fake the specific parameters
351 # simple macro to peek at an enable or a with
353 if test "[${[$1]_][$2]+set}" = set; then
354 peekval="${[$1]_[$2]}"
359 AC_MSG_CHECKING(if default apache needed)
361 Peek(enable,apache_13,need_default=no)
362 Peek(enable,apache_20,need_default=no)
363 Peek(enable,apache_22,need_default=no)
364 AC_MSG_RESULT($need_default)
366 if test "$need_default" = "yes"; then
367 # find an apxs, then the httpd
369 Peek(with,apxs,xs="$peekval")
370 Peek(with,apxs2,xs="$peekval")
371 Peek(with,apxs22,xs="$peekval")
372 if test "x$xs" = "x"; then
373 AC_PATH_PROGS(xs, apxs2 apxs,
374 AC_MSG_ERROR(No apxs, no apache found. Try --with-apxs),
375 [/usr/local/apache2/bin:/usr/local/apache/bin:/usr/sbin:$PATH])
377 # ask the daemon for the version and set parameters
378 AC_MSG_CHECKING(default apache version)
379 httpd="`$xs -q SBINDIR`/`$xs -q TARGET`"
380 if test "x$httpd" != "x" && test -f $httpd ; then
381 v=`$httpd -v|$SED -n -e 's/.*Apache\/\.*//p'`
383 1.3*) [enable_apache_13]=yes
387 2.0*) [enable_apache_20]=yes
391 2.2*) [enable_apache_22]=yes
395 *) AC_MSG_ERROR(unusable apache versions: $v. Try setting --with-apxs)
398 AC_MSG_RESULT(cannot determine version. Try setting --with-apxs)
402 # Apache 1.3 (mod_shib_13)
404 # --with-apxs (DSO build, the normal way, uses apxs to derive build flags)
406 AC_ARG_ENABLE(apache-13,
407 AC_HELP_STRING([--enable-apache-13], [enable the Apache 1.3 module]),
408 [ if test "x$enableval" = "x" ; then
411 WANT_APACHE_13="$enableval"
413 ],[ WANT_APACHE_13=no ])
414 AC_MSG_CHECKING(whether to build Apache 1.3 module)
415 if test "$WANT_APACHE_13" != yes && test "$WANT_APACHE_13" != no ; then
418 AC_MSG_RESULT($WANT_APACHE_13)
420 if test "$WANT_APACHE_13" = "yes" ; then
422 AC_HELP_STRING([--with-apxs=FILE], [Specifies where to find the Apache 1.3 apxs script.]),
424 AC_MSG_CHECKING(for user-specified apxs name/location)
425 if test "$withval" != "no" ; then
426 if test "$withval" != "yes"; then
428 AC_MSG_RESULT("$withval")
433 AC_PATH_PROG(APXS, apxs, no)
434 if test "$APXS" = "no" ; then
435 for i in /usr/sbin /usr/local/apache/bin ; do
436 if test "$APXS" = "no" && test -f "$i/apxs"; then
443 AC_MSG_CHECKING([to see if apxs was located])
444 if test ! -f "$APXS" ; then
446 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.])
451 # extract settings we need from APXS -q
452 APXS_CC="`$APXS -q CC`"
453 APXS_CFLAGS="`$APXS -q CPPFLAGS` `$APXS -q CFLAGS` `$APXS -q CFLAGS_SHLIB`"
454 APXS_INCLUDE="`$APXS -q INCLUDEDIR`"
457 AC_SUBST(APXS_CFLAGS)
458 AC_SUBST(APXS_INCLUDE)
461 # Apache 2.0 (mod_shib_20)
463 # --with-apxs2 (DSO build, the normal way, uses apxs to derive build flags)
464 # --with-apr (DSO build, APR development package installed separately)
466 AC_ARG_ENABLE(apache-20,
467 AC_HELP_STRING([--enable-apache-20], [enable the Apache 2.0 module]),
468 [ if test "x$enableval" = "x" ; then
471 WANT_APACHE_20="$enableval"
473 ],[ WANT_APACHE_20=no ])
474 AC_MSG_CHECKING(whether to build Apache 2.0 module)
475 if test "$WANT_APACHE_20" != yes && test "$WANT_APACHE_20" != no ; then
478 AC_MSG_RESULT($WANT_APACHE_20)
480 if test "$WANT_APACHE_20" = "yes" ; then
482 AC_HELP_STRING([--with-apxs2=FILE], [Specifies where to find the Apache 2.0 apxs script.]),
484 AC_MSG_CHECKING(for user-specified Apache2 apxs name/location)
485 if test "$withval" != "no" ; then
486 if test "$withval" != "yes"; then
488 AC_MSG_RESULT("$withval")
493 AC_PATH_PROG(APXS2, apxs2, no)
494 if test "$APXS2" = "no" ; then
495 AC_PATH_PROG(APXS2, apxs, no)
497 if test "$APXS2" = "no" ; then
498 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
499 if test "$APXS2" = "no" && test -f "$i/apxs2" ; then
503 if test "$APXS2" = "no" ; then
504 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
505 if test "$APXS2" = "no" && test -f "$i/apxs" ; then
513 AC_MSG_CHECKING([to see if Apache2 apxs was located])
514 if test ! -f "$APXS2" ; then
516 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.])
518 AC_MSG_RESULT($APXS2)
523 AC_HELP_STRING([--with-apr=PATH], [where apr-config is installed]),
525 AC_MSG_CHECKING(for user-specified apr-config name/location)
526 if test "$withval" != "no" ; then
527 if test "$withval" != "yes"; then
529 AC_MSG_RESULT("$withval")
534 AC_PATH_PROG(APR_CONFIG, apr-config)
536 if test -f "${APR_CONFIG}"; then
537 APR_CFLAGS="`${APR_CONFIG} --cflags` `${APR_CONFIG} --cppflags` `${APR_CONFIG} --includes`"
539 AC_MSG_ERROR([Unable to locate apr-config, may need --with-apr option.])
542 # extract settings we need from APXS2 -q
543 APXS2_CC="`$APXS2 -q CC`"
544 APXS2_CFLAGS="`$APXS2 -q CPPFLAGS` `$APXS2 -q CFLAGS` `$APXS2 -q CFLAGS_SHLIB` $APR_CFLAGS"
545 APXS2_INCLUDE="`$APXS2 -q INCLUDEDIR`"
548 AC_SUBST(APXS2_CFLAGS)
549 AC_SUBST(APXS2_INCLUDE)
552 # Apache 2.2 (mod_shib_22)
554 # --with-apxs22 (DSO build, the normal way, uses apxs to derive build flags)
555 # --with-apr1 (DSO build, APR development package installed separately)
557 AC_ARG_ENABLE(apache-22,
558 AC_HELP_STRING([--enable-apache-22], [enable the Apache 2.2 module]),
559 [ if test "x$enableval" = "x" ; then
562 WANT_APACHE_22="$enableval"
564 ],[ WANT_APACHE_22=no ])
565 AC_MSG_CHECKING(whether to build Apache 2.2 module)
566 if test "$WANT_APACHE_22" != yes && test "$WANT_APACHE_22" != no ; then
569 AC_MSG_RESULT($WANT_APACHE_22)
571 if test "$WANT_APACHE_22" = "yes" ; then
573 AC_HELP_STRING([--with-apxs22=FILE], [Specifies where to find the Apache 2.2 apxs script.]),
575 AC_MSG_CHECKING(for user-specified Apache2.2 apxs name/location)
576 if test "$withval" != "no" ; then
577 if test "$withval" != "yes"; then
579 AC_MSG_RESULT("$withval")
584 AC_PATH_PROG(APXS22, apxs2, no)
585 if test "$APXS22" = "no" ; then
586 AC_PATH_PROG(APXS22, apxs, no)
588 if test "$APXS22" = "no" ; then
589 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
590 if test "$APXS22" = "no" && test -f "$i/apxs2" ; then
594 if test "$APXS22" = "no" ; then
595 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
596 if test "$APXS22" = "no" && test -f "$i/apxs" ; then
604 AC_MSG_CHECKING([to see if Apache2.2 apxs was located])
605 if test ! -f "$APXS22" ; then
607 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.])
609 AC_MSG_RESULT($APXS22)
614 AC_HELP_STRING([--with-apr1=PATH], [where apr-1-config is installed]),
616 AC_MSG_CHECKING(for user-specified apr-1-config name/location)
617 if test "$withval" != "no" ; then
618 if test "$withval" != "yes"; then
620 AC_MSG_RESULT("$withval")
625 AC_PATH_PROG(APR1_CONFIG, apr-1-config)
627 if test -f "${APR1_CONFIG}"; then
628 APR1_CFLAGS="`${APR1_CONFIG} --cflags` `${APR1_CONFIG} --cppflags` `${APR1_CONFIG} --includes`"
630 AC_MSG_ERROR([Unable to locate apr-1-config, may need --with-apr1 option.])
633 # extract settings we need from APXS22 -q
634 APXS22_CC="`$APXS22 -q CC`"
635 APXS22_CFLAGS="`$APXS22 -q CPPFLAGS` `$APXS22 -q CFLAGS` `$APXS22 -q CFLAGS_SHLIB` $APR1_CFLAGS"
636 APXS22_INCLUDE="`$APXS22 -q INCLUDEDIR`"
639 AC_SUBST(APXS22_CFLAGS)
640 AC_SUBST(APXS22_INCLUDE)
642 # always output the Makefile, even if you don't use it
643 AC_CONFIG_FILES([apache/Makefile])
644 AM_CONDITIONAL(BUILD_AP13,test "$WANT_APACHE_13" = "yes")
645 AM_CONDITIONAL(BUILD_AP20,test "$WANT_APACHE_20" = "yes")
646 AM_CONDITIONAL(BUILD_AP22,test "$WANT_APACHE_22" = "yes")
648 # add the apache module to the list of wanted subdirs..
649 if test "$WANT_APACHE_13" = "yes" || test "$WANT_APACHE_20" = "yes" || test "$WANT_APACHE_22" = "yes" ; then
650 WANT_SUBDIRS="$WANT_SUBDIRS apache"
655 # Implement the checks of the ODBC Storage Service
657 # 1) Assume the user wants ODBC; if it's not found then just continue without
658 # 2) If the user specifically requested odbc, look for it and ERROR if not found
659 # 3) If the user specifically requested no odbc, don't build it.
662 AC_CONFIG_FILES([odbc-store/Makefile])
664 # determine whether we should enable the odbc ccache
665 AC_ARG_ENABLE([odbc],
666 AC_HELP_STRING([--disable-odbc], [disable the ODBC Storage Service]),
667 [odbc_enabled=$enableval], [odbc_enabled=default])
669 if test "x$odbc_enabled" = "x" ; then
673 # Are we trying to build ODBC?
674 AC_MSG_CHECKING(whether to build the ODBC storage service)
675 if test "$odbc_enabled" = "yes" ; then
678 elif test "$odbc_enabled" = "default" ; then
680 AC_MSG_RESULT([yes, if it can be found])
686 # If we're trying to build ODBC, try to find the odbc_config program.
687 if test "$build_odbc" = "yes" ; then
690 AC_HELP_STRING([--with-odbc=PATH], [directory where odbc is installed]),
691 [if test "$with_odbc" = no ; then
692 AC_MSG_ERROR([Try running --disable-odbc instead.])
693 elif test "$with_odbc" != yes ; then
694 odbc_dir="$with_odbc/bin"
697 AC_PATH_PROG(ODBC_CONFIG, odbc_config, no, $odbc_dir $PATH )
699 if test "$ODBC_CONFIG" = no ; then
700 if test "$odbc_enabled" = "yes" ; then
701 AC_MSG_ERROR(Cannot find odbc_config)
703 AC_MSG_WARN(ODBC not found, skipping.)
708 if test "$build_odbc" = yes ; then
709 ODBC_CFLAGS=`$ODBC_CONFIG --cflags`
710 ODBC_CFLAGS=`eval echo $ODBC_CFLAGS`
711 ODBC_LIBS=`$ODBC_CONFIG --libs`
712 ODBC_LIBS=`eval echo $ODBC_LIBS`
714 save_CPPFLAGS="$CPPFLAGS"
715 CPPFLAGS="$CPPFLAGS $ODBC_CFLAGS"
717 AC_CHECK_HEADER([sql.h], [have_sql_h=yes], [have_sql_h=no])
718 if test "$have_sql_h" = no -a "$odbc_enabled" = "yes" ; then
719 AC_MSG_ERROR(unable to find ODBC header files)
722 if test "$have_sql_h" = yes ; then
724 LIBS="$LIBS $ODBC_LIBS"
725 AC_MSG_CHECKING(if we can link againt ODBC)
730 [SQLSetEnvAttr(SQL_NULL_HANDLE, SQL_ATTR_CONNECTION_POOLING, (void*)SQL_CP_ONE_PER_HENV, 0)],
731 [have_odbc_libs=yes],
735 if test "$have_odbc_libs" = no ; then
736 if test "$odbc_enabled" = "yes" ; then
737 AC_MSG_ERROR([unable to link with ODBC Library])
739 AC_MSG_RESULT(no, skipping ODBC)
744 CPPFLAGS="$save_CPPFLAGS"
747 # if have_odbc_libs=yes then go ahead with building ODBC
748 if test "$have_odbc_libs" = yes ; then
749 # this AC_MSG_RESULT is from above!
751 WANT_SUBDIRS="$WANT_SUBDIRS odbc-store"
752 AC_SUBST(ODBC_CFLAGS)
757 AC_SUBST(WANT_SUBDIRS)
759 if test -n "$APXS_CC" && test "$APXS_CC" != "$CC" ; then
760 echo "=================================================================="
761 echo "WARNING: You have chosen to compile Apache-1.3 modules with a different"
762 echo " compiler than the one used to compile Apache."
764 echo " Current compiler: $CC"
765 echo " Apache's compiler: $APXS_CC"
767 echo "This could cause problems."
768 echo "=================================================================="
771 if test -n "$APXS2_CC" && test "$APXS2_CC" != "$CC" ; then
772 echo "=================================================================="
773 echo "WARNING: You have chosen to compile Apache-2.0 modules with a different"
774 echo " compiler than the one used to compile Apache."
776 echo " Current compiler: $CC"
777 echo " Apache's compiler: $APXS2_CC"
779 echo "This could cause problems."
780 echo "=================================================================="
783 if test -n "$APXS22_CC" && test "$APXS22_CC" != "$CC" ; then
784 echo "=================================================================="
785 echo "WARNING: You have chosen to compile Apache-2.2 modules with a different"
786 echo " compiler than the one used to compile Apache."
788 echo " Current compiler: $CC"
789 echo " Apache's compiler: $APXS22_CC"
791 echo "This could cause problems."
792 echo "=================================================================="
795 LIBTOOL="$LIBTOOL --silent"