2 AC_INIT([shibboleth], [1.1], [mace-shib-users@internet2.edu], [shibboleth])
3 AM_CONFIG_HEADER(config.h)
4 AM_INIT_AUTOMAKE(shibboleth, 1.1)
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.
23 AC_CHECK_FUNCS([strchr strdup strstr gmtime_r strtok_r strcasecmp])
24 AC_CHECK_HEADERS([dlfcn.h])
32 # AC_SEARCH_LIBS(xdr_uint64_t,nsl,,
33 # [CFLAGS="$CFLAGS -DNEED_XDR_LONGLONG"
34 # CXXFLAGS="$CXXFLAGS -DNEED_XDR_LONGLONG"])
38 ACX_PTHREAD([enable_threads="pthread"],[enable_threads="no"])
39 if test $enable_threads != "pthread"; then
40 AC_MSG_ERROR([unable to find pthreads, currently this is required])
42 AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.])
43 LIBS="$PTHREAD_LIBS $LIBS"
44 CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
45 CXXFLAGS="$PTHREAD_CFLAGS $CXXFLAGS"
48 # Test RPC now -- deal with it later
49 ACX_RPCTEST([rpctest="yes"],[rpctest="no"])
51 # Determine whether to use TCP for the shar socket
53 AC_HELP_STRING([--enable-tcp], [enable the SHAR to use a TCP socket on Unix]),
54 [tcp_enabled=$enableval], [tcp_enabled=default])
56 if test "x$tcp_enabled" = "x" ; then
60 if test "$tcp_enabled" = "yes" ; then
61 CFLAGS="$CFLAGS -DWANT_TCP_SHAR"
62 CXXFLAGS="$CXXFLAGS -DWANT_TCP_SHAR"
66 AC_HELP_STRING([--with-dmalloc=PATH], [where dmalloc is installed]),
67 [if test x_$with_dmalloc != x_/usr; then
68 LDFLAGS="-L${with_dmalloc}/lib $LDFLAGS"
69 CPPFLAGS="-I${with_dmalloc}/include $CPPFLAGS"
71 AC_CHECK_LIB(dmallocxx, dmalloc_shutdown,,
72 AC_MSG_ERROR([unable to find dmallocxx library]))
76 AC_HELP_STRING([--with-xerces=PATH], [where xerces-c is installed]),
77 [if test x_$with_xerces != x_/usr; then
78 LDFLAGS="-L${with_xerces}/lib $LDFLAGS"
79 CPPFLAGS="-I${with_xerces}/include $CPPFLAGS"
83 AC_PATH_PROG(PKG_CONFIG, pkg-config)
84 if test "x$PKG_CONFIG" = x || test "x$PKG_CONFIG" = "xno" ; then
86 AC_HELP_STRING([--with-openssl=PATH], [where openssl is installed]),
87 [if test x_$with_openssl != x_/usr; then
88 SSLLIBS="-L${with_openssl}/lib"
89 SSLFLAGS="-I${with_openssl}/include"
91 SSLLIBS="$SSLLIBS -lssl -lcrypto"
93 SSLLIBS="`$PKG_CONFIG --libs openssl`"
94 SSLFLAGS="`$PKG_CONFIG --cflags openssl`"
96 AC_MSG_CHECKING(for OpenSSL libraries)
97 AC_MSG_RESULT($SSLLIBS)
99 AC_MSG_CHECKING(for OpenSSL cflags)
100 AC_MSG_RESULT($SSLFLAGS)
101 CPPFLAGS="$SSLFLAGS $CPPFLAGS"
104 AC_HELP_STRING([--with-log4cpp=PATH], [where log4cpp is installed]),
105 [if test x_$with_log4cpp != x_/usr; then
106 LDFLAGS="-L${with_log4cpp}/lib $LDFLAGS"
107 CPPFLAGS="-I${with_log4cpp}/include $CPPFLAGS"
111 AC_HELP_STRING([--with-xmlsec=PATH], [where xmlsec is installed]),
112 [if test x_$with_xmlsec != x_/usr; then
113 LDFLAGS="-L${with_xmlsec}/lib $LDFLAGS"
114 CPPFLAGS="-I${with_xmlsec}/include $CPPFLAGS"
118 AC_HELP_STRING([--with-saml=PATH], [where saml is installed]),
119 [if test x_$with_saml != x_/usr; then
120 LDFLAGS="-L${with_saml}/lib $LDFLAGS"
121 CPPFLAGS="-I${with_saml}/include $CPPFLAGS"
124 AC_CHECK_HEADER([xercesc/dom/DOM.hpp],,
125 AC_MSG_ERROR([unable to find xerces header files]))
127 LIBS="-lxerces-c $LIBS"
129 [#include <xercesc/util/PlatformUtils.hpp>],
130 [xercesc::XMLPlatformUtils::Initialize()],
131 [AC_DEFINE(HAVE_LIBXERCESC,1,[Define if Xerces-C library was found])],
132 [AC_MSG_ERROR([unable to link with Xerces])
136 AC_CHECK_HEADER([openssl/ssl.h],,
137 AC_MSG_ERROR([unable to find openssl header files]))
138 AC_MSG_CHECKING(for ERR_load_CRYPTO_string)
139 AC_TRY_LINK_FUNC([ERR_load_CRYPTO_strings],,
140 AC_MSG_ERROR([unable to link with openssl libraries]))
142 AC_MSG_CHECKING(for SSL_library_init)
143 AC_TRY_LINK_FUNC([SSL_library_init],,
144 AC_MSG_ERROR([unable to link with openssl libraries]))
147 #AC_CHECK_LIB([crypto], [ERR_load_CRYPTO_strings],,
148 # AC_MSG_ERROR([unable to link with openssl libraries]))
149 #AC_CHECK_LIB([ssl], [SSL_library_init],,
150 # AC_MSG_ERROR([unable to link with openssl libraries]))
152 AC_CHECK_HEADER([xsec/utils/XSECPlatformUtils.hpp],,
153 AC_MSG_ERROR([unable to find xsec header files]))
155 LIBS="-lxml-security-c $LIBS"
157 [#include <xsec/utils/XSECPlatformUtils.hpp>],
158 [XSECPlatformUtils::Initialise()],
159 [AC_DEFINE(HAVE_LIBXSEC,1,[Define if XML-Sec library was found])],
160 [AC_MSG_ERROR([unable to link with XML-Sec])
164 AC_CHECK_HEADER([log4cpp/Category.hh],,
165 AC_MSG_ERROR([unable to find log4cpp header files]))
167 AC_CHECK_HEADER([saml/saml.h],,
168 AC_MSG_ERROR([unable to find saml header files]))
171 LIBS="-llog4cpp $LIBS"
173 [#include <log4cpp/Category.hh>],
174 [log4cpp::Category::getInstance("foo")],
175 [AC_DEFINE(HAVE_LIBLOG4CPP,1,[Define if log4cpp library was found])],
176 [AC_MSG_ERROR([unable to link with log4cpp])
183 [#include <saml/saml.h>],
184 [saml::SAMLConfig::getConfig()],
185 [AC_DEFINE(HAVE_SAML,1,[Define if saml library was found])],
186 [AC_MSG_ERROR([unable to link with saml])
190 # output the underlying makefiles
191 WANT_SUBDIRS="doc shib schemas configs shib-target shar siterefresh test"
192 AC_CONFIG_FILES([Makefile doc/Makefile shib/Makefile schemas/Makefile \
193 configs/Makefile oncrpc/Makefile oncrpc/rpc/Makefile \
194 shib-target/Makefile shar/Makefile siterefresh/Makefile \
197 # now deal with the rpc library, to see if we need to build our own
198 if test $rpctest = "no"; then
199 WANT_SUBDIRS="oncrpc $WANT_SUBDIRS"
200 AC_DEFINE(USE_OUR_ONCRPC,1,[Define if using embedded version of ONC RPC.])
202 AM_CONDITIONAL(USE_OUR_ONCRPC,test "$rpctest" = "no")
204 # Much of this is taken from mod_dav.
205 # The basic idea is to use configure options to control whether/which types
206 # of web server modules get built. We assume there may eventually be multiple
207 # types (Apache 1/2, iPlanet, others).
209 # Apache 1.3 (mod_shire/mod_shibrm)
210 # --with-apache-13 (static build, no idea how to do this yet, so not supported)
211 # --with-apxs (DSO build, the normal way, uses apxs to derive build flags)
212 # --without-apxs (DSO build, you tell us how to build using the environment)
214 AC_ARG_ENABLE(apache-13,
215 AC_HELP_STRING([--enable-apache-13], [enable the Apache 1.3 modules]),
216 [ if test "x$enableval" = "x" ; then
219 WANT_APACHE_13="$enableval"
221 ], [ WANT_APACHE_13=no ])
222 AC_MSG_CHECKING(whether to build Apache-1.3 support)
223 if test "$WANT_APACHE_13" != yes && test "$WANT_APACHE_13" != no ; then
226 AC_MSG_RESULT($WANT_APACHE_13)
228 if test "$WANT_APACHE_13" = yes ; then
231 [ --with-apxs[=FILE] Build shared Apache module(s). FILE is the optional
232 pathname to the Apache apxs tool; defaults to "apxs".],
234 if test "$withval" = "yes"; then
235 for i in /usr/sbin /usr/local/apache/bin ; do
236 if test -f "$i/apxs"; then
240 if test -z "$APXS"; then
248 AC_PATH_PROG(APXS, apxs, no)
251 AC_MSG_CHECKING([for dynamic Apache-1.3 module support (w/ or w/o APXS)])
252 if test "$APXS" = "no"; then
254 # --without-apxs means you want the modules,
255 # but want to tell us how to build them
256 AC_MSG_RESULT(yes, but use environment, not apxs)
258 echo "Did you set one or more of these?"
260 echo "APXS_CFLAGS APXS_PREFIX APXS_INCLUDE APXS_LIBEXEC APXS_SYSCONFDIR"
263 AC_MSG_NOTICE([APXS_CFLAGS is $APXS_CFLAGS])
265 # try and find the Apache root
266 if test -z "$APXS_PREFIX"; then
267 if test -d "/usr/local/apache"; then
268 APXS_PREFIX="/usr/local/apache"
270 AC_MSG_ERROR([You MUST set APXS_PREFIX so the right Apache can be located!])
272 elif test ! -d "$APXS_PREFIX"; then
273 AC_MSG_ERROR([APXS_PREFIX of $APXS_PREFIX cannot be found])
275 AC_MSG_NOTICE([APXS_PREFIX is $APXS_PREFIX])
278 # other subfolders might be derived from APXS_PREFIX
279 if test -z "$APXS_INCLUDE"; then
280 if test -f "$APXS_PREFIX/include/httpd.h"; then
281 APXS_INCLUDE="$APXS_PREFIX/include"
283 AC_MSG_ERROR([can't find Apache include files beneath $APXS_PREFIX])
285 elif ! test -f "$APXS_INCLUDE/httpd.h"; then
286 AC_MSG_ERROR([APXS_INCLUDE of $APXS_INCLUDE does not contain Apache headers])
288 AC_MSG_NOTICE([APXS_INCLUDE is $APXS_INCLUDE])
290 if test -z "$APXS_LIBEXEC"; then
291 if test -d "$APXS_PREFIX/libexec"; then
292 APXS_LIBEXEC="$APXS_PREFIX/libexec"
293 elif test -d "$APXS_PREFIX/modules"; then
294 APXS_LIBEXEC="$APXS_PREFIX/modules"
296 AC_MSG_ERROR([can't find Apache libexec/module directory beneath $APXS_PREFIX])
298 elif ! test -d "$APXS_LIBEXEC"; then
299 AC_MSG_ERROR([APXS_LIBEXEC of $APXS_LIBEXEC does not exist])
301 AC_MSG_NOTICE([APXS_LIBEXEC is $APXS_LIBEXEC])
303 if test -z "$APXS_SYSCONFDIR"; then
304 if test -d "$APXS_PREFIX/conf"; then
305 APXS_SYSCONFDIR="$APXS_PREFIX/conf"
307 AC_MSG_ERROR([can't find Apache conf directory beneath $APXS_PREFIX])
309 elif ! test -d "$APXS_SYSCONFDIR"; then
310 AC_MSG_ERROR([APXS_SYSCONFDIR of $APXS_SYSCONFDIR does not exist])
312 AC_MSG_NOTICE([APXS_SYSCONFDIR is $APXS_SYSCONFDIR])
316 elif test -n "$APXS"; then
318 # extract settings we need from APXS -q
319 APXS_CC="`$APXS -q CC`"
320 APXS_CFLAGS="`$APXS -q CFLAGS` `$APXS -q CFLAGS_SHLIB`"
321 APXS_INCLUDE="`$APXS -q INCLUDEDIR`"
322 APXS_LIBEXEC="`$APXS -q LIBEXECDIR`"
323 APXS_SYSCONFDIR="`$APXS -q SYSCONFDIR`"
326 AC_MSG_RESULT(found at $APXS)
328 if test -z "`$APXS -q LD_SHLIB`" || test "$APXS_LIBEXEC" = "modules"; then
330 [Your APXS installation is broken and cannot be used.
331 Please see http://www.webdav.org/mod_dav/install.html#apxs for
338 # guess we're not doing Apache 1.3
344 if test "$WANT_APACHE_13" = "yes"; then
346 AC_HELP_STRING([--with-apreq=PATH], [where libapreq is installed]),
347 [if test x_$with_apreq != x_/usr; then
348 LDFLAGS="-L${with_apreq}/lib $LDFLAGS"
349 CPPFLAGS="-I${with_apreq}/include $CPPFLAGS"
352 saved_CPPFLAGS="$CPPFLAGS"
353 CPPFLAGS="-I$APXS_INCLUDE $APXS_CFLAGS $CPPFLAGS"
354 AC_TRY_COMPILE([#include <libapreq/apache_request.h>],
356 test_apreq="yes",test_apreq="no")
357 if test "$test_apreq" = "no"; then
358 CPPFLAGS="$CPPFLAGS -U_XOPEN_SOURCE"
359 APXS_CFLAGS="$APXS_CFLAGS -U_XOPEN_SOURCE"
360 AC_CHECK_HEADER([libapreq/apache_request.h],,
361 AC_MSG_ERROR([unable to find a usable libapreq header]))
364 dnl saved_LIBS="$LIBS"
365 dnl LIBS="-lapreq $LIBS"
367 dnl [#include <libapreq/apache_request.h>],
368 dnl [ApacheRequest_expires],
369 dnl [AC_DEFINE(HAVE_APREQ,1,[Define if apreq library was found])],
370 dnl [AC_MSG_ERROR([unable to link with apreq])
372 dnl LIBS="$saved_LIBS"
373 CPPFLAGS="$saved_CPPFLAGS"
375 AC_ARG_ENABLE([apxs-install],
376 AC_HELP_STRING([--enable-apxs-install],
377 [use apxs to install the apache modules]),
378 APXS_INSTALL="yes", )
381 AC_SUBST(APXS_CFLAGS)
382 AC_SUBST(APXS_INCLUDE)
383 AC_SUBST(APXS_LIBEXEC)
384 AC_SUBST(APXS_SYSCONFDIR)
386 # output the Apache 1.3 makefiles
387 WANT_SUBDIRS="$WANT_SUBDIRS mod_shire mod_shibrm"
389 # always output the Makefile, even if we don't use it
390 AC_CONFIG_FILES([mod_shire/Makefile mod_shibrm/Makefile])
391 AM_CONDITIONAL(HAVE_APXS,test -n "$APXS")
392 AM_CONDITIONAL(DO_APXS_INSTALL,test -n "$APXS_INSTALL")
395 # Apache 2.0 (mod_shib in apache-2.0)
396 # --with-apache-20 (static build, no idea how to do this yet, so not supported)
397 # --with-apxs2 (DSO build, the normal way, uses apxs to derive build flags)
398 # --without-apxs2 (DSO build, you tell us how to build using the environment)
400 AC_ARG_ENABLE(apache-20,
401 AC_HELP_STRING([--enable-apache-20], [enable the Apache 2.0 modules]),
402 [ if test "x$enableval" = "x" ; then
405 WANT_APACHE_20="$enableval"
407 ], [ WANT_APACHE_20=no ])
409 AC_MSG_CHECKING(whether to build Apache-2.0 support)
410 if test "$WANT_APACHE_20" != yes && test "$WANT_APACHE_20" != no ; then
413 AC_MSG_RESULT($WANT_APACHE_20)
415 if test "$WANT_APACHE_20" = yes ; then
418 [ --with-apxs2[=FILE] Build shared Apache module(s). FILE is the optional
419 pathname to the Apache apxs tool; defaults to "apxs".],
421 if test "$withval" = "yes"; then
422 for i in /usr/sbin /usr/local/apache/bin ; do
423 if test -f "$i/apxs"; then
427 if test -z "$APXS2"; then
435 AC_PATH_PROG(APXS2, apxs, no)
438 AC_MSG_CHECKING([for dynamic Apache-2 module support (w/ or w/o APXS)])
439 if test "$APXS2" = "no"; then
441 # --without-apxs2 means you want the modules,
442 # but want to tell us how to build them
443 AC_MSG_RESULT(yes, but use environment, not apxs)
445 echo "Did you set one or more of these?"
447 echo "APXS2_CFLAGS APXS2_PREFIX APXS2_INCLUDE APXS2_LIBEXEC APXS2_SYSCONFDIR"
450 AC_MSG_NOTICE([APXS2_CFLAGS is $APXS2_CFLAGS])
452 # try and find the Apache root
453 if test -z "$APXS2_PREFIX"; then
454 if test -d "/usr/local/apache"; then
455 APXS2_PREFIX="/usr/local/apache"
457 AC_MSG_ERROR([You MUST set APXS2_PREFIX so the right Apache-2 can be located!])
459 elif test ! -d "$APXS2_PREFIX"; then
460 AC_MSG_ERROR([APXS2_PREFIX of $APXS2_PREFIX cannot be found])
462 AC_MSG_NOTICE([APXS2_PREFIX is $APXS2_PREFIX])
465 # other subfolders might be derived from APXS2_PREFIX
466 if test -z "$APXS2_INCLUDE"; then
467 if test -f "$APXS2_PREFIX/include/httpd.h"; then
468 APXS2_INCLUDE="$APXS2_PREFIX/include"
470 AC_MSG_ERROR([can't find Apache-2 include files beneath $APXS2_PREFIX])
472 elif ! test -f "$APXS2_INCLUDE/httpd.h"; then
473 AC_MSG_ERROR([APXS2_INCLUDE of $APXS2_INCLUDE does not contain Apache-2 headers])
475 AC_MSG_NOTICE([APXS2_INCLUDE is $APXS2_INCLUDE])
477 if test -z "$APXS2_LIBEXEC"; then
478 if test -d "$APXS2_PREFIX/libexec"; then
479 APXS2_LIBEXEC="$APXS2_PREFIX/libexec"
480 elif test -d "$APXS2_PREFIX/modules"; then
481 APXS2_LIBEXEC="$APXS2_PREFIX/modules"
483 AC_MSG_ERROR([can't find Apache-2 libexec/module directory beneath $APXS2_PREFIX])
485 elif ! test -d "$APXS2_LIBEXEC"; then
486 AC_MSG_ERROR([APXS2_LIBEXEC of $APXS2_LIBEXEC does not exist])
488 AC_MSG_NOTICE([APXS2_LIBEXEC is $APXS2_LIBEXEC])
490 if test -z "$APXS2_SYSCONFDIR"; then
491 if test -d "$APXS2_PREFIX/conf"; then
492 APXS2_SYSCONFDIR="$APXS2_PREFIX/conf"
494 AC_MSG_ERROR([can't find Apache-2 conf directory beneath $APXS2_PREFIX])
496 elif ! test -d "$APXS2_SYSCONFDIR"; then
497 AC_MSG_ERROR([APXS2_SYSCONFDIR of $APXS2_SYSCONFDIR does not exist])
499 AC_MSG_NOTICE([APXS2_SYSCONFDIR is $APXS2_SYSCONFDIR])
503 elif test -n "$APXS2"; then
505 # extract settings we need from APXS2 -q
506 APXS2_CC="`$APXS2 -q CC`"
507 APXS2_CFLAGS="`$APXS2 -q CFLAGS` `$APXS2 -q CFLAGS_SHLIB`"
508 APXS2_INCLUDE="`$APXS2 -q INCLUDEDIR`"
509 APXS2_LIBEXEC="`$APXS2 -q LIBEXECDIR`"
510 APXS2_SYSCONFDIR="`$APXS2 -q SYSCONFDIR`"
513 AC_MSG_RESULT(found at $APXS2)
515 if test -z "`$APXS2 -q LD_SHLIB`" && test -z "`$APXS2 -q LIBEXECDIR`" \
516 || test "$APXS2_LIBEXEC" = "modules"; then
518 [Your APXS installation is broken and cannot be used.
519 Please see http://www.webdav.org/mod_dav/install.html#apxs for
526 # guess we're not doing Apache 2.0
532 if test "$WANT_APACHE_20" = "yes"; then
534 AC_HELP_STRING([--with-apreq2=PATH], [where http-apreq-2 is installed]),
535 [if test x_$with_apreq2 != x_/usr; then
536 LDFLAGS="-L${with_apreq2}/lib $LDFLAGS"
537 CPPFLAGS="-I${with_apreq2}/include $CPPFLAGS"
540 saved_CPPFLAGS="$CPPFLAGS"
541 CPPFLAGS="-I$APXS2_INCLUDE $APXS2_CFLAGS $CPPFLAGS"
542 AC_TRY_COMPILE([#include <apreq.h>],
544 test_apreq2="yes",test_apreq2="no")
545 if test "$test_apreq2" = "no"; then
546 CPPFLAGS="$CPPFLAGS -U_XOPEN_SOURCE"
547 APXS2_CFLAGS="$APXS2_CFLAGS -U_XOPEN_SOURCE"
548 AC_CHECK_HEADER([apreq.h],,
549 AC_MSG_ERROR([unable to find a usable libapreq2 header]))
552 dnl saved_LIBS="$LIBS"
553 dnl LIBS="-lapreq $LIBS"
555 dnl [#include <apreq.h>],
557 dnl [AC_DEFINE(HAVE_APREQ2,1,[Define if apreq2 library was found])],
558 dnl [AC_MSG_ERROR([unable to link with apreq2])
560 dnl LIBS="$saved_LIBS"
561 CPPFLAGS="$saved_CPPFLAGS"
563 AC_ARG_ENABLE([apxs2-install],
564 AC_HELP_STRING([--enable-apxs2-install],
565 [use apxs to install the apache-2 modules]),
566 APXS2_INSTALL="yes", )
569 AC_SUBST(APXS2_CFLAGS)
570 AC_SUBST(APXS2_INCLUDE)
571 AC_SUBST(APXS2_LIBEXEC)
572 AC_SUBST(APXS2_SYSCONFDIR)
574 # output the Apache 2.0 makefiles
575 WANT_SUBDIRS="$WANT_SUBDIRS apache-2.0"
577 # always output the Makefile, even if we don't use it
578 AC_CONFIG_FILES([apache-2.0/Makefile])
579 AM_CONDITIONAL(HAVE_APXS2,test -n "$APXS2")
580 AM_CONDITIONAL(DO_APXS2_INSTALL,test -n "$APXS2_INSTALL")
584 # Implement the checks of the MySQL Credential Cache
586 # 1) Assume the user wants MySQL; if it's not found then just continue without
587 # 2) If the user specifically requested Mysql, look for it and ERROR if not found
588 # 3) If the user specifically requested no-mysql, don't build it.
591 AC_CONFIG_FILES([shib-mysql-ccache/Makefile])
593 # determine whether we should enable the mysql ccache
594 AC_ARG_ENABLE([mysql],
595 AC_HELP_STRING([--disable-mysql], [disable the MySQL Credential Cache]),
596 [mysql_enabled=$enableval], [mysql_enabled=default])
598 if test "x$mysql_enabled" = "x" ; then
602 # Are we trying to build MySQL?
603 AC_MSG_CHECKING(whether to build the MySQL ccache)
604 if test "$mysql_enabled" = "yes" ; then
607 elif test "$mysql_enabled" = "default" ; then
609 AC_MSG_RESULT([yes, if it can be found])
615 # If we're trying to build MySQL, try to find the mysql_config program,
616 # verify we've got mysql >= 4, and make sure we can build with mysqld
617 if test "$build_mysql" = "yes" ; then
620 AC_HELP_STRING([--with-mysql=PATH], [directory where mysql is installed]),
621 [if test "$with_mysql" = no ; then
622 AC_MSG_ERROR([Try running --disable-mysql instead.])
623 elif test "$with_mysql" != yes ; then
624 mysql_dir="$with_mysql/bin"
627 # Try to find the mysql_config program
628 AC_PATH_PROG(MYSQL_CONFIG, mysql_config, no, $mysql_dir $PATH )
630 if test "$MYSQL_CONFIG" = no ; then
631 if test "$mysql_enabled" = "yes" ; then
632 AC_MSG_ERROR(Cannot find mysql_config)
634 AC_MSG_WARN(MySQL not found. skipping.)
639 # if we found mysql_config then build_mysql is 'yes'
640 if test "$MYSQL_CONFIG" != no ; then
641 AC_MSG_CHECKING(for mysql version >= 4)
642 mysql_version=`$MYSQL_CONFIG --version`
643 mysql_major_version=`echo $mysql_version | awk -F. '{print $1}'`
645 if test $mysql_major_version -lt 4 ; then
647 if test "$mysql_enabled" = "yes" ; then
648 AC_MSG_ERROR(You need MySQL version >= 4, found $mysql_version)
650 AC_MSG_RESULT(no.. skipping MySQL)
656 # if mysql_version_ok is 'yes', then we've made it this far.. ;)
657 if test "$mysql_version_ok" = "yes" ; then
658 AC_MSG_CHECKING(for embedded-MySQL libraries)
659 MYSQL_LIBS=`$MYSQL_CONFIG --libmysqld-libs`
660 if test $? != 0 ; then
662 if test "$mysql_enabled" = "yes" ; then
663 AC_MSG_ERROR(Could not find the MySQL Embedded-server libraries.)
665 AC_MSG_RESULT(no.. skipping MySQL)
673 # if found_mysql=yes then test that we can actually build mysql
674 if test "$found_mysql" = yes ; then
675 MYSQL_CFLAGS=`$MYSQL_CONFIG --cflags`
676 MYSQL_CFLAGS=`eval echo $MYSQL_CFLAGS`
677 MYSQL_LIBS=`eval echo $MYSQL_LIBS`
679 save_CPPFLAGS="$CPPFLAGS"
680 CPPFLAGS="$CPPFLAGS $MYSQL_CFLAGS"
682 AC_CHECK_HEADER([mysql.h], [have_mysql_h=yes], [have_mysql_h=no])
683 if test "$have_mysql_h" = no -a "$mysql_enabled" = "yes" ; then
684 AC_MSG_ERROR(unable to find MySQL header files)
687 if test "$have_mysql_h" = yes ; then
689 LIBS="$LIBS $MYSQL_LIBS"
690 AC_MSG_CHECKING(if we can link againt mysql)
694 [mysql_server_init(0, NULL, NULL)],
695 [have_mysql_libs=yes],
696 [have_mysql_libs=no])
699 if test "$have_mysql_libs" = no ; then
700 if test "$mysql_enabled" = "yes" ; then
701 AC_MSG_ERROR([unable to link with MySQL Embedded Server Library])
703 AC_MSG_RESULT(no. skipping MySQL)
708 CPPFLAGS="$save_CPPFLAGS"
711 # if have_mysql_libs=yes then go ahead with building MySQL
712 if test "$have_mysql_libs" = yes ; then
713 # this AC_MSG_RESULT is from above!
715 WANT_SUBDIRS="$WANT_SUBDIRS shib-mysql-ccache"
716 AC_SUBST(MYSQL_CFLAGS)
721 AC_SUBST(WANT_SUBDIRS)
723 if test -n "$APXS_CC" && test "$APXS_CC" != "$CC" ; then
724 echo "=================================================================="
725 echo "WARNING: You have chosen to compile Apache-1.3 modules with a different"
726 echo " compiler than the one used to compile Apache."
728 echo " Current compiler: $CC"
729 echo " Apache's compiler: $APXS_CC"
731 echo "This could cause some problems."
732 echo "=================================================================="
735 if test -n "$APXS2_CC" && test "$APXS2_CC" != "$CC" ; then
736 echo "=================================================================="
737 echo "WARNING: You have chosen to compile Apache-2 modules with a different"
738 echo " compiler than the one used to compile Apache."
740 echo " Current compiler: $CC"
741 echo " Apache's compiler: $APXS2_CC"
743 echo "This could cause some problems."
744 echo "=================================================================="