2 AC_INIT([shibboleth], [1.3], [shibboleth-users@internet2.edu], [shibboleth])
3 AM_CONFIG_HEADER(config.h)
4 AM_INIT_AUTOMAKE([shibboleth],[1.3])
6 sinclude(acx_pthread.m4)
7 sinclude(acx_rpctest.m4)
10 AC_HELP_STRING(--enable-debug, [Have GCC compile with symbols (Default = no)
12 enable_debug=$enableval, enable_debug=no)
14 if test "$enable_debug" = "yes" ; then
15 GCC_CFLAGS="$CFLAGS -g -D_DEBUG"
16 GCC_CXXFLAGS="$CXXFLAGS -g -D_DEBUG"
18 GCC_CFLAGS="$CFLAGS -O2 -DNDEBUG"
19 GCC_CXXFLAGS="$CXXFLAGS -O2 -DNDEBUG"
22 AC_PROG_CC([gcc gcc3 cc])
23 AC_PROG_CXX([g++ g++3 c++ CC])
25 if test "$GCC" = "yes" ; then
27 CXXFLAGS="$GCC_CXXFLAGS"
41 # Checks for typedefs, structures, and compiler characteristics.
46 # Checks for library functions.
49 AC_CHECK_FUNCS([strchr strdup strstr gmtime_r strtok_r strcasecmp])
50 AC_CHECK_HEADERS([dlfcn.h])
53 # AC_SEARCH_LIBS(xdr_uint64_t,nsl,,
54 # [CFLAGS="$CFLAGS -DNEED_XDR_LONGLONG"
55 # CXXFLAGS="$CXXFLAGS -DNEED_XDR_LONGLONG"])
59 ACX_PTHREAD([enable_threads="pthread"],[enable_threads="no"])
60 if test $enable_threads != "pthread"; then
61 AC_MSG_ERROR([unable to find pthreads, currently this is required])
63 AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.])
64 LIBS="$PTHREAD_LIBS $LIBS"
65 CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
66 CXXFLAGS="$PTHREAD_CFLAGS $CXXFLAGS"
69 # Test RPC now -- finish dealing with it later
70 AC_ARG_ENABLE(native-rpc,
71 AC_HELP_STRING([--enable-native-rpc], [use the OS-supplied Sun RPC library, default is NO, except Linux]),
72 [ if test "x$enableval" = "x" ; then
75 NATIVE_RPC="$enableval"
78 ACX_RPCTEST([rpctest="yes"],[rpctest="no"])
79 AC_MSG_NOTICE([does the native Sun RPC library support svcfd_create...$rpctest])
80 if test $NATIVE_RPC = "no"; then
83 if test $rpctest = "yes"; then
84 AC_MSG_WARN([embedded Sun RPC library does not support Linux])
87 AC_MSG_ERROR([embedded Sun RPC library won't work, but neither will native version])
92 if test $NATIVE_RPC = "yes" && test $rpctest = "no"; then
93 AC_MSG_WARN([native Sun RPC won't work, using internal version])
96 if test $NATIVE_RPC = "yes"; then
97 AC_CHECK_DECLS([svcfd_create],,,[#include <rpc/rpc.h>])
101 [[#include <rpc/rpc.h>
102 static SVCXPRT* xprt = NULL;]],
103 [[svc_destroy(xprt);]]),
104 AC_DEFINE(HAVE_WORKING_SVC_DESTROY,1,[Define if RPC SVC macros work on this platform]),)
107 AC_CHECK_TYPES([struct rpcent],,,[#include <netdb.h>])
108 AC_CHECK_DECLS(sys_errlist)
109 AC_DEFINE(HAVE_DECL_SVCFD_CREATE,1,[ Define to 1 if you have the declaration of svcfd_create, and to 0 if you don't.])
110 AC_DEFINE(HAVE_WORKING_SVC_DESTROY,1,[Define if RPC SVC macros work on this platform])
114 AC_HELP_STRING([--with-dmalloc=PATH], [where dmalloc is installed]),
115 [if test x_$with_dmalloc != x_/usr; then
116 LDFLAGS="-L${with_dmalloc}/lib $LDFLAGS"
117 CPPFLAGS="-I${with_dmalloc}/include $CPPFLAGS"
119 AC_CHECK_LIB(dmallocxx, dmalloc_shutdown,,
120 AC_MSG_ERROR([unable to find dmallocxx library]))
124 AC_PATH_PROG(PKG_CONFIG, pkg-config)
125 if test "x$PKG_CONFIG" = x || test "x$PKG_CONFIG" = "xno" ; then
127 AC_HELP_STRING([--with-openssl=PATH], [where openssl is installed]),
128 [if test x_$with_openssl != x_/usr; then
129 SSLLIBS="-L${with_openssl}/lib"
130 SSLFLAGS="-I${with_openssl}/include"
132 SSLLIBS="$SSLLIBS -lssl -lcrypto"
134 SSLLIBS="`$PKG_CONFIG --libs openssl`"
135 SSLFLAGS="`$PKG_CONFIG --cflags openssl`"
137 AC_MSG_CHECKING(for OpenSSL libraries)
138 AC_MSG_RESULT($SSLLIBS)
139 LIBS="$LIBS $SSLLIBS"
140 AC_MSG_CHECKING(for OpenSSL cflags)
141 AC_MSG_RESULT($SSLFLAGS)
142 CPPFLAGS="$SSLFLAGS $CPPFLAGS"
144 AC_CHECK_HEADER([openssl/ssl.h],,
145 AC_MSG_ERROR([unable to find openssl header files]))
146 AC_MSG_CHECKING(for ERR_load_CRYPTO_string)
147 AC_TRY_LINK_FUNC([ERR_load_CRYPTO_strings],,
148 AC_MSG_ERROR([unable to link with openssl libraries]))
150 AC_MSG_CHECKING(for SSL_library_init)
151 AC_TRY_LINK_FUNC([SSL_library_init],,
152 AC_MSG_ERROR([unable to link with openssl libraries]))
158 AC_PATH_PROG(LOG4CPP_CONFIG,log4cpp-config)
160 AC_HELP_STRING([--with-log4cpp=PATH], [where log4cpp is installed]),
161 [LOG4CPP_CONFIG="${with_log4cpp}/bin/log4cpp-config"])
162 if test -f "${LOG4CPP_CONFIG}"; then
163 LDFLAGS="`${LOG4CPP_CONFIG} --libs` $LDFLAGS"
164 CPPFLAGS="`${LOG4CPP_CONFIG} --cflags` $CPPFLAGS"
166 AC_MSG_WARN([log4cpp-config not found, guessing at log4cpp build settings])
167 LIBS="-llog4cpp $LIBS"
169 AC_CHECK_HEADER([log4cpp/Category.hh],,AC_MSG_ERROR([unable to find log4cpp header files]))
171 [#include <log4cpp/Category.hh>],
172 [log4cpp::Category::getInstance("foo")],
173 [AC_DEFINE(HAVE_LIBLOG4CPP,1,[Define if log4cpp library was found])],
174 [AC_MSG_ERROR([unable to link with log4cpp])])
178 AC_HELP_STRING([--with-xerces=PATH], [where xerces-c is installed]),
179 [if test x_$with_xerces != x_/usr; then
180 LDFLAGS="-L${with_xerces}/lib $LDFLAGS"
181 CPPFLAGS="-I${with_xerces}/include $CPPFLAGS"
183 LIBS="-lxerces-c $LIBS"
184 AC_CHECK_HEADER([xercesc/dom/DOM.hpp],,
185 AC_MSG_ERROR([unable to find xerces header files]))
186 AC_MSG_CHECKING([Xerces version])
188 [AC_LANG_PROGRAM([#include <xercesc/util/XercesVersion.hpp>],
189 [#if _XERCES_VERSION == 20601
192 #error must use patched version 2.6.1 provided by Shibboleth project (http://wayf.internet2.edu/shibboleth/)
195 [AC_MSG_FAILURE([Shibboleth requires patched Xerces version 2.6.1 (http://wayf.internet2.edu/shibboleth/)])])
197 [#include <xercesc/util/PlatformUtils.hpp>],
198 [xercesc::XMLPlatformUtils::Initialize()],
199 [AC_DEFINE(HAVE_LIBXERCESC,1,[Define if Xerces-C library was found])],
200 [AC_MSG_ERROR([unable to link with Xerces])])
203 # XML-Security settings
205 AC_HELP_STRING([--with-xmlsec=PATH], [where xmlsec is installed]),
206 [if test x_$with_xmlsec != x_/usr; then
207 LDFLAGS="-L${with_xmlsec}/lib $LDFLAGS"
208 CPPFLAGS="-I${with_xmlsec}/include $CPPFLAGS"
210 LIBS="-lxml-security-c $LIBS"
211 AC_CHECK_HEADER([xsec/xenc/XENCEncryptionMethod.hpp],,AC_MSG_ERROR([unable to find xml-security 1.1 header files]),[#include <xercesc/dom/DOM.hpp>])
213 [#include <xsec/utils/XSECPlatformUtils.hpp>],
214 [XSECPlatformUtils::Initialise()],
215 [AC_DEFINE(HAVE_LIBXSEC,1,[Define if XML-Sec library was found])],
216 [AC_MSG_ERROR([unable to link with xml-security])])
220 AC_HELP_STRING([--with-saml=PATH], [where saml is installed]),
221 [if test x_$with_saml != x_/usr; then
222 LDFLAGS="-L${with_saml}/lib $LDFLAGS"
223 CPPFLAGS="-I${with_saml}/include $CPPFLAGS"
225 AC_CHECK_HEADER([saml/saml.h],,
226 AC_MSG_ERROR([unable to find saml header files]))
229 [#include <saml/saml.h>
230 #include <saml/version.h>],
231 [#if _OPENSAML_VERSION >= 10100
232 saml::SAMLConfig::getConfig();
234 #error Need OpenSAML version 1.1 or higher
236 [AC_DEFINE(HAVE_SAML,1,[Define if saml library was found])],
237 [AC_MSG_ERROR([unable to link with saml, or version too old])])
239 # output the underlying makefiles
240 WANT_SUBDIRS="doc shib schemas configs shib-target shar siterefresh test xmlproviders"
241 AC_CONFIG_FILES([Makefile doc/Makefile shib/Makefile schemas/Makefile \
242 configs/Makefile oncrpc/Makefile oncrpc/rpc/Makefile \
243 shib-target/Makefile shar/Makefile siterefresh/Makefile \
244 test/Makefile xmlproviders/Makefile])
247 # now deal with the rpc library, to see if we need to build our own
248 if test $NATIVE_RPC = "no"; then
249 WANT_SUBDIRS="oncrpc $WANT_SUBDIRS"
250 AC_DEFINE(USE_OUR_ONCRPC,1,[Define if using embedded version of ONC RPC.])
252 AM_CONDITIONAL(USE_OUR_ONCRPC,test "$NATIVE_RPC" = "no")
255 # Apache 1.3 (mod_shib_13)
257 # --with-apxs (DSO build, the normal way, uses apxs to derive build flags)
258 # --without-apxs (DSO build, you tell us how to build using the environment)
260 AC_ARG_ENABLE(apache-13,
261 AC_HELP_STRING([--enable-apache-13], [enable the Apache 1.3 modules]),
262 [ if test "x$enableval" = "x" ; then
265 WANT_APACHE_13="$enableval"
267 ], [ WANT_APACHE_13=no ])
268 AC_MSG_CHECKING(whether to build Apache-1.3 support)
269 if test "$WANT_APACHE_13" != yes && test "$WANT_APACHE_13" != no ; then
272 AC_MSG_RESULT($WANT_APACHE_13)
274 if test "$WANT_APACHE_13" = yes ; then
277 [ --with-apxs[=FILE] Build shared Apache module(s). FILE is the optional
278 pathname to the Apache apxs tool; defaults to "apxs".],
280 if test "$withval" = "yes"; then
281 for i in /usr/sbin /usr/local/apache/bin ; do
282 if test -f "$i/apxs"; then
286 if test -z "$APXS"; then
294 AC_PATH_PROG(APXS, apxs, no)
297 AC_MSG_CHECKING([for dynamic Apache-1.3 module support (w/ or w/o APXS)])
298 if test "$APXS" = "no"; then
300 # --without-apxs means you want the modules,
301 # but want to tell us how to build them
302 AC_MSG_RESULT(yes, but use environment, not apxs)
304 echo "Did you set one or more of these?"
306 echo "APXS_CFLAGS APXS_PREFIX APXS_INCLUDE APXS_LIBEXEC APXS_SYSCONFDIR"
309 AC_MSG_NOTICE([APXS_CFLAGS is $APXS_CFLAGS])
311 # try and find the Apache root
312 if test -z "$APXS_PREFIX"; then
313 if test -d "/usr/local/apache"; then
314 APXS_PREFIX="/usr/local/apache"
316 AC_MSG_ERROR([You MUST set APXS_PREFIX so the right Apache can be located!])
318 elif test ! -d "$APXS_PREFIX"; then
319 AC_MSG_ERROR([APXS_PREFIX of $APXS_PREFIX cannot be found])
321 AC_MSG_NOTICE([APXS_PREFIX is $APXS_PREFIX])
324 # other subfolders might be derived from APXS_PREFIX
325 if test -z "$APXS_INCLUDE"; then
326 if test -f "$APXS_PREFIX/include/httpd.h"; then
327 APXS_INCLUDE="$APXS_PREFIX/include"
329 AC_MSG_ERROR([can't find Apache include files beneath $APXS_PREFIX])
331 elif ! test -f "$APXS_INCLUDE/httpd.h"; then
332 AC_MSG_ERROR([APXS_INCLUDE of $APXS_INCLUDE does not contain Apache headers])
334 AC_MSG_NOTICE([APXS_INCLUDE is $APXS_INCLUDE])
336 if test -z "$APXS_LIBEXEC"; then
337 if test -d "$APXS_PREFIX/libexec"; then
338 APXS_LIBEXEC="$APXS_PREFIX/libexec"
339 elif test -d "$APXS_PREFIX/modules"; then
340 APXS_LIBEXEC="$APXS_PREFIX/modules"
342 AC_MSG_ERROR([can't find Apache libexec/module directory beneath $APXS_PREFIX])
344 elif ! test -d "$APXS_LIBEXEC"; then
345 AC_MSG_ERROR([APXS_LIBEXEC of $APXS_LIBEXEC does not exist])
347 AC_MSG_NOTICE([APXS_LIBEXEC is $APXS_LIBEXEC])
349 if test -z "$APXS_SYSCONFDIR"; then
350 if test -d "$APXS_PREFIX/conf"; then
351 APXS_SYSCONFDIR="$APXS_PREFIX/conf"
353 AC_MSG_ERROR([can't find Apache conf directory beneath $APXS_PREFIX])
355 elif ! test -d "$APXS_SYSCONFDIR"; then
356 AC_MSG_ERROR([APXS_SYSCONFDIR of $APXS_SYSCONFDIR does not exist])
358 AC_MSG_NOTICE([APXS_SYSCONFDIR is $APXS_SYSCONFDIR])
362 elif test -n "$APXS"; then
364 # extract settings we need from APXS -q
365 APXS_CC="`$APXS -q CC`"
366 APXS_CFLAGS="`$APXS -q CFLAGS` `$APXS -q CFLAGS_SHLIB`"
367 APXS_INCLUDE="`$APXS -q INCLUDEDIR`"
368 APXS_LIBEXEC="`$APXS -q LIBEXECDIR`"
369 APXS_SYSCONFDIR="`$APXS -q SYSCONFDIR`"
372 AC_MSG_RESULT(found at $APXS)
374 if test -z "`$APXS -q LD_SHLIB`" || test "$APXS_LIBEXEC" = "modules"; then
376 [Your APXS installation is broken and cannot be used.
377 Please see http://www.webdav.org/mod_dav/install.html#apxs for
384 # guess we're not doing Apache 1.3
390 AC_SUBST(APXS_CFLAGS)
391 AC_SUBST(APXS_INCLUDE)
392 AC_SUBST(APXS_LIBEXEC)
393 AC_SUBST(APXS_SYSCONFDIR)
394 AM_CONDITIONAL(HAVE_APXS,test -n "$APXS")
397 # Apache 2.0 (mod_shib_20)
399 # --with-apxs2 (DSO build, the normal way, uses apxs to derive build flags)
400 # --with-apr (DSO build, APR development package installed separately)
401 # --without-apxs2 (DSO build, you tell us how to build using the environment)
403 AC_ARG_ENABLE(apache-20,
404 AC_HELP_STRING([--enable-apache-20], [enable the Apache 2.0 modules]),
405 [ if test "x$enableval" = "x" ; then
408 WANT_APACHE_20="$enableval"
410 ], [ WANT_APACHE_20=no ])
412 AC_MSG_CHECKING(whether to build Apache-2.0 support)
413 if test "$WANT_APACHE_20" != yes && test "$WANT_APACHE_20" != no ; then
416 AC_MSG_RESULT($WANT_APACHE_20)
418 if test "$WANT_APACHE_20" = yes ; then
421 [ --with-apxs2[=FILE] Build shared Apache module(s). FILE is the optional
422 pathname to the Apache apxs tool; defaults to "apxs".],
424 if test "$withval" = "yes"; then
425 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
426 if test -f "$i/apxs"; then
430 if test -z "$APXS2"; then
438 AC_PATH_PROG(APXS2, apxs, no)
441 AC_MSG_CHECKING([for dynamic Apache-2 module support (w/ or w/o APXS)])
442 if test "$APXS2" = "no"; then
444 # --without-apxs2 means you want the modules,
445 # but want to tell us how to build them
446 AC_MSG_RESULT(yes, but use environment, not apxs)
448 echo "Did you set one or more of these?"
450 echo "APXS2_CFLAGS APXS2_PREFIX APXS2_INCLUDE APXS2_LIBEXEC APXS2_SYSCONFDIR"
453 AC_MSG_NOTICE([APXS2_CFLAGS is $APXS2_CFLAGS])
455 # try and find the Apache root
456 if test -z "$APXS2_PREFIX"; then
457 if test -d "/usr/local/apache"; then
458 APXS2_PREFIX="/usr/local/apache"
460 AC_MSG_ERROR([You MUST set APXS2_PREFIX so the right Apache-2 can be located!])
462 elif test ! -d "$APXS2_PREFIX"; then
463 AC_MSG_ERROR([APXS2_PREFIX of $APXS2_PREFIX cannot be found])
465 AC_MSG_NOTICE([APXS2_PREFIX is $APXS2_PREFIX])
468 # other subfolders might be derived from APXS2_PREFIX
469 if test -z "$APXS2_INCLUDE"; then
470 if test -f "$APXS2_PREFIX/include/httpd.h"; then
471 APXS2_INCLUDE="$APXS2_PREFIX/include"
473 AC_MSG_ERROR([can't find Apache-2 include files beneath $APXS2_PREFIX])
475 elif ! test -f "$APXS2_INCLUDE/httpd.h"; then
476 AC_MSG_ERROR([APXS2_INCLUDE of $APXS2_INCLUDE does not contain Apache-2 headers])
478 AC_MSG_NOTICE([APXS2_INCLUDE is $APXS2_INCLUDE])
480 if test -z "$APXS2_LIBEXEC"; then
481 if test -d "$APXS2_PREFIX/libexec"; then
482 APXS2_LIBEXEC="$APXS2_PREFIX/libexec"
483 elif test -d "$APXS2_PREFIX/modules"; then
484 APXS2_LIBEXEC="$APXS2_PREFIX/modules"
486 AC_MSG_ERROR([can't find Apache-2 libexec/module directory beneath $APXS2_PREFIX])
488 elif ! test -d "$APXS2_LIBEXEC"; then
489 AC_MSG_ERROR([APXS2_LIBEXEC of $APXS2_LIBEXEC does not exist])
491 AC_MSG_NOTICE([APXS2_LIBEXEC is $APXS2_LIBEXEC])
493 if test -z "$APXS2_SYSCONFDIR"; then
494 if test -d "$APXS2_PREFIX/conf"; then
495 APXS2_SYSCONFDIR="$APXS2_PREFIX/conf"
497 AC_MSG_ERROR([can't find Apache-2 conf directory beneath $APXS2_PREFIX])
499 elif ! test -d "$APXS2_SYSCONFDIR"; then
500 AC_MSG_ERROR([APXS2_SYSCONFDIR of $APXS2_SYSCONFDIR does not exist])
502 AC_MSG_NOTICE([APXS2_SYSCONFDIR is $APXS2_SYSCONFDIR])
506 elif test -n "$APXS2"; then
509 AC_PATH_PROG(APR_CONFIG,apr-config)
511 AC_HELP_STRING([--with-apr=PATH], [where APR is installed]),
512 [APR_CONFIG="${with_apr}/bin/apr-config"])
513 if test -f "${APR_CONFIG}"; then
514 APR_CFLAGS="`${APR_CONFIG} --cflags` `${APR_CONFIG} --cppflags` `${APR_CONFIG} --includes`"
517 # extract settings we need from APXS2 -q
518 APXS2_CC="`$APXS2 -q CC`"
519 APXS2_CFLAGS="`$APXS2 -q CFLAGS` `$APXS2 -q CFLAGS_SHLIB` $APR_CFLAGS"
520 APXS2_INCLUDE="`$APXS2 -q INCLUDEDIR`"
521 APXS2_LIBEXEC="`$APXS2 -q LIBEXECDIR`"
522 APXS2_SYSCONFDIR="`$APXS2 -q SYSCONFDIR`"
525 AC_MSG_RESULT(found at $APXS2)
527 if test -z "`$APXS2 -q LD_SHLIB`" && test -z "`$APXS2 -q LIBEXECDIR`" \
528 || test "$APXS2_LIBEXEC" = "modules"; then
530 [Your APXS installation is broken and cannot be used.
531 Please see http://www.webdav.org/mod_dav/install.html#apxs for
538 # guess we're not doing Apache 2.0
544 AC_SUBST(APXS2_CFLAGS)
545 AC_SUBST(APXS2_INCLUDE)
546 AC_SUBST(APXS2_LIBEXEC)
547 AC_SUBST(APXS2_SYSCONFDIR)
548 AM_CONDITIONAL(HAVE_APXS2,test -n "$APXS2")
550 # always output the Makefile, even if you don't use it
551 AC_CONFIG_FILES([apache/Makefile])
552 AM_CONDITIONAL(BUILD_AP13,test "$WANT_APACHE_13" = "yes")
553 AM_CONDITIONAL(BUILD_AP20,test "$WANT_APACHE_20" = "yes")
555 # add the apache module to the list of wanted subdirs..
556 if test "$WANT_APACHE_13" = "yes" || test "$WANT_APACHE_20" = "yes" ; then
557 WANT_SUBDIRS="$WANT_SUBDIRS apache"
562 # Implement the checks of the MySQL Credential Cache
564 # 1) Assume the user wants MySQL; if it's not found then just continue without
565 # 2) If the user specifically requested Mysql, look for it and ERROR if not found
566 # 3) If the user specifically requested no-mysql, don't build it.
569 AC_CONFIG_FILES([shib-mysql-ccache/Makefile])
571 # determine whether we should enable the mysql ccache
572 AC_ARG_ENABLE([mysql],
573 AC_HELP_STRING([--disable-mysql], [disable the MySQL Credential Cache]),
574 [mysql_enabled=$enableval], [mysql_enabled=default])
576 if test "x$mysql_enabled" = "x" ; then
580 # Are we trying to build MySQL?
581 AC_MSG_CHECKING(whether to build the MySQL ccache)
582 if test "$mysql_enabled" = "yes" ; then
585 elif test "$mysql_enabled" = "default" ; then
587 AC_MSG_RESULT([yes, if it can be found])
593 # If we're trying to build MySQL, try to find the mysql_config program,
594 # verify we've got mysql >= 4, and make sure we can build with mysqld
595 if test "$build_mysql" = "yes" ; then
598 AC_HELP_STRING([--with-mysql=PATH], [directory where mysql is installed]),
599 [if test "$with_mysql" = no ; then
600 AC_MSG_ERROR([Try running --disable-mysql instead.])
601 elif test "$with_mysql" != yes ; then
602 mysql_dir="$with_mysql/bin"
605 # Try to find the mysql_config program
606 AC_PATH_PROG(MYSQL_CONFIG, mysql_config, no, $mysql_dir $PATH )
608 if test "$MYSQL_CONFIG" = no ; then
609 if test "$mysql_enabled" = "yes" ; then
610 AC_MSG_ERROR(Cannot find mysql_config)
612 AC_MSG_WARN(MySQL not found. skipping.)
617 # if we found mysql_config then build_mysql is 'yes'
618 if test "$MYSQL_CONFIG" != no ; then
619 AC_MSG_CHECKING(for mysql version >= 4)
620 mysql_version=`$MYSQL_CONFIG --version`
621 mysql_major_version=`echo $mysql_version | awk -F. '{print $1}'`
623 if test $mysql_major_version -lt 4 ; then
625 if test "$mysql_enabled" = "yes" ; then
626 AC_MSG_ERROR(You need MySQL version >= 4, found $mysql_version)
628 AC_MSG_RESULT(no.. skipping MySQL)
634 # if mysql_version_ok is 'yes', then we've made it this far.. ;)
635 if test "$mysql_version_ok" = "yes" ; then
636 AC_MSG_CHECKING(for embedded-MySQL libraries)
637 MYSQL_LIBS=`$MYSQL_CONFIG --libmysqld-libs`
638 if test $? != 0 ; then
640 if test "$mysql_enabled" = "yes" ; then
641 AC_MSG_ERROR(Could not find the MySQL Embedded-server libraries.)
643 AC_MSG_RESULT(no.. skipping MySQL)
651 # if found_mysql=yes then test that we can actually build mysql
652 if test "$found_mysql" = yes ; then
653 MYSQL_CFLAGS=`$MYSQL_CONFIG --cflags`
654 MYSQL_CFLAGS=`eval echo $MYSQL_CFLAGS`
655 MYSQL_LIBS=`eval echo $MYSQL_LIBS`
657 save_CPPFLAGS="$CPPFLAGS"
658 CPPFLAGS="$CPPFLAGS $MYSQL_CFLAGS"
660 AC_CHECK_HEADER([mysql.h], [have_mysql_h=yes], [have_mysql_h=no])
661 if test "$have_mysql_h" = no -a "$mysql_enabled" = "yes" ; then
662 AC_MSG_ERROR(unable to find MySQL header files)
665 if test "$have_mysql_h" = yes ; then
667 LIBS="$LIBS $MYSQL_LIBS"
668 AC_MSG_CHECKING(if we can link againt mysql)
672 [mysql_server_init(0, NULL, NULL)],
673 [have_mysql_libs=yes],
674 [have_mysql_libs=no])
677 if test "$have_mysql_libs" = no ; then
678 if test "$mysql_enabled" = "yes" ; then
679 AC_MSG_ERROR([unable to link with MySQL Embedded Server Library])
681 AC_MSG_RESULT(no. skipping MySQL)
686 CPPFLAGS="$save_CPPFLAGS"
689 # if have_mysql_libs=yes then go ahead with building MySQL
690 if test "$have_mysql_libs" = yes ; then
691 # this AC_MSG_RESULT is from above!
693 WANT_SUBDIRS="$WANT_SUBDIRS shib-mysql-ccache"
694 AC_SUBST(MYSQL_CFLAGS)
699 AC_SUBST(WANT_SUBDIRS)
701 if test -n "$APXS_CC" && test "$APXS_CC" != "$CC" ; then
702 echo "=================================================================="
703 echo "WARNING: You have chosen to compile Apache-1.3 modules with a different"
704 echo " compiler than the one used to compile Apache."
706 echo " Current compiler: $CC"
707 echo " Apache's compiler: $APXS_CC"
709 echo "This could cause some problems."
710 echo "=================================================================="
713 if test -n "$APXS2_CC" && test "$APXS2_CC" != "$CC" ; then
714 echo "=================================================================="
715 echo "WARNING: You have chosen to compile Apache-2 modules with a different"
716 echo " compiler than the one used to compile Apache."
718 echo " Current compiler: $CC"
719 echo " Apache's compiler: $APXS2_CC"
721 echo "This could cause some problems."
722 echo "=================================================================="