2 AC_INIT([shibboleth], [1.2], [shibboleth-users@internet2.edu], [shibboleth])
3 AM_CONFIG_HEADER(config.h)
4 AM_INIT_AUTOMAKE(shibboleth, 1.2)
6 sinclude(acx_pthread.m4)
7 sinclude(acx_rpctest.m4)
9 AC_PROG_CC([gcc3 gcc cc])
10 AC_PROG_CXX([g++3 g++ c++ CC])
16 # Checks for typedefs, structures, and compiler characteristics.
21 # Checks for library functions.
24 AC_CHECK_FUNCS([strchr strdup strstr gmtime_r strtok_r strcasecmp])
25 AC_CHECK_HEADERS([dlfcn.h])
33 # AC_SEARCH_LIBS(xdr_uint64_t,nsl,,
34 # [CFLAGS="$CFLAGS -DNEED_XDR_LONGLONG"
35 # CXXFLAGS="$CXXFLAGS -DNEED_XDR_LONGLONG"])
39 ACX_PTHREAD([enable_threads="pthread"],[enable_threads="no"])
40 if test $enable_threads != "pthread"; then
41 AC_MSG_ERROR([unable to find pthreads, currently this is required])
43 AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.])
44 LIBS="$PTHREAD_LIBS $LIBS"
45 CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
46 CXXFLAGS="$PTHREAD_CFLAGS $CXXFLAGS"
49 # Test RPC now -- deal with it later
50 ACX_RPCTEST([rpctest="yes"],[rpctest="no"])
52 # Determine whether to use TCP for the shar socket
54 AC_HELP_STRING([--enable-tcp], [enable the SHAR to use a TCP socket on Unix]),
55 [tcp_enabled=$enableval], [tcp_enabled=default])
57 if test "x$tcp_enabled" = "x" ; then
61 if test "$tcp_enabled" = "yes" ; then
62 CFLAGS="$CFLAGS -DWANT_TCP_SHAR"
63 CXXFLAGS="$CXXFLAGS -DWANT_TCP_SHAR"
67 AC_HELP_STRING([--with-dmalloc=PATH], [where dmalloc is installed]),
68 [if test x_$with_dmalloc != x_/usr; then
69 LDFLAGS="-L${with_dmalloc}/lib $LDFLAGS"
70 CPPFLAGS="-I${with_dmalloc}/include $CPPFLAGS"
72 AC_CHECK_LIB(dmallocxx, dmalloc_shutdown,,
73 AC_MSG_ERROR([unable to find dmallocxx library]))
77 AC_PATH_PROG(PKG_CONFIG, pkg-config)
78 if test "x$PKG_CONFIG" = x || test "x$PKG_CONFIG" = "xno" ; then
80 AC_HELP_STRING([--with-openssl=PATH], [where openssl is installed]),
81 [if test x_$with_openssl != x_/usr; then
82 SSLLIBS="-L${with_openssl}/lib"
83 SSLFLAGS="-I${with_openssl}/include"
85 SSLLIBS="$SSLLIBS -lssl -lcrypto"
87 SSLLIBS="`$PKG_CONFIG --libs openssl`"
88 SSLFLAGS="`$PKG_CONFIG --cflags openssl`"
90 AC_MSG_CHECKING(for OpenSSL libraries)
91 AC_MSG_RESULT($SSLLIBS)
93 AC_MSG_CHECKING(for OpenSSL cflags)
94 AC_MSG_RESULT($SSLFLAGS)
95 CPPFLAGS="$SSLFLAGS $CPPFLAGS"
97 AC_CHECK_HEADER([openssl/ssl.h],,
98 AC_MSG_ERROR([unable to find openssl header files]))
99 AC_MSG_CHECKING(for ERR_load_CRYPTO_string)
100 AC_TRY_LINK_FUNC([ERR_load_CRYPTO_strings],,
101 AC_MSG_ERROR([unable to link with openssl libraries]))
103 AC_MSG_CHECKING(for SSL_library_init)
104 AC_TRY_LINK_FUNC([SSL_library_init],,
105 AC_MSG_ERROR([unable to link with openssl libraries]))
109 LOG4CPP_CONFIG="log4cpp-config"
111 AC_HELP_STRING([--with-log4cpp=PATH], [where log4cpp is installed]),
112 [LOG4CPP_CONFIG="${with_log4cpp}/bin/log4cpp-config"])
113 if test -f ${LOG4CPP_CONFIG}; then
114 LDFLAGS="`${LOG4CPP_CONFIG} --libs` $LDFLAGS"
115 CPPFLAGS="`${LOG4CPP_CONFIG} --cflags` $CPPFLAGS"
117 AC_MSG_WARN([log4cpp-config not found, guessing at log4cpp build settings])
118 LIBS="-llog4cpp $LIBS"
120 AC_CHECK_HEADER([log4cpp/Category.hh],,AC_MSG_ERROR([unable to find log4cpp header files]))
122 [#include <log4cpp/Category.hh>],
123 [log4cpp::Category::getInstance("foo")],
124 [AC_DEFINE(HAVE_LIBLOG4CPP,1,[Define if log4cpp library was found])],
125 [AC_MSG_ERROR([unable to link with log4cpp])])
129 AC_HELP_STRING([--with-xerces=PATH], [where xerces-c is installed]),
130 [if test x_$with_xerces != x_/usr; then
131 LDFLAGS="-L${with_xerces}/lib $LDFLAGS"
132 CPPFLAGS="-I${with_xerces}/include $CPPFLAGS"
134 LIBS="-lxerces-c $LIBS"
135 AC_CHECK_HEADER([xercesc/dom/DOM.hpp],,
136 AC_MSG_ERROR([unable to find xerces header files]))
138 [#include <xercesc/util/PlatformUtils.hpp>],
139 [xercesc::XMLPlatformUtils::Initialize()],
140 [AC_DEFINE(HAVE_LIBXERCESC,1,[Define if Xerces-C library was found])],
141 [AC_MSG_ERROR([unable to link with Xerces])])
143 # XML-Security settings
145 AC_HELP_STRING([--with-xmlsec=PATH], [where xmlsec is installed]),
146 [if test x_$with_xmlsec != x_/usr; then
147 LDFLAGS="-L${with_xmlsec}/lib $LDFLAGS"
148 CPPFLAGS="-I${with_xmlsec}/include $CPPFLAGS"
150 LIBS="-lxml-security-c $LIBS"
151 AC_CHECK_HEADER([xsec/utils/XSECPlatformUtils.hpp],,AC_MSG_ERROR([unable to find xsec header files]))
153 [#include <xsec/utils/XSECPlatformUtils.hpp>],
154 [XSECPlatformUtils::Initialise()],
155 [AC_DEFINE(HAVE_LIBXSEC,1,[Define if XML-Sec library was found])],
156 [AC_MSG_ERROR([unable to link with XML-Sec])])
160 AC_HELP_STRING([--with-saml=PATH], [where saml is installed]),
161 [if test x_$with_saml != x_/usr; then
162 LDFLAGS="-L${with_saml}/lib $LDFLAGS"
163 CPPFLAGS="-I${with_saml}/include $CPPFLAGS"
165 AC_CHECK_HEADER([saml/saml.h],,
166 AC_MSG_ERROR([unable to find saml header files]))
169 [#include <saml/saml.h>],
170 [saml::SAMLConfig::getConfig()],
171 [AC_DEFINE(HAVE_SAML,1,[Define if saml library was found])],
172 [AC_MSG_ERROR([unable to link with saml])])
175 # output the underlying makefiles
176 WANT_SUBDIRS="doc shib schemas configs shib-target shar siterefresh test xmlproviders"
177 AC_CONFIG_FILES([Makefile doc/Makefile shib/Makefile schemas/Makefile \
178 configs/Makefile oncrpc/Makefile oncrpc/rpc/Makefile \
179 shib-target/Makefile shar/Makefile siterefresh/Makefile \
180 test/Makefile xmlproviders/Makefile])
183 # now deal with the rpc library, to see if we need to build our own
184 if test $rpctest = "no"; then
185 WANT_SUBDIRS="oncrpc $WANT_SUBDIRS"
186 AC_DEFINE(USE_OUR_ONCRPC,1,[Define if using embedded version of ONC RPC.])
188 AM_CONDITIONAL(USE_OUR_ONCRPC,test "$rpctest" = "no")
191 # Apache 1.3 (mod_shire/mod_shibrm)
192 # --with-apache-13 (static build, no idea how to do this yet, so not supported)
193 # --with-apxs (DSO build, the normal way, uses apxs to derive build flags)
194 # --without-apxs (DSO build, you tell us how to build using the environment)
196 AC_ARG_ENABLE(apache-13,
197 AC_HELP_STRING([--enable-apache-13], [enable the Apache 1.3 modules]),
198 [ if test "x$enableval" = "x" ; then
201 WANT_APACHE_13="$enableval"
203 ], [ WANT_APACHE_13=no ])
204 AC_MSG_CHECKING(whether to build Apache-1.3 support)
205 if test "$WANT_APACHE_13" != yes && test "$WANT_APACHE_13" != no ; then
208 AC_MSG_RESULT($WANT_APACHE_13)
210 if test "$WANT_APACHE_13" = yes ; then
213 [ --with-apxs[=FILE] Build shared Apache module(s). FILE is the optional
214 pathname to the Apache apxs tool; defaults to "apxs".],
216 if test "$withval" = "yes"; then
217 for i in /usr/sbin /usr/local/apache/bin ; do
218 if test -f "$i/apxs"; then
222 if test -z "$APXS"; then
230 AC_PATH_PROG(APXS, apxs, no)
233 AC_MSG_CHECKING([for dynamic Apache-1.3 module support (w/ or w/o APXS)])
234 if test "$APXS" = "no"; then
236 # --without-apxs means you want the modules,
237 # but want to tell us how to build them
238 AC_MSG_RESULT(yes, but use environment, not apxs)
240 echo "Did you set one or more of these?"
242 echo "APXS_CFLAGS APXS_PREFIX APXS_INCLUDE APXS_LIBEXEC APXS_SYSCONFDIR"
245 AC_MSG_NOTICE([APXS_CFLAGS is $APXS_CFLAGS])
247 # try and find the Apache root
248 if test -z "$APXS_PREFIX"; then
249 if test -d "/usr/local/apache"; then
250 APXS_PREFIX="/usr/local/apache"
252 AC_MSG_ERROR([You MUST set APXS_PREFIX so the right Apache can be located!])
254 elif test ! -d "$APXS_PREFIX"; then
255 AC_MSG_ERROR([APXS_PREFIX of $APXS_PREFIX cannot be found])
257 AC_MSG_NOTICE([APXS_PREFIX is $APXS_PREFIX])
260 # other subfolders might be derived from APXS_PREFIX
261 if test -z "$APXS_INCLUDE"; then
262 if test -f "$APXS_PREFIX/include/httpd.h"; then
263 APXS_INCLUDE="$APXS_PREFIX/include"
265 AC_MSG_ERROR([can't find Apache include files beneath $APXS_PREFIX])
267 elif ! test -f "$APXS_INCLUDE/httpd.h"; then
268 AC_MSG_ERROR([APXS_INCLUDE of $APXS_INCLUDE does not contain Apache headers])
270 AC_MSG_NOTICE([APXS_INCLUDE is $APXS_INCLUDE])
272 if test -z "$APXS_LIBEXEC"; then
273 if test -d "$APXS_PREFIX/libexec"; then
274 APXS_LIBEXEC="$APXS_PREFIX/libexec"
275 elif test -d "$APXS_PREFIX/modules"; then
276 APXS_LIBEXEC="$APXS_PREFIX/modules"
278 AC_MSG_ERROR([can't find Apache libexec/module directory beneath $APXS_PREFIX])
280 elif ! test -d "$APXS_LIBEXEC"; then
281 AC_MSG_ERROR([APXS_LIBEXEC of $APXS_LIBEXEC does not exist])
283 AC_MSG_NOTICE([APXS_LIBEXEC is $APXS_LIBEXEC])
285 if test -z "$APXS_SYSCONFDIR"; then
286 if test -d "$APXS_PREFIX/conf"; then
287 APXS_SYSCONFDIR="$APXS_PREFIX/conf"
289 AC_MSG_ERROR([can't find Apache conf directory beneath $APXS_PREFIX])
291 elif ! test -d "$APXS_SYSCONFDIR"; then
292 AC_MSG_ERROR([APXS_SYSCONFDIR of $APXS_SYSCONFDIR does not exist])
294 AC_MSG_NOTICE([APXS_SYSCONFDIR is $APXS_SYSCONFDIR])
298 elif test -n "$APXS"; then
300 # extract settings we need from APXS -q
301 APXS_CC="`$APXS -q CC`"
302 APXS_CFLAGS="`$APXS -q CFLAGS` `$APXS -q CFLAGS_SHLIB`"
303 APXS_INCLUDE="`$APXS -q INCLUDEDIR`"
304 APXS_LIBEXEC="`$APXS -q LIBEXECDIR`"
305 APXS_SYSCONFDIR="`$APXS -q SYSCONFDIR`"
308 AC_MSG_RESULT(found at $APXS)
310 if test -z "`$APXS -q LD_SHLIB`" || test "$APXS_LIBEXEC" = "modules"; then
312 [Your APXS installation is broken and cannot be used.
313 Please see http://www.webdav.org/mod_dav/install.html#apxs for
320 # guess we're not doing Apache 1.3
326 if test "$WANT_APACHE_13" = "yes"; then
328 AC_HELP_STRING([--with-apreq=PATH], [where libapreq is installed]),
329 [if test x_$with_apreq != x_/usr; then
330 LDFLAGS="-L${with_apreq}/lib $LDFLAGS"
331 CPPFLAGS="-I${with_apreq}/include $CPPFLAGS"
334 saved_CPPFLAGS="$CPPFLAGS"
335 CPPFLAGS="-I$APXS_INCLUDE $APXS_CFLAGS $CPPFLAGS"
336 AC_TRY_COMPILE([#include <libapreq/apache_request.h>],
338 test_apreq="yes",test_apreq="no")
339 if test "$test_apreq" = "no"; then
340 CPPFLAGS="$CPPFLAGS -U_XOPEN_SOURCE"
341 APXS_CFLAGS="$APXS_CFLAGS -U_XOPEN_SOURCE"
342 AC_CHECK_HEADER([libapreq/apache_request.h],,
343 AC_MSG_ERROR([unable to find a usable libapreq header]))
346 dnl saved_LIBS="$LIBS"
347 dnl LIBS="-lapreq $LIBS"
349 dnl [#include <libapreq/apache_request.h>],
350 dnl [ApacheRequest_expires],
351 dnl [AC_DEFINE(HAVE_APREQ,1,[Define if apreq library was found])],
352 dnl [AC_MSG_ERROR([unable to link with apreq])
354 dnl LIBS="$saved_LIBS"
355 CPPFLAGS="$saved_CPPFLAGS"
357 AC_ARG_ENABLE([apxs-install],
358 AC_HELP_STRING([--enable-apxs-install],
359 [use apxs to install the apache modules]),
360 APXS_INSTALL="yes", )
363 AC_SUBST(APXS_CFLAGS)
364 AC_SUBST(APXS_INCLUDE)
365 AC_SUBST(APXS_LIBEXEC)
366 AC_SUBST(APXS_SYSCONFDIR)
368 # output the Apache 1.3 makefiles
369 WANT_SUBDIRS="$WANT_SUBDIRS mod_shire mod_shibrm"
371 # always output the Makefile, even if we don't use it
372 AC_CONFIG_FILES([mod_shire/Makefile])
373 AM_CONDITIONAL(HAVE_APXS,test -n "$APXS")
374 AM_CONDITIONAL(DO_APXS_INSTALL,test -n "$APXS_INSTALL")
377 # Apache 2.0 (mod_shib in apache-2.0)
378 # --with-apache-20 (static build, no idea how to do this yet, so not supported)
379 # --with-apxs2 (DSO build, the normal way, uses apxs to derive build flags)
380 # --without-apxs2 (DSO build, you tell us how to build using the environment)
382 AC_ARG_ENABLE(apache-20,
383 AC_HELP_STRING([--enable-apache-20], [enable the Apache 2.0 modules]),
384 [ if test "x$enableval" = "x" ; then
387 WANT_APACHE_20="$enableval"
389 ], [ WANT_APACHE_20=no ])
391 AC_MSG_CHECKING(whether to build Apache-2.0 support)
392 if test "$WANT_APACHE_20" != yes && test "$WANT_APACHE_20" != no ; then
395 AC_MSG_RESULT($WANT_APACHE_20)
397 if test "$WANT_APACHE_20" = yes ; then
400 [ --with-apxs2[=FILE] Build shared Apache module(s). FILE is the optional
401 pathname to the Apache apxs tool; defaults to "apxs".],
403 if test "$withval" = "yes"; then
404 for i in /usr/sbin /usr/local/apache/bin ; do
405 if test -f "$i/apxs"; then
409 if test -z "$APXS2"; then
417 AC_PATH_PROG(APXS2, apxs, no)
420 AC_MSG_CHECKING([for dynamic Apache-2 module support (w/ or w/o APXS)])
421 if test "$APXS2" = "no"; then
423 # --without-apxs2 means you want the modules,
424 # but want to tell us how to build them
425 AC_MSG_RESULT(yes, but use environment, not apxs)
427 echo "Did you set one or more of these?"
429 echo "APXS2_CFLAGS APXS2_PREFIX APXS2_INCLUDE APXS2_LIBEXEC APXS2_SYSCONFDIR"
432 AC_MSG_NOTICE([APXS2_CFLAGS is $APXS2_CFLAGS])
434 # try and find the Apache root
435 if test -z "$APXS2_PREFIX"; then
436 if test -d "/usr/local/apache"; then
437 APXS2_PREFIX="/usr/local/apache"
439 AC_MSG_ERROR([You MUST set APXS2_PREFIX so the right Apache-2 can be located!])
441 elif test ! -d "$APXS2_PREFIX"; then
442 AC_MSG_ERROR([APXS2_PREFIX of $APXS2_PREFIX cannot be found])
444 AC_MSG_NOTICE([APXS2_PREFIX is $APXS2_PREFIX])
447 # other subfolders might be derived from APXS2_PREFIX
448 if test -z "$APXS2_INCLUDE"; then
449 if test -f "$APXS2_PREFIX/include/httpd.h"; then
450 APXS2_INCLUDE="$APXS2_PREFIX/include"
452 AC_MSG_ERROR([can't find Apache-2 include files beneath $APXS2_PREFIX])
454 elif ! test -f "$APXS2_INCLUDE/httpd.h"; then
455 AC_MSG_ERROR([APXS2_INCLUDE of $APXS2_INCLUDE does not contain Apache-2 headers])
457 AC_MSG_NOTICE([APXS2_INCLUDE is $APXS2_INCLUDE])
459 if test -z "$APXS2_LIBEXEC"; then
460 if test -d "$APXS2_PREFIX/libexec"; then
461 APXS2_LIBEXEC="$APXS2_PREFIX/libexec"
462 elif test -d "$APXS2_PREFIX/modules"; then
463 APXS2_LIBEXEC="$APXS2_PREFIX/modules"
465 AC_MSG_ERROR([can't find Apache-2 libexec/module directory beneath $APXS2_PREFIX])
467 elif ! test -d "$APXS2_LIBEXEC"; then
468 AC_MSG_ERROR([APXS2_LIBEXEC of $APXS2_LIBEXEC does not exist])
470 AC_MSG_NOTICE([APXS2_LIBEXEC is $APXS2_LIBEXEC])
472 if test -z "$APXS2_SYSCONFDIR"; then
473 if test -d "$APXS2_PREFIX/conf"; then
474 APXS2_SYSCONFDIR="$APXS2_PREFIX/conf"
476 AC_MSG_ERROR([can't find Apache-2 conf directory beneath $APXS2_PREFIX])
478 elif ! test -d "$APXS2_SYSCONFDIR"; then
479 AC_MSG_ERROR([APXS2_SYSCONFDIR of $APXS2_SYSCONFDIR does not exist])
481 AC_MSG_NOTICE([APXS2_SYSCONFDIR is $APXS2_SYSCONFDIR])
485 elif test -n "$APXS2"; then
487 # extract settings we need from APXS2 -q
488 APXS2_CC="`$APXS2 -q CC`"
489 APXS2_CFLAGS="`$APXS2 -q CFLAGS` `$APXS2 -q CFLAGS_SHLIB`"
490 APXS2_INCLUDE="`$APXS2 -q INCLUDEDIR`"
491 APXS2_LIBEXEC="`$APXS2 -q LIBEXECDIR`"
492 APXS2_SYSCONFDIR="`$APXS2 -q SYSCONFDIR`"
495 AC_MSG_RESULT(found at $APXS2)
497 if test -z "`$APXS2 -q LD_SHLIB`" && test -z "`$APXS2 -q LIBEXECDIR`" \
498 || test "$APXS2_LIBEXEC" = "modules"; then
500 [Your APXS installation is broken and cannot be used.
501 Please see http://www.webdav.org/mod_dav/install.html#apxs for
508 # guess we're not doing Apache 2.0
514 if test "$WANT_APACHE_20" = "yes"; then
516 AC_HELP_STRING([--with-apreq2=PATH], [where http-apreq-2 is installed]),
517 [if test x_$with_apreq2 != x_/usr; then
518 LDFLAGS="-L${with_apreq2}/lib $LDFLAGS"
519 CPPFLAGS="-I${with_apreq2}/include $CPPFLAGS"
522 saved_CPPFLAGS="$CPPFLAGS"
523 CPPFLAGS="-I$APXS2_INCLUDE $APXS2_CFLAGS $CPPFLAGS"
524 AC_TRY_COMPILE([#include <apreq.h>],
526 test_apreq2="yes",test_apreq2="no")
527 if test "$test_apreq2" = "no"; then
528 CPPFLAGS="$CPPFLAGS -U_XOPEN_SOURCE"
529 APXS2_CFLAGS="$APXS2_CFLAGS -U_XOPEN_SOURCE"
530 AC_CHECK_HEADER([apreq.h],,
531 AC_MSG_ERROR([unable to find a usable libapreq2 header]))
534 dnl saved_LIBS="$LIBS"
535 dnl LIBS="-lapreq $LIBS"
537 dnl [#include <apreq.h>],
539 dnl [AC_DEFINE(HAVE_APREQ2,1,[Define if apreq2 library was found])],
540 dnl [AC_MSG_ERROR([unable to link with apreq2])
542 dnl LIBS="$saved_LIBS"
543 CPPFLAGS="$saved_CPPFLAGS"
545 AC_ARG_ENABLE([apxs2-install],
546 AC_HELP_STRING([--enable-apxs2-install],
547 [use apxs to install the apache-2 modules]),
548 APXS2_INSTALL="yes", )
551 AC_SUBST(APXS2_CFLAGS)
552 AC_SUBST(APXS2_INCLUDE)
553 AC_SUBST(APXS2_LIBEXEC)
554 AC_SUBST(APXS2_SYSCONFDIR)
556 # output the Apache 2.0 makefiles
557 WANT_SUBDIRS="$WANT_SUBDIRS apache-2.0"
559 # always output the Makefile, even if we don't use it
560 AC_CONFIG_FILES([apache-2.0/Makefile])
561 AM_CONDITIONAL(HAVE_APXS2,test -n "$APXS2")
562 AM_CONDITIONAL(DO_APXS2_INSTALL,test -n "$APXS2_INSTALL")
566 # Implement the checks of the MySQL Credential Cache
568 # 1) Assume the user wants MySQL; if it's not found then just continue without
569 # 2) If the user specifically requested Mysql, look for it and ERROR if not found
570 # 3) If the user specifically requested no-mysql, don't build it.
573 AC_CONFIG_FILES([shib-mysql-ccache/Makefile])
575 # determine whether we should enable the mysql ccache
576 AC_ARG_ENABLE([mysql],
577 AC_HELP_STRING([--disable-mysql], [disable the MySQL Credential Cache]),
578 [mysql_enabled=$enableval], [mysql_enabled=default])
580 if test "x$mysql_enabled" = "x" ; then
584 # Are we trying to build MySQL?
585 AC_MSG_CHECKING(whether to build the MySQL ccache)
586 if test "$mysql_enabled" = "yes" ; then
589 elif test "$mysql_enabled" = "default" ; then
591 AC_MSG_RESULT([yes, if it can be found])
597 # If we're trying to build MySQL, try to find the mysql_config program,
598 # verify we've got mysql >= 4, and make sure we can build with mysqld
599 if test "$build_mysql" = "yes" ; then
602 AC_HELP_STRING([--with-mysql=PATH], [directory where mysql is installed]),
603 [if test "$with_mysql" = no ; then
604 AC_MSG_ERROR([Try running --disable-mysql instead.])
605 elif test "$with_mysql" != yes ; then
606 mysql_dir="$with_mysql/bin"
609 # Try to find the mysql_config program
610 AC_PATH_PROG(MYSQL_CONFIG, mysql_config, no, $mysql_dir $PATH )
612 if test "$MYSQL_CONFIG" = no ; then
613 if test "$mysql_enabled" = "yes" ; then
614 AC_MSG_ERROR(Cannot find mysql_config)
616 AC_MSG_WARN(MySQL not found. skipping.)
621 # if we found mysql_config then build_mysql is 'yes'
622 if test "$MYSQL_CONFIG" != no ; then
623 AC_MSG_CHECKING(for mysql version >= 4)
624 mysql_version=`$MYSQL_CONFIG --version`
625 mysql_major_version=`echo $mysql_version | awk -F. '{print $1}'`
627 if test $mysql_major_version -lt 4 ; then
629 if test "$mysql_enabled" = "yes" ; then
630 AC_MSG_ERROR(You need MySQL version >= 4, found $mysql_version)
632 AC_MSG_RESULT(no.. skipping MySQL)
638 # if mysql_version_ok is 'yes', then we've made it this far.. ;)
639 if test "$mysql_version_ok" = "yes" ; then
640 AC_MSG_CHECKING(for embedded-MySQL libraries)
641 MYSQL_LIBS=`$MYSQL_CONFIG --libmysqld-libs`
642 if test $? != 0 ; then
644 if test "$mysql_enabled" = "yes" ; then
645 AC_MSG_ERROR(Could not find the MySQL Embedded-server libraries.)
647 AC_MSG_RESULT(no.. skipping MySQL)
655 # if found_mysql=yes then test that we can actually build mysql
656 if test "$found_mysql" = yes ; then
657 MYSQL_CFLAGS=`$MYSQL_CONFIG --cflags`
658 MYSQL_CFLAGS=`eval echo $MYSQL_CFLAGS`
659 MYSQL_LIBS=`eval echo $MYSQL_LIBS`
661 save_CPPFLAGS="$CPPFLAGS"
662 CPPFLAGS="$CPPFLAGS $MYSQL_CFLAGS"
664 AC_CHECK_HEADER([mysql.h], [have_mysql_h=yes], [have_mysql_h=no])
665 if test "$have_mysql_h" = no -a "$mysql_enabled" = "yes" ; then
666 AC_MSG_ERROR(unable to find MySQL header files)
669 if test "$have_mysql_h" = yes ; then
671 LIBS="$LIBS $MYSQL_LIBS"
672 AC_MSG_CHECKING(if we can link againt mysql)
676 [mysql_server_init(0, NULL, NULL)],
677 [have_mysql_libs=yes],
678 [have_mysql_libs=no])
681 if test "$have_mysql_libs" = no ; then
682 if test "$mysql_enabled" = "yes" ; then
683 AC_MSG_ERROR([unable to link with MySQL Embedded Server Library])
685 AC_MSG_RESULT(no. skipping MySQL)
690 CPPFLAGS="$save_CPPFLAGS"
693 # if have_mysql_libs=yes then go ahead with building MySQL
694 if test "$have_mysql_libs" = yes ; then
695 # this AC_MSG_RESULT is from above!
697 WANT_SUBDIRS="$WANT_SUBDIRS shib-mysql-ccache"
698 AC_SUBST(MYSQL_CFLAGS)
703 AC_SUBST(WANT_SUBDIRS)
705 if test -n "$APXS_CC" && test "$APXS_CC" != "$CC" ; then
706 echo "=================================================================="
707 echo "WARNING: You have chosen to compile Apache-1.3 modules with a different"
708 echo " compiler than the one used to compile Apache."
710 echo " Current compiler: $CC"
711 echo " Apache's compiler: $APXS_CC"
713 echo "This could cause some problems."
714 echo "=================================================================="
717 if test -n "$APXS2_CC" && test "$APXS2_CC" != "$CC" ; then
718 echo "=================================================================="
719 echo "WARNING: You have chosen to compile Apache-2 modules with a different"
720 echo " compiler than the one used to compile Apache."
722 echo " Current compiler: $CC"
723 echo " Apache's compiler: $APXS2_CC"
725 echo "This could cause some problems."
726 echo "=================================================================="