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.
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_PATH_PROG(PKG_CONFIG, pkg-config)
77 if test "x$PKG_CONFIG" = x || test "x$PKG_CONFIG" = "xno" ; then
79 AC_HELP_STRING([--with-openssl=PATH], [where openssl is installed]),
80 [if test x_$with_openssl != x_/usr; then
81 SSLLIBS="-L${with_openssl}/lib"
82 SSLFLAGS="-I${with_openssl}/include"
84 SSLLIBS="$SSLLIBS -lssl -lcrypto"
86 SSLLIBS="`$PKG_CONFIG --libs openssl`"
87 SSLFLAGS="`$PKG_CONFIG --cflags openssl`"
89 AC_MSG_CHECKING(for OpenSSL libraries)
90 AC_MSG_RESULT($SSLLIBS)
92 AC_MSG_CHECKING(for OpenSSL cflags)
93 AC_MSG_RESULT($SSLFLAGS)
94 CPPFLAGS="$SSLFLAGS $CPPFLAGS"
96 AC_CHECK_HEADER([openssl/ssl.h],,
97 AC_MSG_ERROR([unable to find openssl header files]))
98 AC_MSG_CHECKING(for ERR_load_CRYPTO_string)
99 AC_TRY_LINK_FUNC([ERR_load_CRYPTO_strings],,
100 AC_MSG_ERROR([unable to link with openssl libraries]))
102 AC_MSG_CHECKING(for SSL_library_init)
103 AC_TRY_LINK_FUNC([SSL_library_init],,
104 AC_MSG_ERROR([unable to link with openssl libraries]))
108 LOG4CPP_CONFIG="log4cpp-config"
110 AC_HELP_STRING([--with-log4cpp=PATH], [where log4cpp is installed]),
111 [LOG4CPP_CONFIG="${with_log4cpp}/bin/log4cpp-config"])
112 if test -f ${LOG4CPP_CONFIG}; then
113 LDFLAGS="`${LOG4CPP_CONFIG} --libs` $LDFLAGS"
114 CPPFLAGS="`${LOG4CPP_CONFIG} --cflags` $CPPFLAGS"
116 AC_MSG_WARN([log4cpp-config not found, guessing at log4cpp build settings])
117 LIBS="-llog4cpp $LIBS"
119 AC_CHECK_HEADER([log4cpp/Category.hh],,AC_MSG_ERROR([unable to find log4cpp header files]))
121 [#include <log4cpp/Category.hh>],
122 [log4cpp::Category::getInstance("foo")],
123 [AC_DEFINE(HAVE_LIBLOG4CPP,1,[Define if log4cpp library was found])],
124 [AC_MSG_ERROR([unable to link with log4cpp])])
128 AC_HELP_STRING([--with-xerces=PATH], [where xerces-c is installed]),
129 [if test x_$with_xerces != x_/usr; then
130 LDFLAGS="-L${with_xerces}/lib $LDFLAGS"
131 CPPFLAGS="-I${with_xerces}/include $CPPFLAGS"
133 LIBS="-lxerces-c $LIBS"
134 AC_CHECK_HEADER([xercesc/dom/DOM.hpp],,
135 AC_MSG_ERROR([unable to find xerces header files]))
137 [#include <xercesc/util/PlatformUtils.hpp>],
138 [xercesc::XMLPlatformUtils::Initialize()],
139 [AC_DEFINE(HAVE_LIBXERCESC,1,[Define if Xerces-C library was found])],
140 [AC_MSG_ERROR([unable to link with Xerces])])
142 # XML-Security settings
144 AC_HELP_STRING([--with-xmlsec=PATH], [where xmlsec is installed]),
145 [if test x_$with_xmlsec != x_/usr; then
146 LDFLAGS="-L${with_xmlsec}/lib $LDFLAGS"
147 CPPFLAGS="-I${with_xmlsec}/include $CPPFLAGS"
149 LIBS="-lxml-security-c $LIBS"
150 AC_CHECK_HEADER([xsec/utils/XSECPlatformUtils.hpp],,AC_MSG_ERROR([unable to find xsec header files]))
152 [#include <xsec/utils/XSECPlatformUtils.hpp>],
153 [XSECPlatformUtils::Initialise()],
154 [AC_DEFINE(HAVE_LIBXSEC,1,[Define if XML-Sec library was found])],
155 [AC_MSG_ERROR([unable to link with XML-Sec])])
159 AC_HELP_STRING([--with-saml=PATH], [where saml is installed]),
160 [if test x_$with_saml != x_/usr; then
161 LDFLAGS="-L${with_saml}/lib $LDFLAGS"
162 CPPFLAGS="-I${with_saml}/include $CPPFLAGS"
164 AC_CHECK_HEADER([saml/saml.h],,
165 AC_MSG_ERROR([unable to find saml header files]))
168 [#include <saml/saml.h>],
169 [saml::SAMLConfig::getConfig()],
170 [AC_DEFINE(HAVE_SAML,1,[Define if saml library was found])],
171 [AC_MSG_ERROR([unable to link with saml])])
174 # output the underlying makefiles
175 WANT_SUBDIRS="doc shib schemas configs shib-target shar siterefresh test xmlproviders"
176 AC_CONFIG_FILES([Makefile doc/Makefile shib/Makefile schemas/Makefile \
177 configs/Makefile oncrpc/Makefile oncrpc/rpc/Makefile \
178 shib-target/Makefile shar/Makefile siterefresh/Makefile \
179 test/Makefile xmlproviders/Makefile])
182 # now deal with the rpc library, to see if we need to build our own
183 if test $rpctest = "no"; then
184 WANT_SUBDIRS="oncrpc $WANT_SUBDIRS"
185 AC_DEFINE(USE_OUR_ONCRPC,1,[Define if using embedded version of ONC RPC.])
187 AM_CONDITIONAL(USE_OUR_ONCRPC,test "$rpctest" = "no")
190 # Apache 1.3 (mod_shire/mod_shibrm)
191 # --with-apache-13 (static build, no idea how to do this yet, so not supported)
192 # --with-apxs (DSO build, the normal way, uses apxs to derive build flags)
193 # --without-apxs (DSO build, you tell us how to build using the environment)
195 AC_ARG_ENABLE(apache-13,
196 AC_HELP_STRING([--enable-apache-13], [enable the Apache 1.3 modules]),
197 [ if test "x$enableval" = "x" ; then
200 WANT_APACHE_13="$enableval"
202 ], [ WANT_APACHE_13=no ])
203 AC_MSG_CHECKING(whether to build Apache-1.3 support)
204 if test "$WANT_APACHE_13" != yes && test "$WANT_APACHE_13" != no ; then
207 AC_MSG_RESULT($WANT_APACHE_13)
209 if test "$WANT_APACHE_13" = yes ; then
212 [ --with-apxs[=FILE] Build shared Apache module(s). FILE is the optional
213 pathname to the Apache apxs tool; defaults to "apxs".],
215 if test "$withval" = "yes"; then
216 for i in /usr/sbin /usr/local/apache/bin ; do
217 if test -f "$i/apxs"; then
221 if test -z "$APXS"; then
229 AC_PATH_PROG(APXS, apxs, no)
232 AC_MSG_CHECKING([for dynamic Apache-1.3 module support (w/ or w/o APXS)])
233 if test "$APXS" = "no"; then
235 # --without-apxs means you want the modules,
236 # but want to tell us how to build them
237 AC_MSG_RESULT(yes, but use environment, not apxs)
239 echo "Did you set one or more of these?"
241 echo "APXS_CFLAGS APXS_PREFIX APXS_INCLUDE APXS_LIBEXEC APXS_SYSCONFDIR"
244 AC_MSG_NOTICE([APXS_CFLAGS is $APXS_CFLAGS])
246 # try and find the Apache root
247 if test -z "$APXS_PREFIX"; then
248 if test -d "/usr/local/apache"; then
249 APXS_PREFIX="/usr/local/apache"
251 AC_MSG_ERROR([You MUST set APXS_PREFIX so the right Apache can be located!])
253 elif test ! -d "$APXS_PREFIX"; then
254 AC_MSG_ERROR([APXS_PREFIX of $APXS_PREFIX cannot be found])
256 AC_MSG_NOTICE([APXS_PREFIX is $APXS_PREFIX])
259 # other subfolders might be derived from APXS_PREFIX
260 if test -z "$APXS_INCLUDE"; then
261 if test -f "$APXS_PREFIX/include/httpd.h"; then
262 APXS_INCLUDE="$APXS_PREFIX/include"
264 AC_MSG_ERROR([can't find Apache include files beneath $APXS_PREFIX])
266 elif ! test -f "$APXS_INCLUDE/httpd.h"; then
267 AC_MSG_ERROR([APXS_INCLUDE of $APXS_INCLUDE does not contain Apache headers])
269 AC_MSG_NOTICE([APXS_INCLUDE is $APXS_INCLUDE])
271 if test -z "$APXS_LIBEXEC"; then
272 if test -d "$APXS_PREFIX/libexec"; then
273 APXS_LIBEXEC="$APXS_PREFIX/libexec"
274 elif test -d "$APXS_PREFIX/modules"; then
275 APXS_LIBEXEC="$APXS_PREFIX/modules"
277 AC_MSG_ERROR([can't find Apache libexec/module directory beneath $APXS_PREFIX])
279 elif ! test -d "$APXS_LIBEXEC"; then
280 AC_MSG_ERROR([APXS_LIBEXEC of $APXS_LIBEXEC does not exist])
282 AC_MSG_NOTICE([APXS_LIBEXEC is $APXS_LIBEXEC])
284 if test -z "$APXS_SYSCONFDIR"; then
285 if test -d "$APXS_PREFIX/conf"; then
286 APXS_SYSCONFDIR="$APXS_PREFIX/conf"
288 AC_MSG_ERROR([can't find Apache conf directory beneath $APXS_PREFIX])
290 elif ! test -d "$APXS_SYSCONFDIR"; then
291 AC_MSG_ERROR([APXS_SYSCONFDIR of $APXS_SYSCONFDIR does not exist])
293 AC_MSG_NOTICE([APXS_SYSCONFDIR is $APXS_SYSCONFDIR])
297 elif test -n "$APXS"; then
299 # extract settings we need from APXS -q
300 APXS_CC="`$APXS -q CC`"
301 APXS_CFLAGS="`$APXS -q CFLAGS` `$APXS -q CFLAGS_SHLIB`"
302 APXS_INCLUDE="`$APXS -q INCLUDEDIR`"
303 APXS_LIBEXEC="`$APXS -q LIBEXECDIR`"
304 APXS_SYSCONFDIR="`$APXS -q SYSCONFDIR`"
307 AC_MSG_RESULT(found at $APXS)
309 if test -z "`$APXS -q LD_SHLIB`" || test "$APXS_LIBEXEC" = "modules"; then
311 [Your APXS installation is broken and cannot be used.
312 Please see http://www.webdav.org/mod_dav/install.html#apxs for
319 # guess we're not doing Apache 1.3
325 if test "$WANT_APACHE_13" = "yes"; then
327 AC_HELP_STRING([--with-apreq=PATH], [where libapreq is installed]),
328 [if test x_$with_apreq != x_/usr; then
329 LDFLAGS="-L${with_apreq}/lib $LDFLAGS"
330 CPPFLAGS="-I${with_apreq}/include $CPPFLAGS"
333 saved_CPPFLAGS="$CPPFLAGS"
334 CPPFLAGS="-I$APXS_INCLUDE $APXS_CFLAGS $CPPFLAGS"
335 AC_TRY_COMPILE([#include <libapreq/apache_request.h>],
337 test_apreq="yes",test_apreq="no")
338 if test "$test_apreq" = "no"; then
339 CPPFLAGS="$CPPFLAGS -U_XOPEN_SOURCE"
340 APXS_CFLAGS="$APXS_CFLAGS -U_XOPEN_SOURCE"
341 AC_CHECK_HEADER([libapreq/apache_request.h],,
342 AC_MSG_ERROR([unable to find a usable libapreq header]))
345 dnl saved_LIBS="$LIBS"
346 dnl LIBS="-lapreq $LIBS"
348 dnl [#include <libapreq/apache_request.h>],
349 dnl [ApacheRequest_expires],
350 dnl [AC_DEFINE(HAVE_APREQ,1,[Define if apreq library was found])],
351 dnl [AC_MSG_ERROR([unable to link with apreq])
353 dnl LIBS="$saved_LIBS"
354 CPPFLAGS="$saved_CPPFLAGS"
356 AC_ARG_ENABLE([apxs-install],
357 AC_HELP_STRING([--enable-apxs-install],
358 [use apxs to install the apache modules]),
359 APXS_INSTALL="yes", )
362 AC_SUBST(APXS_CFLAGS)
363 AC_SUBST(APXS_INCLUDE)
364 AC_SUBST(APXS_LIBEXEC)
365 AC_SUBST(APXS_SYSCONFDIR)
367 # output the Apache 1.3 makefiles
368 WANT_SUBDIRS="$WANT_SUBDIRS mod_shire mod_shibrm"
370 # always output the Makefile, even if we don't use it
371 AC_CONFIG_FILES([mod_shire/Makefile mod_shibrm/Makefile])
372 AM_CONDITIONAL(HAVE_APXS,test -n "$APXS")
373 AM_CONDITIONAL(DO_APXS_INSTALL,test -n "$APXS_INSTALL")
376 # Apache 2.0 (mod_shib in apache-2.0)
377 # --with-apache-20 (static build, no idea how to do this yet, so not supported)
378 # --with-apxs2 (DSO build, the normal way, uses apxs to derive build flags)
379 # --without-apxs2 (DSO build, you tell us how to build using the environment)
381 AC_ARG_ENABLE(apache-20,
382 AC_HELP_STRING([--enable-apache-20], [enable the Apache 2.0 modules]),
383 [ if test "x$enableval" = "x" ; then
386 WANT_APACHE_20="$enableval"
388 ], [ WANT_APACHE_20=no ])
390 AC_MSG_CHECKING(whether to build Apache-2.0 support)
391 if test "$WANT_APACHE_20" != yes && test "$WANT_APACHE_20" != no ; then
394 AC_MSG_RESULT($WANT_APACHE_20)
396 if test "$WANT_APACHE_20" = yes ; then
399 [ --with-apxs2[=FILE] Build shared Apache module(s). FILE is the optional
400 pathname to the Apache apxs tool; defaults to "apxs".],
402 if test "$withval" = "yes"; then
403 for i in /usr/sbin /usr/local/apache/bin ; do
404 if test -f "$i/apxs"; then
408 if test -z "$APXS2"; then
416 AC_PATH_PROG(APXS2, apxs, no)
419 AC_MSG_CHECKING([for dynamic Apache-2 module support (w/ or w/o APXS)])
420 if test "$APXS2" = "no"; then
422 # --without-apxs2 means you want the modules,
423 # but want to tell us how to build them
424 AC_MSG_RESULT(yes, but use environment, not apxs)
426 echo "Did you set one or more of these?"
428 echo "APXS2_CFLAGS APXS2_PREFIX APXS2_INCLUDE APXS2_LIBEXEC APXS2_SYSCONFDIR"
431 AC_MSG_NOTICE([APXS2_CFLAGS is $APXS2_CFLAGS])
433 # try and find the Apache root
434 if test -z "$APXS2_PREFIX"; then
435 if test -d "/usr/local/apache"; then
436 APXS2_PREFIX="/usr/local/apache"
438 AC_MSG_ERROR([You MUST set APXS2_PREFIX so the right Apache-2 can be located!])
440 elif test ! -d "$APXS2_PREFIX"; then
441 AC_MSG_ERROR([APXS2_PREFIX of $APXS2_PREFIX cannot be found])
443 AC_MSG_NOTICE([APXS2_PREFIX is $APXS2_PREFIX])
446 # other subfolders might be derived from APXS2_PREFIX
447 if test -z "$APXS2_INCLUDE"; then
448 if test -f "$APXS2_PREFIX/include/httpd.h"; then
449 APXS2_INCLUDE="$APXS2_PREFIX/include"
451 AC_MSG_ERROR([can't find Apache-2 include files beneath $APXS2_PREFIX])
453 elif ! test -f "$APXS2_INCLUDE/httpd.h"; then
454 AC_MSG_ERROR([APXS2_INCLUDE of $APXS2_INCLUDE does not contain Apache-2 headers])
456 AC_MSG_NOTICE([APXS2_INCLUDE is $APXS2_INCLUDE])
458 if test -z "$APXS2_LIBEXEC"; then
459 if test -d "$APXS2_PREFIX/libexec"; then
460 APXS2_LIBEXEC="$APXS2_PREFIX/libexec"
461 elif test -d "$APXS2_PREFIX/modules"; then
462 APXS2_LIBEXEC="$APXS2_PREFIX/modules"
464 AC_MSG_ERROR([can't find Apache-2 libexec/module directory beneath $APXS2_PREFIX])
466 elif ! test -d "$APXS2_LIBEXEC"; then
467 AC_MSG_ERROR([APXS2_LIBEXEC of $APXS2_LIBEXEC does not exist])
469 AC_MSG_NOTICE([APXS2_LIBEXEC is $APXS2_LIBEXEC])
471 if test -z "$APXS2_SYSCONFDIR"; then
472 if test -d "$APXS2_PREFIX/conf"; then
473 APXS2_SYSCONFDIR="$APXS2_PREFIX/conf"
475 AC_MSG_ERROR([can't find Apache-2 conf directory beneath $APXS2_PREFIX])
477 elif ! test -d "$APXS2_SYSCONFDIR"; then
478 AC_MSG_ERROR([APXS2_SYSCONFDIR of $APXS2_SYSCONFDIR does not exist])
480 AC_MSG_NOTICE([APXS2_SYSCONFDIR is $APXS2_SYSCONFDIR])
484 elif test -n "$APXS2"; then
486 # extract settings we need from APXS2 -q
487 APXS2_CC="`$APXS2 -q CC`"
488 APXS2_CFLAGS="`$APXS2 -q CFLAGS` `$APXS2 -q CFLAGS_SHLIB`"
489 APXS2_INCLUDE="`$APXS2 -q INCLUDEDIR`"
490 APXS2_LIBEXEC="`$APXS2 -q LIBEXECDIR`"
491 APXS2_SYSCONFDIR="`$APXS2 -q SYSCONFDIR`"
494 AC_MSG_RESULT(found at $APXS2)
496 if test -z "`$APXS2 -q LD_SHLIB`" && test -z "`$APXS2 -q LIBEXECDIR`" \
497 || test "$APXS2_LIBEXEC" = "modules"; then
499 [Your APXS installation is broken and cannot be used.
500 Please see http://www.webdav.org/mod_dav/install.html#apxs for
507 # guess we're not doing Apache 2.0
513 if test "$WANT_APACHE_20" = "yes"; then
515 AC_HELP_STRING([--with-apreq2=PATH], [where http-apreq-2 is installed]),
516 [if test x_$with_apreq2 != x_/usr; then
517 LDFLAGS="-L${with_apreq2}/lib $LDFLAGS"
518 CPPFLAGS="-I${with_apreq2}/include $CPPFLAGS"
521 saved_CPPFLAGS="$CPPFLAGS"
522 CPPFLAGS="-I$APXS2_INCLUDE $APXS2_CFLAGS $CPPFLAGS"
523 AC_TRY_COMPILE([#include <apreq.h>],
525 test_apreq2="yes",test_apreq2="no")
526 if test "$test_apreq2" = "no"; then
527 CPPFLAGS="$CPPFLAGS -U_XOPEN_SOURCE"
528 APXS2_CFLAGS="$APXS2_CFLAGS -U_XOPEN_SOURCE"
529 AC_CHECK_HEADER([apreq.h],,
530 AC_MSG_ERROR([unable to find a usable libapreq2 header]))
533 dnl saved_LIBS="$LIBS"
534 dnl LIBS="-lapreq $LIBS"
536 dnl [#include <apreq.h>],
538 dnl [AC_DEFINE(HAVE_APREQ2,1,[Define if apreq2 library was found])],
539 dnl [AC_MSG_ERROR([unable to link with apreq2])
541 dnl LIBS="$saved_LIBS"
542 CPPFLAGS="$saved_CPPFLAGS"
544 AC_ARG_ENABLE([apxs2-install],
545 AC_HELP_STRING([--enable-apxs2-install],
546 [use apxs to install the apache-2 modules]),
547 APXS2_INSTALL="yes", )
550 AC_SUBST(APXS2_CFLAGS)
551 AC_SUBST(APXS2_INCLUDE)
552 AC_SUBST(APXS2_LIBEXEC)
553 AC_SUBST(APXS2_SYSCONFDIR)
555 # output the Apache 2.0 makefiles
556 WANT_SUBDIRS="$WANT_SUBDIRS apache-2.0"
558 # always output the Makefile, even if we don't use it
559 AC_CONFIG_FILES([apache-2.0/Makefile])
560 AM_CONDITIONAL(HAVE_APXS2,test -n "$APXS2")
561 AM_CONDITIONAL(DO_APXS2_INSTALL,test -n "$APXS2_INSTALL")
565 # Implement the checks of the MySQL Credential Cache
567 # 1) Assume the user wants MySQL; if it's not found then just continue without
568 # 2) If the user specifically requested Mysql, look for it and ERROR if not found
569 # 3) If the user specifically requested no-mysql, don't build it.
572 AC_CONFIG_FILES([shib-mysql-ccache/Makefile])
574 # determine whether we should enable the mysql ccache
575 AC_ARG_ENABLE([mysql],
576 AC_HELP_STRING([--disable-mysql], [disable the MySQL Credential Cache]),
577 [mysql_enabled=$enableval], [mysql_enabled=default])
579 if test "x$mysql_enabled" = "x" ; then
583 # Are we trying to build MySQL?
584 AC_MSG_CHECKING(whether to build the MySQL ccache)
585 if test "$mysql_enabled" = "yes" ; then
588 elif test "$mysql_enabled" = "default" ; then
590 AC_MSG_RESULT([yes, if it can be found])
596 # If we're trying to build MySQL, try to find the mysql_config program,
597 # verify we've got mysql >= 4, and make sure we can build with mysqld
598 if test "$build_mysql" = "yes" ; then
601 AC_HELP_STRING([--with-mysql=PATH], [directory where mysql is installed]),
602 [if test "$with_mysql" = no ; then
603 AC_MSG_ERROR([Try running --disable-mysql instead.])
604 elif test "$with_mysql" != yes ; then
605 mysql_dir="$with_mysql/bin"
608 # Try to find the mysql_config program
609 AC_PATH_PROG(MYSQL_CONFIG, mysql_config, no, $mysql_dir $PATH )
611 if test "$MYSQL_CONFIG" = no ; then
612 if test "$mysql_enabled" = "yes" ; then
613 AC_MSG_ERROR(Cannot find mysql_config)
615 AC_MSG_WARN(MySQL not found. skipping.)
620 # if we found mysql_config then build_mysql is 'yes'
621 if test "$MYSQL_CONFIG" != no ; then
622 AC_MSG_CHECKING(for mysql version >= 4)
623 mysql_version=`$MYSQL_CONFIG --version`
624 mysql_major_version=`echo $mysql_version | awk -F. '{print $1}'`
626 if test $mysql_major_version -lt 4 ; then
628 if test "$mysql_enabled" = "yes" ; then
629 AC_MSG_ERROR(You need MySQL version >= 4, found $mysql_version)
631 AC_MSG_RESULT(no.. skipping MySQL)
637 # if mysql_version_ok is 'yes', then we've made it this far.. ;)
638 if test "$mysql_version_ok" = "yes" ; then
639 AC_MSG_CHECKING(for embedded-MySQL libraries)
640 MYSQL_LIBS=`$MYSQL_CONFIG --libmysqld-libs`
641 if test $? != 0 ; then
643 if test "$mysql_enabled" = "yes" ; then
644 AC_MSG_ERROR(Could not find the MySQL Embedded-server libraries.)
646 AC_MSG_RESULT(no.. skipping MySQL)
654 # if found_mysql=yes then test that we can actually build mysql
655 if test "$found_mysql" = yes ; then
656 MYSQL_CFLAGS=`$MYSQL_CONFIG --cflags`
657 MYSQL_CFLAGS=`eval echo $MYSQL_CFLAGS`
658 MYSQL_LIBS=`eval echo $MYSQL_LIBS`
660 save_CPPFLAGS="$CPPFLAGS"
661 CPPFLAGS="$CPPFLAGS $MYSQL_CFLAGS"
663 AC_CHECK_HEADER([mysql.h], [have_mysql_h=yes], [have_mysql_h=no])
664 if test "$have_mysql_h" = no -a "$mysql_enabled" = "yes" ; then
665 AC_MSG_ERROR(unable to find MySQL header files)
668 if test "$have_mysql_h" = yes ; then
670 LIBS="$LIBS $MYSQL_LIBS"
671 AC_MSG_CHECKING(if we can link againt mysql)
675 [mysql_server_init(0, NULL, NULL)],
676 [have_mysql_libs=yes],
677 [have_mysql_libs=no])
680 if test "$have_mysql_libs" = no ; then
681 if test "$mysql_enabled" = "yes" ; then
682 AC_MSG_ERROR([unable to link with MySQL Embedded Server Library])
684 AC_MSG_RESULT(no. skipping MySQL)
689 CPPFLAGS="$save_CPPFLAGS"
692 # if have_mysql_libs=yes then go ahead with building MySQL
693 if test "$have_mysql_libs" = yes ; then
694 # this AC_MSG_RESULT is from above!
696 WANT_SUBDIRS="$WANT_SUBDIRS shib-mysql-ccache"
697 AC_SUBST(MYSQL_CFLAGS)
702 AC_SUBST(WANT_SUBDIRS)
704 if test -n "$APXS_CC" && test "$APXS_CC" != "$CC" ; then
705 echo "=================================================================="
706 echo "WARNING: You have chosen to compile Apache-1.3 modules with a different"
707 echo " compiler than the one used to compile Apache."
709 echo " Current compiler: $CC"
710 echo " Apache's compiler: $APXS_CC"
712 echo "This could cause some problems."
713 echo "=================================================================="
716 if test -n "$APXS2_CC" && test "$APXS2_CC" != "$CC" ; then
717 echo "=================================================================="
718 echo "WARNING: You have chosen to compile Apache-2 modules with a different"
719 echo " compiler than the one used to compile Apache."
721 echo " Current compiler: $CC"
722 echo " Apache's compiler: $APXS2_CC"
724 echo "This could cause some problems."
725 echo "=================================================================="