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_CPPFLAGS="$CPPFLAGS -D_DEBUG"
16 GCC_CFLAGS="$CFLAGS -g -D_DEBUG"
17 GCC_CXXFLAGS="$CXXFLAGS -g -D_DEBUG"
19 GCC_CPPFLAGS="$CPPFLAGS -DNDEBUG"
20 GCC_CFLAGS="$CFLAGS -O2 -DNDEBUG"
21 GCC_CXXFLAGS="$CXXFLAGS -O2 -DNDEBUG"
24 AC_PROG_CC([gcc gcc3 cc])
25 AC_PROG_CXX([g++ g++3 c++ CC])
27 if test "$GCC" = "yes" ; then
28 CPPFLAGS="$GCC_CPPFLAGS"
30 CXXFLAGS="$GCC_CXXFLAGS"
44 # Checks for typedefs, structures, and compiler characteristics.
49 # Checks for library functions.
52 AC_CHECK_FUNCS([strchr strdup strstr gmtime_r strtok_r strcasecmp])
53 AC_CHECK_HEADERS([dlfcn.h])
56 # AC_SEARCH_LIBS(xdr_uint64_t,nsl,,
57 # [CFLAGS="$CFLAGS -DNEED_XDR_LONGLONG"
58 # CXXFLAGS="$CXXFLAGS -DNEED_XDR_LONGLONG"])
62 ACX_PTHREAD([enable_threads="pthread"],[enable_threads="no"])
63 if test $enable_threads != "pthread"; then
64 AC_MSG_ERROR([unable to find pthreads, currently this is required])
66 AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.])
67 LIBS="$PTHREAD_LIBS $LIBS"
68 CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
69 CXXFLAGS="$PTHREAD_CFLAGS $CXXFLAGS"
72 # Test RPC now -- finish dealing with it later
73 AC_ARG_ENABLE(native-rpc,
74 AC_HELP_STRING([--enable-native-rpc], [use the OS-supplied Sun RPC library, default is NO, except Linux]),
75 [ if test "x$enableval" = "x" ; then
78 NATIVE_RPC="$enableval"
81 ACX_RPCTEST([rpctest="yes"],[rpctest="no"])
82 AC_MSG_NOTICE([does the native Sun RPC library support svcfd_create...$rpctest])
83 if test $NATIVE_RPC = "no"; then
86 if test $rpctest = "yes"; then
87 AC_MSG_WARN([embedded Sun RPC library does not support Linux])
90 AC_MSG_ERROR([embedded Sun RPC library won't work, but neither will native version])
95 if test $NATIVE_RPC = "yes" && test $rpctest = "no"; then
96 AC_MSG_WARN([native Sun RPC won't work, using internal version])
99 if test $NATIVE_RPC = "yes"; then
100 AC_CHECK_DECLS([svcfd_create],,,[#include <rpc/rpc.h>])
104 [[#include <rpc/rpc.h>
105 static SVCXPRT* xprt = NULL;]],
106 [[svc_destroy(xprt);]]),
107 AC_DEFINE(HAVE_WORKING_SVC_DESTROY,1,[Define if RPC SVC macros work on this platform]),)
110 AC_CHECK_TYPES([struct rpcent],,,[#include <netdb.h>])
111 AC_CHECK_DECLS(sys_errlist)
112 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.])
113 AC_DEFINE(HAVE_WORKING_SVC_DESTROY,1,[Define if RPC SVC macros work on this platform])
117 AC_HELP_STRING([--with-dmalloc=PATH], [where dmalloc is installed]),
118 [if test x_$with_dmalloc != x_/usr; then
119 LDFLAGS="-L${with_dmalloc}/lib $LDFLAGS"
120 CPPFLAGS="-I${with_dmalloc}/include $CPPFLAGS"
122 AC_CHECK_LIB(dmallocxx, dmalloc_shutdown,,
123 AC_MSG_ERROR([unable to find dmallocxx library]))
127 AC_PATH_PROG(PKG_CONFIG, pkg-config)
128 if test "x$PKG_CONFIG" = x || test "x$PKG_CONFIG" = "xno" ; then
130 AC_HELP_STRING([--with-openssl=PATH], [where openssl is installed]),
131 [if test x_$with_openssl != x_/usr; then
132 SSLLIBS="-L${with_openssl}/lib"
133 SSLFLAGS="-I${with_openssl}/include"
135 SSLLIBS="$SSLLIBS -lssl -lcrypto"
137 SSLLIBS="`$PKG_CONFIG --libs openssl`"
138 SSLFLAGS="`$PKG_CONFIG --cflags openssl`"
140 AC_MSG_CHECKING(for OpenSSL libraries)
141 AC_MSG_RESULT($SSLLIBS)
142 LIBS="$LIBS $SSLLIBS"
143 AC_MSG_CHECKING(for OpenSSL cflags)
144 AC_MSG_RESULT($SSLFLAGS)
145 CPPFLAGS="$SSLFLAGS $CPPFLAGS"
147 AC_CHECK_HEADER([openssl/ssl.h],,
148 AC_MSG_ERROR([unable to find openssl header files]))
149 AC_MSG_CHECKING(for ERR_load_CRYPTO_string)
150 AC_TRY_LINK_FUNC([ERR_load_CRYPTO_strings],,
151 AC_MSG_ERROR([unable to link with openssl libraries]))
153 AC_MSG_CHECKING(for SSL_library_init)
154 AC_TRY_LINK_FUNC([SSL_library_init],,
155 AC_MSG_ERROR([unable to link with openssl libraries]))
161 AC_PATH_PROG(LOG4CPP_CONFIG,log4cpp-config)
163 AC_HELP_STRING([--with-log4cpp=PATH], [where log4cpp is installed]),
164 [LOG4CPP_CONFIG="${with_log4cpp}/bin/log4cpp-config"])
165 if test -f "${LOG4CPP_CONFIG}"; then
166 LDFLAGS="`${LOG4CPP_CONFIG} --libs` $LDFLAGS"
167 CPPFLAGS="`${LOG4CPP_CONFIG} --cflags` $CPPFLAGS"
169 AC_MSG_WARN([log4cpp-config not found, guessing at log4cpp build settings])
170 LIBS="-llog4cpp $LIBS"
172 AC_CHECK_HEADER([log4cpp/Category.hh],,AC_MSG_ERROR([unable to find log4cpp header files]))
174 [#include <log4cpp/Category.hh>],
175 [log4cpp::Category::getInstance("foo")],
176 [AC_DEFINE(HAVE_LIBLOG4CPP,1,[Define if log4cpp library was found])],
177 [AC_MSG_ERROR([unable to link with log4cpp])])
181 AC_HELP_STRING([--with-xerces=PATH], [where xerces-c is installed]),
182 [if test x_$with_xerces != x_/usr; then
183 LDFLAGS="-L${with_xerces}/lib $LDFLAGS"
184 CPPFLAGS="-I${with_xerces}/include $CPPFLAGS"
186 LIBS="-lxerces-c $LIBS"
187 AC_CHECK_HEADER([xercesc/dom/DOM.hpp],,
188 AC_MSG_ERROR([unable to find xerces header files]))
189 AC_MSG_CHECKING([Xerces version])
191 [AC_LANG_PROGRAM([#include <xercesc/util/XercesVersion.hpp>],
192 [#if _XERCES_VERSION == 20601
195 #error must use patched version 2.6.1 provided by Shibboleth project (http://wayf.internet2.edu/shibboleth/)
198 [AC_MSG_ERROR([Shibboleth requires patched Xerces version 2.6.1 (http://wayf.internet2.edu/shibboleth/)])])
200 [#include <xercesc/util/PlatformUtils.hpp>],
201 [xercesc::XMLPlatformUtils::Initialize()],
202 [AC_DEFINE(HAVE_LIBXERCESC,1,[Define if Xerces-C library was found])],
203 [AC_MSG_ERROR([unable to link with Xerces])])
206 # XML-Security settings
208 AC_HELP_STRING([--with-xmlsec=PATH], [where xmlsec is installed]),
209 [if test x_$with_xmlsec != x_/usr; then
210 LDFLAGS="-L${with_xmlsec}/lib $LDFLAGS"
211 CPPFLAGS="-I${with_xmlsec}/include $CPPFLAGS"
213 LIBS="-lxml-security-c $LIBS"
214 AC_CHECK_HEADER([xsec/xenc/XENCEncryptionMethod.hpp],,AC_MSG_ERROR([unable to find xml-security 1.1 header files]),[#include <xercesc/dom/DOM.hpp>])
216 [#include <xsec/utils/XSECPlatformUtils.hpp>],
217 [XSECPlatformUtils::Initialise()],
218 [AC_DEFINE(HAVE_LIBXSEC,1,[Define if XML-Sec library was found])],
219 [AC_MSG_ERROR([unable to link with xml-security])])
223 AC_HELP_STRING([--with-saml=PATH], [where saml is installed]),
224 [if test x_$with_saml != x_/usr; then
225 LDFLAGS="-L${with_saml}/lib $LDFLAGS"
226 CPPFLAGS="-I${with_saml}/include $CPPFLAGS"
228 AC_CHECK_HEADER([saml/saml.h],,
229 AC_MSG_ERROR([unable to find saml header files]))
232 [#include <saml/saml.h>
233 #include <saml/version.h>],
234 [#if _OPENSAML_VERSION >= 10100
235 saml::SAMLConfig::getConfig();
237 #error Need OpenSAML version 1.1 or higher
239 [AC_DEFINE(HAVE_SAML,1,[Define if saml library was found])],
240 [AC_MSG_ERROR([unable to link with saml, or version too old])])
242 # output the underlying makefiles
243 WANT_SUBDIRS="doc shib schemas configs shib-target shar siterefresh test xmlproviders"
244 AC_CONFIG_FILES([Makefile doc/Makefile shib/Makefile schemas/Makefile \
245 configs/Makefile oncrpc/Makefile oncrpc/rpc/Makefile \
246 shib-target/Makefile shar/Makefile siterefresh/Makefile \
247 test/Makefile xmlproviders/Makefile selinux/Makefile])
250 # now deal with the rpc library, to see if we need to build our own
251 if test $NATIVE_RPC = "no"; then
252 WANT_SUBDIRS="oncrpc $WANT_SUBDIRS"
253 AC_DEFINE(USE_OUR_ONCRPC,1,[Define if using embedded version of ONC RPC.])
255 AM_CONDITIONAL(USE_OUR_ONCRPC,test "$NATIVE_RPC" = "no")
258 # Build NSAPI module?
260 AC_MSG_CHECKING(for NSAPI module option)
262 AC_HELP_STRING([--with-nsapi=DIR], [Build NSAPI module for Netscape/iPlanet/SunONE]),
263 [WANT_NSAPI=$withval],[WANT_NSAPI=no])
264 AC_MSG_RESULT($WANT_NSAPI)
266 if test "$WANT_NSAPI" != "no"; then
267 if test ! -d $WANT_NSAPI/bin ; then
268 AC_MSG_ERROR(Please specify the path to the root of your Netscape/iPlanet/SunONE server using --with-nsapi=DIR)
270 AC_MSG_CHECKING(for NSAPI include files)
271 if test -d $WANT_NSAPI/include ; then
272 NSAPI_INCLUDE=$WANT_NSAPI/include
273 AC_MSG_RESULT(Netscape-Enterprise 3.x style)
274 AC_CHECK_HEADERS([$NSAPI_INCLUDE/nsapi.h])
275 NSAPI_INCLUDE="$NSAPI_INC_DIR -I$NSAPI_INCLUDE"
277 if test -d $WANT_NSAPI/plugins/include ; then
278 test -n "$NSAPI_INCLUDE" && NSAPI_INC_DIR="-I$NSAPI_INCLUDE"
279 NSAPI_INCLUDE="$WANT_NSAPI/plugins/include"
280 AC_MSG_RESULT(iPlanet 4.x / SunONE 6.x style)
281 AC_CHECK_HEADERS([$NSAPI_INCLUDE/nsapi.h])
282 NSAPI_INCLUDE="$NSAPI_INC_DIR -I$NSAPI_INCLUDE"
284 if test "$NSAPI_INCLUDE" = ""; then
285 AC_MSG_ERROR(Please check you have nsapi.h in either $WANT_NSAPI/include or $WANT_NSAPI/plugins/include)
289 AC_SUBST(NSAPI_INCLUDE)
291 # always output the Makefile, even if you don't use it
292 AC_CONFIG_FILES([nsapi_shib/Makefile])
293 AM_CONDITIONAL(BUILD_NSAPI,test ! "$WANT_NSAPI" = "no")
295 # add the NSAPI module to the list of wanted subdirs..
296 if test ! "$WANT_NSAPI" = "no" ; then
297 WANT_SUBDIRS="$WANT_SUBDIRS nsapi_shib"
301 # Apache 1.3 (mod_shib_13)
303 # --with-apxs (DSO build, the normal way, uses apxs to derive build flags)
304 # --without-apxs (DSO build, you tell us how to build using the environment)
306 AC_ARG_ENABLE(apache-13,
307 AC_HELP_STRING([--enable-apache-13], [enable the Apache 1.3 modules]),
308 [ if test "x$enableval" = "x" ; then
311 WANT_APACHE_13="$enableval"
313 ], [ WANT_APACHE_13=no ])
314 AC_MSG_CHECKING(whether to build Apache-1.3 support)
315 if test "$WANT_APACHE_13" != yes && test "$WANT_APACHE_13" != no ; then
318 AC_MSG_RESULT($WANT_APACHE_13)
320 if test "$WANT_APACHE_13" = yes ; then
323 [ --with-apxs[=FILE] Build shared Apache module(s). FILE is the optional
324 pathname to the Apache apxs tool; defaults to "apxs".],
326 if test "$withval" = "yes"; then
327 for i in /usr/sbin /usr/local/apache/bin ; do
328 if test -f "$i/apxs"; then
332 if test -z "$APXS"; then
340 AC_PATH_PROG(APXS, apxs, no)
343 AC_MSG_CHECKING([for dynamic Apache-1.3 module support (w/ or w/o APXS)])
344 if test "$APXS" = "no"; then
346 # --without-apxs means you want the modules,
347 # but want to tell us how to build them
348 AC_MSG_RESULT(yes, but use environment, not apxs)
350 echo "Did you set one or more of these?"
352 echo "APXS_CFLAGS APXS_PREFIX APXS_INCLUDE APXS_LIBEXEC APXS_SYSCONFDIR"
355 AC_MSG_NOTICE([APXS_CFLAGS is $APXS_CFLAGS])
357 # try and find the Apache root
358 if test -z "$APXS_PREFIX"; then
359 if test -d "/usr/local/apache"; then
360 APXS_PREFIX="/usr/local/apache"
362 AC_MSG_ERROR([You MUST set APXS_PREFIX so the right Apache can be located!])
364 elif test ! -d "$APXS_PREFIX"; then
365 AC_MSG_ERROR([APXS_PREFIX of $APXS_PREFIX cannot be found])
367 AC_MSG_NOTICE([APXS_PREFIX is $APXS_PREFIX])
370 # other subfolders might be derived from APXS_PREFIX
371 if test -z "$APXS_INCLUDE"; then
372 if test -f "$APXS_PREFIX/include/httpd.h"; then
373 APXS_INCLUDE="$APXS_PREFIX/include"
375 AC_MSG_ERROR([can't find Apache include files beneath $APXS_PREFIX])
377 elif ! test -f "$APXS_INCLUDE/httpd.h"; then
378 AC_MSG_ERROR([APXS_INCLUDE of $APXS_INCLUDE does not contain Apache headers])
380 AC_MSG_NOTICE([APXS_INCLUDE is $APXS_INCLUDE])
382 if test -z "$APXS_LIBEXEC"; then
383 if test -d "$APXS_PREFIX/libexec"; then
384 APXS_LIBEXEC="$APXS_PREFIX/libexec"
385 elif test -d "$APXS_PREFIX/modules"; then
386 APXS_LIBEXEC="$APXS_PREFIX/modules"
388 AC_MSG_ERROR([can't find Apache libexec/module directory beneath $APXS_PREFIX])
390 elif ! test -d "$APXS_LIBEXEC"; then
391 AC_MSG_ERROR([APXS_LIBEXEC of $APXS_LIBEXEC does not exist])
393 AC_MSG_NOTICE([APXS_LIBEXEC is $APXS_LIBEXEC])
395 if test -z "$APXS_SYSCONFDIR"; then
396 if test -d "$APXS_PREFIX/conf"; then
397 APXS_SYSCONFDIR="$APXS_PREFIX/conf"
399 AC_MSG_ERROR([can't find Apache conf directory beneath $APXS_PREFIX])
401 elif ! test -d "$APXS_SYSCONFDIR"; then
402 AC_MSG_ERROR([APXS_SYSCONFDIR of $APXS_SYSCONFDIR does not exist])
404 AC_MSG_NOTICE([APXS_SYSCONFDIR is $APXS_SYSCONFDIR])
408 elif test -n "$APXS"; then
410 # extract settings we need from APXS -q
411 APXS_CC="`$APXS -q CC`"
412 APXS_CFLAGS="`$APXS -q CFLAGS` `$APXS -q CFLAGS_SHLIB`"
413 APXS_INCLUDE="`$APXS -q INCLUDEDIR`"
414 APXS_LIBEXEC="`$APXS -q LIBEXECDIR`"
415 APXS_SYSCONFDIR="`$APXS -q SYSCONFDIR`"
418 AC_MSG_RESULT(found at $APXS)
420 if test -z "`$APXS -q LD_SHLIB`" || test "$APXS_LIBEXEC" = "modules"; then
422 [Your APXS installation is broken and cannot be used.
423 Please see http://www.webdav.org/mod_dav/install.html#apxs for
430 # guess we're not doing Apache 1.3
436 AC_SUBST(APXS_CFLAGS)
437 AC_SUBST(APXS_INCLUDE)
438 AC_SUBST(APXS_LIBEXEC)
439 AC_SUBST(APXS_SYSCONFDIR)
440 AM_CONDITIONAL(HAVE_APXS,test -n "$APXS")
443 # Apache 2.0 (mod_shib_20)
445 # --with-apxs2 (DSO build, the normal way, uses apxs to derive build flags)
446 # --with-apr (DSO build, APR development package installed separately)
447 # --without-apxs2 (DSO build, you tell us how to build using the environment)
449 AC_ARG_ENABLE(apache-20,
450 AC_HELP_STRING([--enable-apache-20], [enable the Apache 2.0 modules]),
451 [ if test "x$enableval" = "x" ; then
454 WANT_APACHE_20="$enableval"
456 ], [ WANT_APACHE_20=no ])
458 AC_MSG_CHECKING(whether to build Apache-2.0 support)
459 if test "$WANT_APACHE_20" != yes && test "$WANT_APACHE_20" != no ; then
462 AC_MSG_RESULT($WANT_APACHE_20)
464 if test "$WANT_APACHE_20" = yes ; then
467 [ --with-apxs2[=FILE] Build shared Apache module(s). FILE is the optional
468 pathname to the Apache apxs tool; defaults to "apxs".],
470 if test "$withval" = "yes"; then
471 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
472 if test -f "$i/apxs"; then
476 if test -z "$APXS2"; then
484 AC_PATH_PROG(APXS2, apxs, no)
487 AC_MSG_CHECKING([for dynamic Apache-2 module support (w/ or w/o APXS)])
488 if test "$APXS2" = "no"; then
490 # --without-apxs2 means you want the modules,
491 # but want to tell us how to build them
492 AC_MSG_RESULT(yes, but use environment, not apxs)
494 echo "Did you set one or more of these?"
496 echo "APXS2_CFLAGS APXS2_PREFIX APXS2_INCLUDE APXS2_LIBEXEC APXS2_SYSCONFDIR"
499 AC_MSG_NOTICE([APXS2_CFLAGS is $APXS2_CFLAGS])
501 # try and find the Apache root
502 if test -z "$APXS2_PREFIX"; then
503 if test -d "/usr/local/apache"; then
504 APXS2_PREFIX="/usr/local/apache"
506 AC_MSG_ERROR([You MUST set APXS2_PREFIX so the right Apache-2 can be located!])
508 elif test ! -d "$APXS2_PREFIX"; then
509 AC_MSG_ERROR([APXS2_PREFIX of $APXS2_PREFIX cannot be found])
511 AC_MSG_NOTICE([APXS2_PREFIX is $APXS2_PREFIX])
514 # other subfolders might be derived from APXS2_PREFIX
515 if test -z "$APXS2_INCLUDE"; then
516 if test -f "$APXS2_PREFIX/include/httpd.h"; then
517 APXS2_INCLUDE="$APXS2_PREFIX/include"
519 AC_MSG_ERROR([can't find Apache-2 include files beneath $APXS2_PREFIX])
521 elif ! test -f "$APXS2_INCLUDE/httpd.h"; then
522 AC_MSG_ERROR([APXS2_INCLUDE of $APXS2_INCLUDE does not contain Apache-2 headers])
524 AC_MSG_NOTICE([APXS2_INCLUDE is $APXS2_INCLUDE])
526 if test -z "$APXS2_LIBEXEC"; then
527 if test -d "$APXS2_PREFIX/libexec"; then
528 APXS2_LIBEXEC="$APXS2_PREFIX/libexec"
529 elif test -d "$APXS2_PREFIX/modules"; then
530 APXS2_LIBEXEC="$APXS2_PREFIX/modules"
532 AC_MSG_ERROR([can't find Apache-2 libexec/module directory beneath $APXS2_PREFIX])
534 elif ! test -d "$APXS2_LIBEXEC"; then
535 AC_MSG_ERROR([APXS2_LIBEXEC of $APXS2_LIBEXEC does not exist])
537 AC_MSG_NOTICE([APXS2_LIBEXEC is $APXS2_LIBEXEC])
539 if test -z "$APXS2_SYSCONFDIR"; then
540 if test -d "$APXS2_PREFIX/conf"; then
541 APXS2_SYSCONFDIR="$APXS2_PREFIX/conf"
543 AC_MSG_ERROR([can't find Apache-2 conf directory beneath $APXS2_PREFIX])
545 elif ! test -d "$APXS2_SYSCONFDIR"; then
546 AC_MSG_ERROR([APXS2_SYSCONFDIR of $APXS2_SYSCONFDIR does not exist])
548 AC_MSG_NOTICE([APXS2_SYSCONFDIR is $APXS2_SYSCONFDIR])
552 elif test -n "$APXS2"; then
555 AC_PATH_PROG(APR_CONFIG,apr-config)
557 AC_HELP_STRING([--with-apr=PATH], [where APR is installed]),
558 [APR_CONFIG="${with_apr}/bin/apr-config"])
559 if test -f "${APR_CONFIG}"; then
560 APR_CFLAGS="`${APR_CONFIG} --cflags` `${APR_CONFIG} --cppflags` `${APR_CONFIG} --includes`"
563 # extract settings we need from APXS2 -q
564 APXS2_CC="`$APXS2 -q CC`"
565 APXS2_CFLAGS="`$APXS2 -q CFLAGS` `$APXS2 -q CFLAGS_SHLIB` $APR_CFLAGS"
566 APXS2_INCLUDE="`$APXS2 -q INCLUDEDIR`"
567 APXS2_LIBEXEC="`$APXS2 -q LIBEXECDIR`"
568 APXS2_SYSCONFDIR="`$APXS2 -q SYSCONFDIR`"
571 AC_MSG_RESULT(found at $APXS2)
573 if test -z "`$APXS2 -q LD_SHLIB`" && test -z "`$APXS2 -q LIBEXECDIR`" \
574 || test "$APXS2_LIBEXEC" = "modules"; then
576 [Your APXS installation is broken and cannot be used.
577 Please see http://www.webdav.org/mod_dav/install.html#apxs for
584 # guess we're not doing Apache 2.0
590 AC_SUBST(APXS2_CFLAGS)
591 AC_SUBST(APXS2_INCLUDE)
592 AC_SUBST(APXS2_LIBEXEC)
593 AC_SUBST(APXS2_SYSCONFDIR)
594 AM_CONDITIONAL(HAVE_APXS2,test -n "$APXS2")
596 # always output the Makefile, even if you don't use it
597 AC_CONFIG_FILES([apache/Makefile])
598 AM_CONDITIONAL(BUILD_AP13,test "$WANT_APACHE_13" = "yes")
599 AM_CONDITIONAL(BUILD_AP20,test "$WANT_APACHE_20" = "yes")
601 # add the apache module to the list of wanted subdirs..
602 if test "$WANT_APACHE_13" = "yes" || test "$WANT_APACHE_20" = "yes" ; then
603 WANT_SUBDIRS="$WANT_SUBDIRS apache"
608 # Implement the checks of the MySQL Credential Cache
610 # 1) Assume the user wants MySQL; if it's not found then just continue without
611 # 2) If the user specifically requested Mysql, look for it and ERROR if not found
612 # 3) If the user specifically requested no-mysql, don't build it.
615 AC_CONFIG_FILES([shib-mysql-ccache/Makefile])
617 # determine whether we should enable the mysql ccache
618 AC_ARG_ENABLE([mysql],
619 AC_HELP_STRING([--disable-mysql], [disable the MySQL Credential Cache]),
620 [mysql_enabled=$enableval], [mysql_enabled=default])
622 if test "x$mysql_enabled" = "x" ; then
626 # Are we trying to build MySQL?
627 AC_MSG_CHECKING(whether to build the MySQL ccache)
628 if test "$mysql_enabled" = "yes" ; then
631 elif test "$mysql_enabled" = "default" ; then
633 AC_MSG_RESULT([yes, if it can be found])
639 # If we're trying to build MySQL, try to find the mysql_config program,
640 # verify we've got mysql >= 4, and make sure we can build with mysqld
641 if test "$build_mysql" = "yes" ; then
644 AC_HELP_STRING([--with-mysql=PATH], [directory where mysql is installed]),
645 [if test "$with_mysql" = no ; then
646 AC_MSG_ERROR([Try running --disable-mysql instead.])
647 elif test "$with_mysql" != yes ; then
648 mysql_dir="$with_mysql/bin"
651 # Try to find the mysql_config program
652 AC_PATH_PROG(MYSQL_CONFIG, mysql_config, no, $mysql_dir $PATH )
654 if test "$MYSQL_CONFIG" = no ; then
655 if test "$mysql_enabled" = "yes" ; then
656 AC_MSG_ERROR(Cannot find mysql_config)
658 AC_MSG_WARN(MySQL not found. skipping.)
663 # if we found mysql_config then build_mysql is 'yes'
664 if test "$MYSQL_CONFIG" != no ; then
665 AC_MSG_CHECKING(for mysql version >= 4)
666 mysql_version=`$MYSQL_CONFIG --version`
667 mysql_major_version=`echo $mysql_version | awk -F. '{print $1}'`
669 if test $mysql_major_version -lt 4 ; then
671 if test "$mysql_enabled" = "yes" ; then
672 AC_MSG_ERROR(You need MySQL version >= 4, found $mysql_version)
674 AC_MSG_RESULT(no.. skipping MySQL)
680 # if mysql_version_ok is 'yes', then we've made it this far.. ;)
681 if test "$mysql_version_ok" = "yes" ; then
682 AC_MSG_CHECKING(for embedded-MySQL libraries)
683 MYSQL_LIBS=`$MYSQL_CONFIG --libmysqld-libs`
684 if test $? != 0 ; then
686 if test "$mysql_enabled" = "yes" ; then
687 AC_MSG_ERROR(Could not find the MySQL Embedded-server libraries.)
689 AC_MSG_RESULT(no.. skipping MySQL)
697 # if found_mysql=yes then test that we can actually build mysql
698 if test "$found_mysql" = yes ; then
699 MYSQL_CFLAGS=`$MYSQL_CONFIG --cflags`
700 MYSQL_CFLAGS=`eval echo $MYSQL_CFLAGS`
701 MYSQL_LIBS=`eval echo $MYSQL_LIBS`
703 save_CPPFLAGS="$CPPFLAGS"
704 CPPFLAGS="$CPPFLAGS $MYSQL_CFLAGS"
706 AC_CHECK_HEADER([mysql.h], [have_mysql_h=yes], [have_mysql_h=no])
707 if test "$have_mysql_h" = no -a "$mysql_enabled" = "yes" ; then
708 AC_MSG_ERROR(unable to find MySQL header files)
711 if test "$have_mysql_h" = yes ; then
713 LIBS="$LIBS $MYSQL_LIBS"
714 AC_MSG_CHECKING(if we can link againt mysql)
718 [mysql_server_init(0, NULL, NULL)],
719 [have_mysql_libs=yes],
720 [have_mysql_libs=no])
723 if test "$have_mysql_libs" = no ; then
724 if test "$mysql_enabled" = "yes" ; then
725 AC_MSG_ERROR([unable to link with MySQL Embedded Server Library])
727 AC_MSG_RESULT(no. skipping MySQL)
732 CPPFLAGS="$save_CPPFLAGS"
735 # if have_mysql_libs=yes then go ahead with building MySQL
736 if test "$have_mysql_libs" = yes ; then
737 # this AC_MSG_RESULT is from above!
739 WANT_SUBDIRS="$WANT_SUBDIRS shib-mysql-ccache"
740 AC_SUBST(MYSQL_CFLAGS)
745 AC_SUBST(WANT_SUBDIRS)
747 if test -n "$APXS_CC" && test "$APXS_CC" != "$CC" ; then
748 echo "=================================================================="
749 echo "WARNING: You have chosen to compile Apache-1.3 modules with a different"
750 echo " compiler than the one used to compile Apache."
752 echo " Current compiler: $CC"
753 echo " Apache's compiler: $APXS_CC"
755 echo "This could cause some problems."
756 echo "=================================================================="
759 if test -n "$APXS2_CC" && test "$APXS2_CC" != "$CC" ; then
760 echo "=================================================================="
761 echo "WARNING: You have chosen to compile Apache-2 modules with a different"
762 echo " compiler than the one used to compile Apache."
764 echo " Current compiler: $CC"
765 echo " Apache's compiler: $APXS2_CC"
767 echo "This could cause some problems."
768 echo "=================================================================="