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]))
180 # Establish location of xmltooling catalog.
182 if test "x$with_xmltooling" = "x" ; then
183 with_xmltooling="/usr"
185 if test -f $with_xmltooling/share/xml/xmltooling/catalog.xml ; then
186 XMLTOOLINGXMLDIR="$with_xmltooling"
188 if test -f $with_xerces/share/xml/xmltooling/catalog.xml ; then
189 XMLTOOLINGXMLDIR="$with_xerces"
191 if test -f $with_log4shib/share/xml/xmltooling/catalog.xml ; then
192 XMLTOOLINGXMLDIR="$with_log4shib"
196 if test "x$XMLTOOLINGXMLDIR" = "x" ; then
197 AC_MSG_ERROR([xmltooling XML catalog not found, may need to use --with-xmltooling option])
199 XMLTOOLINGXMLDIR="$XMLTOOLINGXMLDIR/share/xml/xmltooling"
200 AC_SUBST(XMLTOOLINGXMLDIR)
202 # XML-Security settings
204 AC_HELP_STRING([--with-xmlsec=PATH], [where xmlsec is installed]),,
207 if test x_$with_xmlsec != x_/usr; then
208 LDFLAGS="-L${with_xmlsec}/lib $LDFLAGS"
209 CPPFLAGS="-I${with_xmlsec}/include $CPPFLAGS"
211 XMLSEC_LIBS="-lxml-security-c $XMLSEC_LIBS"
213 # save and append master libs
215 LIBS="$XMLSEC_LIBS $LIBS"
217 AC_CHECK_HEADER([xsec/utils/XSECPlatformUtils.hpp],,AC_MSG_ERROR([unable to find XML-Security header files]))
218 AC_MSG_CHECKING([XML-Security version])
220 [AC_LANG_PROGRAM([#include <xsec/utils/XSECPlatformUtils.hpp>],
221 [#if XSEC_VERSION_MAJOR > 1 || (XSEC_VERSION_MAJOR == 1 && XSEC_VERSION_MEDIUM > 3)
224 #error need version 1.4.0 or later
227 [AC_MSG_FAILURE([XML-Security version 1.4.0 or greater is required.])])
229 [#include <xsec/utils/XSECPlatformUtils.hpp>],
230 [XSECPlatformUtils::Initialise()],,
231 [AC_MSG_ERROR([unable to link with XML-Security])])
233 # restore master libs
238 AC_HELP_STRING([--with-saml=PATH], [where saml is installed]),
239 [if test x_$with_saml != x_/usr; then
240 LDFLAGS="-L${with_saml}/lib $LDFLAGS"
241 CPPFLAGS="-I${with_saml}/include $CPPFLAGS"
243 XMLSEC_LIBS="-lsaml $XMLSEC_LIBS"
245 # save and append master libs
247 LIBS="$XMLSEC_LIBS $LIBS"
249 AC_CHECK_HEADER([saml/saml2/metadata/Metadata.h],,
250 AC_MSG_ERROR([unable to find OpenSAML header files]))
252 [#include <saml/SAMLConfig.h>
253 #include <saml/version.h>],
254 [#if _OPENSAML_VERSION >= 20000
255 opensaml::SAMLConfig::getConfig();
257 #error Need OpenSAML version 2.0 or higher
259 [AC_DEFINE(HAVE_SAML,1,[Define if saml library was found])],
260 [AC_MSG_ERROR([unable to link with OpenSAML, or version was too old])])
262 # restore master libs
265 # Establish location of opensaml catalogs.
267 if test "x$with_saml" = "x" ; then
270 if test -f $with_saml/share/xml/opensaml/saml20-catalog.xml ; then
271 OPENSAMLXMLDIR="$with_saml"
273 if test -f $with_xmltooling/share/xml/opensaml/saml20-catalog.xml ; then
274 OPENSAMLXMLDIR="$with_xmltooling"
276 if test -f $with_xerces/share/xml/opensaml/saml20-catalog.xml ; then
277 OPENSAMLXMLDIR="$with_xerces"
279 if test -f $with_log4shib/share/xml/opensaml/saml20-catalog.xml ; then
280 OPENSAMLXMLDIR="$with_log4shib"
285 if test "x$OPENSAMLXMLDIR" = "x" ; then
286 AC_MSG_ERROR([opensaml XML catalogs not found, may need to use --with-saml option])
288 OPENSAMLXMLDIR="$OPENSAMLXMLDIR/share/xml/opensaml"
289 AC_SUBST(OPENSAMLXMLDIR)
292 AC_SUBST(XMLSEC_LIBS)
294 # output the underlying makefiles
295 WANT_SUBDIRS="doc schemas configs shibsp shibd util"
296 AC_CONFIG_FILES([Makefile doc/Makefile schemas/Makefile \
297 configs/Makefile shibsp/Makefile shibd/Makefile \
298 util/Makefile selinux/Makefile])
301 AC_CONFIG_FILES([adfs/Makefile])
302 AC_ARG_ENABLE([adfs],
303 AC_HELP_STRING([--disable-adfs], [don't build the ADFS module]),
304 [adfs_enabled=$enableval], [adfs_enabled=yes])
305 if test "x$adfs_enabled" = "x" ; then
308 AC_MSG_CHECKING(whether to build the ADFS module)
309 if test "$adfs_enabled" = "no" ; then
313 WANT_SUBDIRS="$WANT_SUBDIRS adfs"
318 # Build NSAPI module?
320 AC_MSG_CHECKING(for NSAPI module option)
322 AC_HELP_STRING([--with-nsapi=DIR], [Build NSAPI module for Netscape/iPlanet/SunONE]),
323 [WANT_NSAPI=$withval],[WANT_NSAPI=no])
324 AC_MSG_RESULT($WANT_NSAPI)
326 if test "$WANT_NSAPI" != "no"; then
327 if test ! -d $WANT_NSAPI/bin ; then
328 AC_MSG_ERROR(Please specify the path to the root of your Netscape/iPlanet/SunONE server using --with-nsapi=DIR)
330 AC_MSG_CHECKING(for NSAPI include files)
331 if test -d $WANT_NSAPI/include ; then
332 NSAPI_INCLUDE=$WANT_NSAPI/include
333 AC_MSG_RESULT(Netscape-Enterprise 3.x style)
334 AC_CHECK_HEADERS([$NSAPI_INCLUDE/nsapi.h])
335 NSAPI_INCLUDE="$NSAPI_INC_DIR -I$NSAPI_INCLUDE"
337 if test -d $WANT_NSAPI/plugins/include ; then
338 test -n "$NSAPI_INCLUDE" && NSAPI_INC_DIR="-I$NSAPI_INCLUDE"
339 NSAPI_INCLUDE="$WANT_NSAPI/plugins/include"
340 AC_MSG_RESULT(iPlanet 4.x / SunONE 6.x style)
341 AC_CHECK_HEADERS([$NSAPI_INCLUDE/nsapi.h])
342 NSAPI_INCLUDE="$NSAPI_INC_DIR -I$NSAPI_INCLUDE"
344 if test "$NSAPI_INCLUDE" = ""; then
345 AC_MSG_ERROR(Please check you have nsapi.h in either $WANT_NSAPI/include or $WANT_NSAPI/plugins/include)
349 AC_SUBST(NSAPI_INCLUDE)
351 # always output the Makefile, even if you don't use it
352 AC_CONFIG_FILES([nsapi_shib/Makefile])
353 AM_CONDITIONAL(BUILD_NSAPI,test ! "$WANT_NSAPI" = "no")
355 # add the NSAPI module to the list of wanted subdirs..
356 if test ! "$WANT_NSAPI" = "no" ; then
357 WANT_SUBDIRS="$WANT_SUBDIRS nsapi_shib"
362 # Build FastCGI support?
364 AC_MSG_CHECKING(for FastCGI support)
366 AC_HELP_STRING([--with-fastcgi=DIR], [Build FastCGI support]),
367 [WANT_FASTCGI=$withval],[WANT_FASTCGI=no])
368 AC_MSG_RESULT($WANT_FASTCGI)
370 if test "$WANT_FASTCGI" != "no"; then
371 if test "$WANT_FASTCGI" != "yes"; then
372 if test x_$WANT_FASTCGI != x_/usr; then
373 FASTCGI_INCLUDE="-I$WANT_FASTCGI/include"
374 FASTCGI_LDFLAGS="-L$WANT_FASTCGI/lib"
377 AC_CHECK_HEADER([fcgio.h],,
378 AC_MSG_ERROR([unable to find FastCGI header files]))
379 FASTCGI_LIBS="-lfcgi -lfcgi++"
382 AC_SUBST(FASTCGI_INCLUDE)
383 AC_SUBST(FASTCGI_LDFLAGS)
384 AC_SUBST(FASTCGI_LIBS)
386 # always output the Makefile, even if you don't use it
387 AC_CONFIG_FILES([fastcgi/Makefile])
388 AM_CONDITIONAL(BUILD_FASTCGI,test ! "$WANT_FASTCGI" = "no")
390 if test ! "$WANT_FASTCGI" = "no" ; then
391 WANT_SUBDIRS="$WANT_SUBDIRS fastcgi"
396 # If no --enable-apache-xx specified
397 # find a default and fake the specific parameters
400 # simple macro to peek at an enable or a with
402 if test "[${[$1]_][$2]+set}" = set; then
403 peekval="${[$1]_[$2]}"
408 AC_MSG_CHECKING(if default apache needed)
410 Peek(enable,apache_13,need_default=no)
411 Peek(enable,apache_20,need_default=no)
412 Peek(enable,apache_22,need_default=no)
413 AC_MSG_RESULT($need_default)
415 if test "$need_default" = "yes"; then
416 # find an apxs, then the httpd
418 Peek(with,apxs,xs="$peekval")
419 Peek(with,apxs2,xs="$peekval")
420 Peek(with,apxs22,xs="$peekval")
421 if test "x$xs" = "x"; then
422 AC_PATH_PROGS(xs, apxs2 apxs,
423 AC_MSG_ERROR(No apxs, no apache found. Try --with-apxs),
424 [/usr/local/apache2/bin:/usr/local/apache/bin:/usr/sbin:$PATH])
426 # ask the daemon for the version and set parameters
427 AC_MSG_CHECKING(default apache version)
428 httpd="`$xs -q SBINDIR`/`$xs -q TARGET`"
429 if test "x$httpd" != "x" && test -f $httpd ; then
430 v=`$httpd -v|$SED -n -e 's/.*Apache\/\.*//p'`
432 1.3*) [enable_apache_13]=yes
436 2.0*) [enable_apache_20]=yes
440 2.2*) [enable_apache_22]=yes
444 *) AC_MSG_ERROR(unusable apache versions: $v. Try setting --with-apxs)
447 AC_MSG_RESULT(cannot determine version. Try setting --with-apxs)
451 # Apache 1.3 (mod_shib_13)
453 # --with-apxs (DSO build, the normal way, uses apxs to derive build flags)
455 AC_ARG_ENABLE(apache-13,
456 AC_HELP_STRING([--enable-apache-13], [enable the Apache 1.3 module]),
457 [ if test "x$enableval" = "x" ; then
460 WANT_APACHE_13="$enableval"
462 ],[ WANT_APACHE_13=no ])
463 AC_MSG_CHECKING(whether to build Apache 1.3 module)
464 if test "$WANT_APACHE_13" != yes && test "$WANT_APACHE_13" != no ; then
467 AC_MSG_RESULT($WANT_APACHE_13)
469 if test "$WANT_APACHE_13" = "yes" ; then
471 AC_HELP_STRING([--with-apxs=FILE], [Specifies where to find the Apache 1.3 apxs script.]),
473 AC_MSG_CHECKING(for user-specified apxs name/location)
474 if test "$withval" != "no" ; then
475 if test "$withval" != "yes"; then
477 AC_MSG_RESULT("$withval")
482 AC_PATH_PROG(APXS, apxs, no)
483 if test "$APXS" = "no" ; then
484 for i in /usr/sbin /usr/local/apache/bin ; do
485 if test "$APXS" = "no" && test -f "$i/apxs"; then
492 AC_MSG_CHECKING([to see if apxs was located])
493 if test ! -f "$APXS" ; then
495 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.])
500 # extract settings we need from APXS -q
501 APXS_CC="`$APXS -q CC`"
502 APXS_CFLAGS="`$APXS -q CPPFLAGS` `$APXS -q CFLAGS` `$APXS -q CFLAGS_SHLIB`"
503 APXS_INCLUDE="`$APXS -q INCLUDEDIR`"
506 AC_SUBST(APXS_CFLAGS)
507 AC_SUBST(APXS_INCLUDE)
510 # Apache 2.0 (mod_shib_20)
512 # --with-apxs2 (DSO build, the normal way, uses apxs to derive build flags)
513 # --with-apr (DSO build, APR development package installed separately)
515 AC_ARG_ENABLE(apache-20,
516 AC_HELP_STRING([--enable-apache-20], [enable the Apache 2.0 module]),
517 [ if test "x$enableval" = "x" ; then
520 WANT_APACHE_20="$enableval"
522 ],[ WANT_APACHE_20=no ])
523 AC_MSG_CHECKING(whether to build Apache 2.0 module)
524 if test "$WANT_APACHE_20" != yes && test "$WANT_APACHE_20" != no ; then
527 AC_MSG_RESULT($WANT_APACHE_20)
529 if test "$WANT_APACHE_20" = "yes" ; then
531 AC_HELP_STRING([--with-apxs2=FILE], [Specifies where to find the Apache 2.0 apxs script.]),
533 AC_MSG_CHECKING(for user-specified Apache2 apxs name/location)
534 if test "$withval" != "no" ; then
535 if test "$withval" != "yes"; then
537 AC_MSG_RESULT("$withval")
542 AC_PATH_PROG(APXS2, apxs2, no)
543 if test "$APXS2" = "no" ; then
544 AC_PATH_PROG(APXS2, apxs, no)
546 if test "$APXS2" = "no" ; then
547 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
548 if test "$APXS2" = "no" && test -f "$i/apxs2" ; then
552 if test "$APXS2" = "no" ; then
553 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
554 if test "$APXS2" = "no" && test -f "$i/apxs" ; then
562 AC_MSG_CHECKING([to see if Apache2 apxs was located])
563 if test ! -f "$APXS2" ; then
565 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.])
567 AC_MSG_RESULT($APXS2)
572 AC_HELP_STRING([--with-apr=PATH], [where apr-config is installed]),
574 AC_MSG_CHECKING(for user-specified apr-config name/location)
575 if test "$withval" != "no" ; then
576 if test "$withval" != "yes"; then
578 AC_MSG_RESULT("$withval")
583 AC_PATH_PROG(APR_CONFIG, apr-config)
585 if test -f "${APR_CONFIG}"; then
586 APR_CFLAGS="`${APR_CONFIG} --cflags` `${APR_CONFIG} --cppflags` `${APR_CONFIG} --includes`"
588 AC_MSG_ERROR([Unable to locate apr-config, may need --with-apr option.])
591 # extract settings we need from APXS2 -q
592 APXS2_CC="`$APXS2 -q CC`"
593 APXS2_CFLAGS="`$APXS2 -q CPPFLAGS` `$APXS2 -q CFLAGS` `$APXS2 -q CFLAGS_SHLIB` $APR_CFLAGS"
594 APXS2_INCLUDE="`$APXS2 -q INCLUDEDIR`"
597 AC_SUBST(APXS2_CFLAGS)
598 AC_SUBST(APXS2_INCLUDE)
601 # Apache 2.2 (mod_shib_22)
603 # --with-apxs22 (DSO build, the normal way, uses apxs to derive build flags)
604 # --with-apr1 (DSO build, APR development package installed separately)
606 AC_ARG_ENABLE(apache-22,
607 AC_HELP_STRING([--enable-apache-22], [enable the Apache 2.2 module]),
608 [ if test "x$enableval" = "x" ; then
611 WANT_APACHE_22="$enableval"
613 ],[ WANT_APACHE_22=no ])
614 AC_MSG_CHECKING(whether to build Apache 2.2 module)
615 if test "$WANT_APACHE_22" != yes && test "$WANT_APACHE_22" != no ; then
618 AC_MSG_RESULT($WANT_APACHE_22)
620 if test "$WANT_APACHE_22" = "yes" ; then
622 AC_HELP_STRING([--with-apxs22=FILE], [Specifies where to find the Apache 2.2 apxs script.]),
624 AC_MSG_CHECKING(for user-specified Apache2.2 apxs name/location)
625 if test "$withval" != "no" ; then
626 if test "$withval" != "yes"; then
628 AC_MSG_RESULT("$withval")
633 AC_PATH_PROG(APXS22, apxs2, no)
634 if test "$APXS22" = "no" ; then
635 AC_PATH_PROG(APXS22, apxs, no)
637 if test "$APXS22" = "no" ; then
638 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
639 if test "$APXS22" = "no" && test -f "$i/apxs2" ; then
643 if test "$APXS22" = "no" ; then
644 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
645 if test "$APXS22" = "no" && test -f "$i/apxs" ; then
653 AC_MSG_CHECKING([to see if Apache2.2 apxs was located])
654 if test ! -f "$APXS22" ; then
656 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.])
658 AC_MSG_RESULT($APXS22)
663 AC_HELP_STRING([--with-apr1=PATH], [where apr-1-config is installed]),
665 AC_MSG_CHECKING(for user-specified apr-1-config name/location)
666 if test "$withval" != "no" ; then
667 if test "$withval" != "yes"; then
669 AC_MSG_RESULT("$withval")
674 AC_PATH_PROG(APR1_CONFIG, apr-1-config)
676 if test -f "${APR1_CONFIG}"; then
677 APR1_CFLAGS="`${APR1_CONFIG} --cflags` `${APR1_CONFIG} --cppflags` `${APR1_CONFIG} --includes`"
679 AC_MSG_ERROR([Unable to locate apr-1-config, may need --with-apr1 option.])
682 # extract settings we need from APXS22 -q
683 APXS22_CC="`$APXS22 -q CC`"
684 APXS22_CFLAGS="`$APXS22 -q CPPFLAGS` `$APXS22 -q CFLAGS` `$APXS22 -q CFLAGS_SHLIB` $APR1_CFLAGS"
685 APXS22_INCLUDE="`$APXS22 -q INCLUDEDIR`"
688 AC_SUBST(APXS22_CFLAGS)
689 AC_SUBST(APXS22_INCLUDE)
691 # always output the Makefile, even if you don't use it
692 AC_CONFIG_FILES([apache/Makefile])
693 AM_CONDITIONAL(BUILD_AP13,test "$WANT_APACHE_13" = "yes")
694 AM_CONDITIONAL(BUILD_AP20,test "$WANT_APACHE_20" = "yes")
695 AM_CONDITIONAL(BUILD_AP22,test "$WANT_APACHE_22" = "yes")
697 # add the apache module to the list of wanted subdirs..
698 if test "$WANT_APACHE_13" = "yes" || test "$WANT_APACHE_20" = "yes" || test "$WANT_APACHE_22" = "yes" ; then
699 WANT_SUBDIRS="$WANT_SUBDIRS apache"
704 # Implement the checks of the ODBC Storage Service
706 # 1) Assume the user wants ODBC; if it's not found then just continue without
707 # 2) If the user specifically requested odbc, look for it and ERROR if not found
708 # 3) If the user specifically requested no odbc, don't build it.
711 AC_CONFIG_FILES([odbc-store/Makefile])
713 # determine whether we should enable the odbc ccache
714 AC_ARG_ENABLE([odbc],
715 AC_HELP_STRING([--disable-odbc], [disable the ODBC Storage Service]),
716 [odbc_enabled=$enableval], [odbc_enabled=default])
718 if test "x$odbc_enabled" = "x" ; then
722 # Are we trying to build ODBC?
723 AC_MSG_CHECKING(whether to build the ODBC storage service)
724 if test "$odbc_enabled" = "yes" ; then
727 elif test "$odbc_enabled" = "default" ; then
729 AC_MSG_RESULT([yes, if it can be found])
735 # If we're trying to build ODBC, try to find the odbc_config program.
736 if test "$build_odbc" = "yes" ; then
739 AC_HELP_STRING([--with-odbc=PATH], [directory where odbc is installed]),
740 [if test "$with_odbc" = no ; then
741 AC_MSG_ERROR([Try running --disable-odbc instead.])
742 elif test "$with_odbc" != yes ; then
743 odbc_dir="$with_odbc/bin"
746 AC_PATH_PROG(ODBC_CONFIG, odbc_config, no, $odbc_dir $PATH )
748 if test "$ODBC_CONFIG" = no ; then
749 if test "$odbc_enabled" = "yes" ; then
750 AC_MSG_ERROR(Cannot find odbc_config)
752 AC_MSG_WARN(ODBC not found, skipping.)
757 if test "$build_odbc" = yes ; then
758 ODBC_CFLAGS=`$ODBC_CONFIG --cflags`
759 ODBC_CFLAGS=`eval echo $ODBC_CFLAGS`
760 ODBC_LIBS=`$ODBC_CONFIG --libs`
761 ODBC_LIBS=`eval echo $ODBC_LIBS`
763 save_CPPFLAGS="$CPPFLAGS"
764 CPPFLAGS="$CPPFLAGS $ODBC_CFLAGS"
766 AC_CHECK_HEADER([sql.h], [have_sql_h=yes], [have_sql_h=no])
767 if test "$have_sql_h" = no -a "$odbc_enabled" = "yes" ; then
768 AC_MSG_ERROR(unable to find ODBC header files)
771 if test "$have_sql_h" = yes ; then
773 LIBS="$LIBS $ODBC_LIBS"
774 AC_MSG_CHECKING(if we can link againt ODBC)
779 [SQLSetEnvAttr(SQL_NULL_HANDLE, SQL_ATTR_CONNECTION_POOLING, (void*)SQL_CP_ONE_PER_HENV, 0)],
780 [have_odbc_libs=yes],
784 if test "$have_odbc_libs" = no ; then
785 if test "$odbc_enabled" = "yes" ; then
786 AC_MSG_ERROR([unable to link with ODBC Library])
788 AC_MSG_RESULT(no, skipping ODBC)
793 CPPFLAGS="$save_CPPFLAGS"
796 # if have_odbc_libs=yes then go ahead with building ODBC
797 if test "$have_odbc_libs" = yes ; then
798 # this AC_MSG_RESULT is from above!
800 WANT_SUBDIRS="$WANT_SUBDIRS odbc-store"
801 AC_SUBST(ODBC_CFLAGS)
806 AC_SUBST(WANT_SUBDIRS)
808 if test -n "$APXS_CC" && test "$APXS_CC" != "$CC" ; then
809 echo "=================================================================="
810 echo "WARNING: You have chosen to compile Apache-1.3 modules with a different"
811 echo " compiler than the one used to compile Apache."
813 echo " Current compiler: $CC"
814 echo " Apache's compiler: $APXS_CC"
816 echo "This could cause problems."
817 echo "=================================================================="
820 if test -n "$APXS2_CC" && test "$APXS2_CC" != "$CC" ; then
821 echo "=================================================================="
822 echo "WARNING: You have chosen to compile Apache-2.0 modules with a different"
823 echo " compiler than the one used to compile Apache."
825 echo " Current compiler: $CC"
826 echo " Apache's compiler: $APXS2_CC"
828 echo "This could cause problems."
829 echo "=================================================================="
832 if test -n "$APXS22_CC" && test "$APXS22_CC" != "$CC" ; then
833 echo "=================================================================="
834 echo "WARNING: You have chosen to compile Apache-2.2 modules with a different"
835 echo " compiler than the one used to compile Apache."
837 echo " Current compiler: $CC"
838 echo " Apache's compiler: $APXS22_CC"
840 echo "This could cause problems."
841 echo "=================================================================="
844 LIBTOOL="$LIBTOOL --silent"