2 AC_INIT([shibboleth], [1.3.1], [shibboleth-users@internet2.edu], [shibboleth])
3 AM_CONFIG_HEADER(config.h)
4 AM_INIT_AUTOMAKE([shibboleth],[1.3.1])
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 -Wall -g -D_DEBUG"
16 GCC_CXXFLAGS="$CXXFLAGS -Wall -g -D_DEBUG"
18 GCC_CFLAGS="$CFLAGS -Wall -O2 -DNDEBUG"
19 GCC_CXXFLAGS="$CXXFLAGS -Wall -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 ctime_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]))
157 # log4shib settings (favor this version over the log4cpp code)
158 AC_PATH_PROG(LOG4SHIB_CONFIG,log4shib-config)
159 AC_ARG_WITH(log4shib,
160 AC_HELP_STRING([--with-log4shib=PATH], [where log4shib-config is installed]),
162 LOG4SHIB_CONFIG="${with_log4shib}"
163 if ! test -f "${LOG4SHIB_CONFIG}" ; then
164 LOG4SHIB_CONFIG="${with_log4shib}/bin/log4shib-config"
167 if test -f "${LOG4SHIB_CONFIG}"; then
168 LDFLAGS="`${LOG4SHIB_CONFIG} --libs` $LDFLAGS"
169 CPPFLAGS="`${LOG4SHIB_CONFIG} --cflags` $CPPFLAGS"
170 AC_CHECK_HEADER([log4shib/CategoryStream.hh],,AC_MSG_ERROR([unable to find log4shib header files]))
172 [#include <log4shib/Category.hh> #include <log4shib/CategoryStream.hh>],
173 [log4shib::Category::getInstance("foo").errorStream() << log4shib::eol],
174 [AC_DEFINE(HAVE_LOG4SHIB,1,[Define if log4shib library is used.])],
175 [AC_MSG_ERROR([unable to link with log4shib])])
177 AC_MSG_WARN([log4shib-config not found, may need to use --with-log4shib option])
178 AC_MSG_WARN([will look for original log4cpp library])
181 AC_PATH_PROG(LOG4CPP_CONFIG,log4cpp-config)
183 AC_HELP_STRING([--with-log4cpp=PATH], [where log4cpp-config is installed]),
185 LOG4CPP_CONFIG="${with_log4cpp}"
186 if ! test -f "${LOG4CPP_CONFIG}" ; then
187 LOG4CPP_CONFIG="${with_log4cpp}/bin/log4cpp-config"
190 if test -f "${LOG4CPP_CONFIG}"; then
191 AC_MSG_WARN([will try to use log4cpp, note that most non-Internet2 supplied versions are not thread-safe])
192 LDFLAGS="`${LOG4CPP_CONFIG} --libs` $LDFLAGS"
193 CPPFLAGS="`${LOG4CPP_CONFIG} --cflags` $CPPFLAGS"
194 AC_CHECK_HEADER([log4cpp/CategoryStream.hh],,AC_MSG_ERROR([unable to find log4cpp header files]))
196 [#include <log4cpp/Category.hh> #include <log4cpp/CategoryStream.hh>],
197 [log4cpp::Category::getInstance("foo").errorStream() << log4cpp::eol],
198 [AC_DEFINE(HAVE_LOG4CPP,1,[Define if log4cpp library is used.])],
199 [AC_MSG_ERROR([unable to link with log4cpp, at least version 1.0 needed])])
201 AC_MSG_ERROR([log4cpp-config not found, may need to use --with-log4cpp option])
207 AC_HELP_STRING([--with-xerces=PATH], [where xerces-c is installed]),
208 [if test x_$with_xerces != x_/usr; then
209 LDFLAGS="-L${with_xerces}/lib $LDFLAGS"
210 CPPFLAGS="-I${with_xerces}/include $CPPFLAGS"
212 LIBS="-lxerces-c $LIBS"
213 AC_CHECK_HEADER([xercesc/dom/DOM.hpp],,
214 AC_MSG_ERROR([unable to find xerces header files]))
215 AC_MSG_CHECKING([Xerces version])
217 [AC_LANG_PROGRAM([#include <xercesc/util/XercesVersion.hpp>],
218 [#if _XERCES_VERSION > 20200 && _XERCES_VERSION != 20600
221 #error requires version > 2.2.0 but not 2.6.0
224 [AC_MSG_ERROR([Shibboleth requires patched Xerces version 2.6.1 (http://shibboleth.internet2.edu/downloads/)])])
226 [#include <xercesc/util/PlatformUtils.hpp>],
227 [xercesc::XMLPlatformUtils::Initialize()],
228 [AC_DEFINE(HAVE_LIBXERCESC,1,[Define if Xerces-C library was found])],
229 [AC_MSG_ERROR([unable to link with Xerces])])
232 # XML-Security settings
234 AC_HELP_STRING([--with-xmlsec=PATH], [where xmlsec is installed]),
235 [if test x_$with_xmlsec != x_/usr; then
236 LDFLAGS="-L${with_xmlsec}/lib $LDFLAGS"
237 CPPFLAGS="-I${with_xmlsec}/include $CPPFLAGS"
239 LIBS="-lxml-security-c $LIBS"
240 AC_CHECK_HEADER([xsec/xenc/XENCEncryptionMethod.hpp],,AC_MSG_ERROR([unable to find xml-security header files]),[#include <xercesc/dom/DOM.hpp>])
241 AC_MSG_CHECKING([XML-Security version])
243 [AC_LANG_PROGRAM([#include <xsec/utils/XSECPlatformUtils.hpp>],
244 [#if XSEC_VERSION_MAJOR > 1 || (XSEC_VERSION_MAJOR == 1 && XSEC_VERSION_MEDIUM > 2)
247 #error need version 1.3.0 or later
250 [AC_MSG_FAILURE([XML-Security version 1.3.0 or greater is required.])])
252 [#include <xsec/utils/XSECPlatformUtils.hpp>],
253 [XSECPlatformUtils::Initialise()],
254 [AC_DEFINE(HAVE_LIBXSEC,1,[Define if XML-Sec library was found])],
255 [AC_MSG_ERROR([unable to link with xml-security])])
259 AC_HELP_STRING([--with-saml=PATH], [where saml is installed]),
260 [if test x_$with_saml != x_/usr; then
261 LDFLAGS="-L${with_saml}/lib $LDFLAGS"
262 CPPFLAGS="-I${with_saml}/include $CPPFLAGS"
264 AC_CHECK_HEADER([saml/saml.h],,
265 AC_MSG_ERROR([unable to find saml header files]))
268 [#include <saml/saml.h>
269 #include <saml/version.h>],
270 [#if _OPENSAML_VERSION >= 10100
271 saml::SAMLConfig::getConfig();
273 #error Need OpenSAML version 1.1 or higher
275 [AC_DEFINE(HAVE_SAML,1,[Define if saml library was found])],
276 [AC_MSG_ERROR([unable to link with saml, or version too old])])
278 # output the underlying makefiles
279 WANT_SUBDIRS="doc shib schemas configs shib-target shar siterefresh test xmlproviders adfs"
280 AC_CONFIG_FILES([Makefile doc/Makefile shib/Makefile schemas/Makefile \
281 configs/Makefile oncrpc/Makefile oncrpc/rpc/Makefile \
282 shib-target/Makefile shar/Makefile siterefresh/Makefile \
283 test/Makefile xmlproviders/Makefile adfs/Makefile selinux/Makefile])
286 # now deal with the rpc library, to see if we need to build our own
287 if test $NATIVE_RPC = "no"; then
288 WANT_SUBDIRS="oncrpc $WANT_SUBDIRS"
289 AC_DEFINE(USE_OUR_ONCRPC,1,[Define if using embedded version of ONC RPC.])
291 AM_CONDITIONAL(USE_OUR_ONCRPC,test "$NATIVE_RPC" = "no")
294 # Build NSAPI module?
296 AC_MSG_CHECKING(for NSAPI module option)
298 AC_HELP_STRING([--with-nsapi=DIR], [Build NSAPI module for Netscape/iPlanet/SunONE]),
299 [WANT_NSAPI=$withval],[WANT_NSAPI=no])
300 AC_MSG_RESULT($WANT_NSAPI)
302 if test "$WANT_NSAPI" != "no"; then
303 if test ! -d $WANT_NSAPI/bin ; then
304 AC_MSG_ERROR(Please specify the path to the root of your Netscape/iPlanet/SunONE server using --with-nsapi=DIR)
306 AC_MSG_CHECKING(for NSAPI include files)
307 if test -d $WANT_NSAPI/include ; then
308 NSAPI_INCLUDE=$WANT_NSAPI/include
309 AC_MSG_RESULT(Netscape-Enterprise 3.x style)
310 AC_CHECK_HEADERS([$NSAPI_INCLUDE/nsapi.h])
311 NSAPI_INCLUDE="$NSAPI_INC_DIR -I$NSAPI_INCLUDE"
313 if test -d $WANT_NSAPI/plugins/include ; then
314 test -n "$NSAPI_INCLUDE" && NSAPI_INC_DIR="-I$NSAPI_INCLUDE"
315 NSAPI_INCLUDE="$WANT_NSAPI/plugins/include"
316 AC_MSG_RESULT(iPlanet 4.x / SunONE 6.x style)
317 AC_CHECK_HEADERS([$NSAPI_INCLUDE/nsapi.h])
318 NSAPI_INCLUDE="$NSAPI_INC_DIR -I$NSAPI_INCLUDE"
320 if test "$NSAPI_INCLUDE" = ""; then
321 AC_MSG_ERROR(Please check you have nsapi.h in either $WANT_NSAPI/include or $WANT_NSAPI/plugins/include)
325 AC_SUBST(NSAPI_INCLUDE)
327 # always output the Makefile, even if you don't use it
328 AC_CONFIG_FILES([nsapi_shib/Makefile])
329 AM_CONDITIONAL(BUILD_NSAPI,test ! "$WANT_NSAPI" = "no")
331 # add the NSAPI module to the list of wanted subdirs..
332 if test ! "$WANT_NSAPI" = "no" ; then
333 WANT_SUBDIRS="$WANT_SUBDIRS nsapi_shib"
338 # Build FastCGI support?
340 AC_MSG_CHECKING(for FastCGI support)
342 AC_HELP_STRING([--with-fastcgi=DIR], [Build FastCGI support]),
343 [WANT_FASTCGI=$withval],[WANT_FASTCGI=no])
344 AC_MSG_RESULT($WANT_FASTCGI)
346 if test "$WANT_FASTCGI" != "no"; then
347 if test "$WANT_FASTCGI" != "yes"; then
348 if test x_$WANT_FASTCGI != x_/usr; then
349 FASTCGI_INCLUDE="-I$WANT_FASTCGI/include"
350 FASTCGI_LDFLAGS="-L$WANT_FASTCGI/lib"
353 AC_CHECK_HEADER([fcgio.h],,
354 AC_MSG_ERROR([unable to find FastCGI header files]))
355 FASTCGI_LIBS="-lfcgi -lfcgi++"
358 AC_SUBST(FASTCGI_INCLUDE)
359 AC_SUBST(FASTCGI_LDFLAGS)
360 AC_SUBST(FASTCGI_LIBS)
362 # always output the Makefile, even if you don't use it
363 AC_CONFIG_FILES([fastcgi/Makefile])
364 AM_CONDITIONAL(BUILD_FASTCGI,test ! "$WANT_FASTCGI" = "no")
365 if test ! "$WANT_FASTCGI" = "no" ; then
366 WANT_SUBDIRS="$WANT_SUBDIRS fastcgi"
371 # If no --enable-apache-xx specified
372 # find a default and fake the specific parameters
375 # simple macro to peek at an enable or a with
377 if test "[${[$1]_][$2]+set}" = set; then
378 peekval="${[$1]_[$2]}"
383 AC_MSG_CHECKING(if default apache needed)
385 Peek(enable,apache_13,need_default=no)
386 Peek(enable,apache_20,need_default=no)
387 Peek(enable,apache_22,need_default=no)
388 AC_MSG_RESULT($need_default)
390 if test "$need_default" = "yes"; then
391 # find an apxs, then the httpd
393 Peek(with,apxs,xs="$peekval")
394 Peek(with,apxs2,xs="$peekval")
395 Peek(with,apxs22,xs="$peekval")
396 if test "x$xs" = "x"; then
397 AC_PATH_PROGS(xs, apxs2 apxs,
398 AC_MSG_ERROR(No apxs, no apache found. Try --with-apxs),
399 [/usr/local/apache2/bin:/usr/local/apache/bin:/usr/sbin:$PATH])
401 # ask the daemon for the version and set parameters
402 AC_MSG_CHECKING(default apache version)
403 httpd="`$xs -q SBINDIR`/`$xs -q TARGET`"
404 if test "x$httpd" != "x" && test -f $httpd ; then
405 v=`$httpd -v|$SED -n -e 's/.*Apache\/\.*//p'`
407 1.3*) [enable_apache_13]=yes
411 2.0*) [enable_apache_20]=yes
415 2.2*) [enable_apache_22]=yes
419 *) AC_MSG_ERROR(unusable apache versions: $v. Try setting --with-apxs)
422 AC_MSG_RESULT(cannot determine version. Try setting --with-apxs)
427 # Apache 1.3 (mod_shib_13)
429 # --with-apxs (DSO build, the normal way, uses apxs to derive build flags)
431 AC_ARG_ENABLE(apache-13,
432 AC_HELP_STRING([--enable-apache-13], [enable the Apache 1.3 module]),
433 [ if test "x$enableval" = "x" ; then
436 WANT_APACHE_13="$enableval"
438 ],[ WANT_APACHE_13=no ])
439 AC_MSG_CHECKING(whether to build Apache 1.3 module)
440 if test "$WANT_APACHE_13" != yes && test "$WANT_APACHE_13" != no ; then
443 AC_MSG_RESULT($WANT_APACHE_13)
445 if test "$WANT_APACHE_13" = "yes" ; then
447 AC_HELP_STRING([--with-apxs=FILE], [Specifies where to find the Apache 1.3 apxs script.]),
449 AC_MSG_CHECKING(for user-specified apxs name/location)
450 if test "$withval" != "no" ; then
451 if test "$withval" != "yes"; then
453 AC_MSG_RESULT("$withval")
458 AC_PATH_PROG(APXS, apxs, no)
459 if test "$APXS" = "no" ; then
460 for i in /usr/sbin /usr/local/apache/bin ; do
461 if test "$APXS" = "no" && test -f "$i/apxs"; then
468 AC_MSG_CHECKING([to see if apxs was located])
469 if test ! -f "$APXS" ; then
471 AC_MSG_ERROR([Unable to locate apxs script. An Apache development package may be missing from your server, or you may need to use the --with-apxs option.])
476 # extract settings we need from APXS -q
477 APXS_CC="`$APXS -q CC`"
478 APXS_CFLAGS="`$APXS -q CPPFLAGS` `$APXS -q CFLAGS` `$APXS -q CFLAGS_SHLIB`"
479 APXS_INCLUDE="`$APXS -q INCLUDEDIR`"
482 AC_SUBST(APXS_CFLAGS)
483 AC_SUBST(APXS_INCLUDE)
486 # Apache 2.0 (mod_shib_20)
488 # --with-apxs2 (DSO build, the normal way, uses apxs to derive build flags)
489 # --with-apr (DSO build, APR development package installed separately)
491 AC_ARG_ENABLE(apache-20,
492 AC_HELP_STRING([--enable-apache-20], [enable the Apache 2.0 module]),
493 [ if test "x$enableval" = "x" ; then
496 WANT_APACHE_20="$enableval"
498 ],[ WANT_APACHE_20=no ])
499 AC_MSG_CHECKING(whether to build Apache 2.0 module)
500 if test "$WANT_APACHE_20" != yes && test "$WANT_APACHE_20" != no ; then
503 AC_MSG_RESULT($WANT_APACHE_20)
505 if test "$WANT_APACHE_20" = "yes" ; then
507 AC_HELP_STRING([--with-apxs2=FILE], [Specifies where to find the Apache 2.0 apxs script.]),
509 AC_MSG_CHECKING(for user-specified Apache2 apxs name/location)
510 if test "$withval" != "no" ; then
511 if test "$withval" != "yes"; then
513 AC_MSG_RESULT("$withval")
518 AC_PATH_PROG(APXS2, apxs2, no)
519 if test "$APXS2" = "no" ; then
520 AC_PATH_PROG(APXS2, apxs, no)
522 if test "$APXS2" = "no" ; then
523 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
524 if test "$APXS2" = "no" && test -f "$i/apxs2" ; then
528 if test "$APXS2" = "no" ; then
529 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
530 if test "$APXS2" = "no" && test -f "$i/apxs" ; then
538 AC_MSG_CHECKING([to see if Apache2 apxs was located])
539 if test ! -f "$APXS2" ; then
541 AC_MSG_ERROR([Unable to locate Apache2 apxs script. An Apache development package may be missing from your server, or you may need to use the --with-apxs2 option.])
543 AC_MSG_RESULT($APXS2)
548 AC_HELP_STRING([--with-apr=PATH], [where apr-config is installed]),
550 AC_MSG_CHECKING(for user-specified apr-config name/location)
551 if test "$withval" != "no" ; then
552 if test "$withval" != "yes"; then
554 AC_MSG_RESULT("$withval")
559 AC_PATH_PROG(APR_CONFIG, apr-config,,[`$APXS2 -q SBINDIR`]:[$PATH])
561 if test -f "${APR_CONFIG}"; then
562 APR_CFLAGS="`${APR_CONFIG} --cflags` `${APR_CONFIG} --cppflags` `${APR_CONFIG} --includes`"
564 AC_MSG_ERROR([Unable to locate apr-config, may need --with-apr option.])
567 # extract settings we need from APXS2 -q
568 APXS2_CC="`$APXS2 -q CC`"
569 APXS2_CFLAGS="`$APXS2 -q CPPFLAGS` `$APXS2 -q CFLAGS` `$APXS2 -q CFLAGS_SHLIB` $APR_CFLAGS"
570 APXS2_INCLUDE="`$APXS2 -q INCLUDEDIR`"
573 AC_SUBST(APXS2_CFLAGS)
574 AC_SUBST(APXS2_INCLUDE)
577 # Apache 2.2 (mod_shib_22)
579 # --with-apxs22 (DSO build, the normal way, uses apxs to derive build flags)
580 # --with-apr1 (DSO build, APR development package installed separately)
582 AC_ARG_ENABLE(apache-22,
583 AC_HELP_STRING([--enable-apache-22], [enable the Apache 2.2 module]),
584 [ if test "x$enableval" = "x" ; then
587 WANT_APACHE_22="$enableval"
589 ],[ WANT_APACHE_22=no ])
590 AC_MSG_CHECKING(whether to build Apache 2.2 module)
591 if test "$WANT_APACHE_22" != yes && test "$WANT_APACHE_22" != no ; then
594 AC_MSG_RESULT($WANT_APACHE_22)
596 if test "$WANT_APACHE_22" = "yes" ; then
598 AC_HELP_STRING([--with-apxs22=FILE], [Specifies where to find the Apache 2.2 apxs script.]),
600 AC_MSG_CHECKING(for user-specified Apache2.2 apxs name/location)
601 if test "$withval" != "no" ; then
602 if test "$withval" != "yes"; then
604 AC_MSG_RESULT("$withval")
609 AC_PATH_PROG(APXS22, apxs2, no)
610 if test "$APXS22" = "no" ; then
611 AC_PATH_PROG(APXS22, apxs, no)
613 if test "$APXS22" = "no" ; then
614 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
615 if test "$APXS22" = "no" && test -f "$i/apxs2" ; then
619 if test "$APXS22" = "no" ; then
620 for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
621 if test "$APXS22" = "no" && test -f "$i/apxs" ; then
629 AC_MSG_CHECKING([to see if Apache2.2 apxs was located])
630 if test ! -f "$APXS22" ; then
632 AC_MSG_ERROR([Unable to locate Apache2.2 apxs script. An Apache development package may be missing from your server, or you may need to use the --with-apxs22 option.])
634 AC_MSG_RESULT($APXS22)
639 AC_HELP_STRING([--with-apr1=PATH], [where apr-1-config is installed]),
641 AC_MSG_CHECKING(for user-specified apr-1-config name/location)
642 if test "$withval" != "no" ; then
643 if test "$withval" != "yes"; then
645 AC_MSG_RESULT("$withval")
650 AC_PATH_PROG(APR1_CONFIG, apr-1-config,,[`$APXS22 -q SBINDIR`]:[$PATH])
652 if test -f "${APR1_CONFIG}"; then
653 APR1_CFLAGS="`${APR1_CONFIG} --cflags` `${APR1_CONFIG} --cppflags` `${APR1_CONFIG} --includes`"
655 AC_MSG_ERROR([Unable to locate apr-1-config, may need --with-apr1 option.])
658 # extract settings we need from APXS22 -q
659 APXS22_CC="`$APXS22 -q CC`"
660 APXS22_CFLAGS="`$APXS22 -q CPPFLAGS` `$APXS22 -q CFLAGS` `$APXS22 -q CFLAGS_SHLIB` $APR1_CFLAGS"
661 APXS22_INCLUDE="`$APXS22 -q INCLUDEDIR`"
664 AC_SUBST(APXS22_CFLAGS)
665 AC_SUBST(APXS22_INCLUDE)
667 # always output the Makefile, even if you don't use it
668 AC_CONFIG_FILES([apache/Makefile])
669 AM_CONDITIONAL(BUILD_AP13,test "$WANT_APACHE_13" = "yes")
670 AM_CONDITIONAL(BUILD_AP20,test "$WANT_APACHE_20" = "yes")
671 AM_CONDITIONAL(BUILD_AP22,test "$WANT_APACHE_22" = "yes")
673 # add the apache module to the list of wanted subdirs..
674 if test "$WANT_APACHE_13" = "yes" || test "$WANT_APACHE_20" = "yes" || test "$WANT_APACHE_22" = "yes" ; then
675 WANT_SUBDIRS="$WANT_SUBDIRS apache"
680 # Implement the checks of the MySQL Credential Cache
682 # 1) Assume the user wants MySQL; if it's not found then just continue without
683 # 2) If the user specifically requested Mysql, look for it and ERROR if not found
684 # 3) If the user specifically requested no-mysql, don't build it.
687 AC_CONFIG_FILES([shib-mysql-ccache/Makefile])
689 # determine whether we should enable the mysql ccache
690 AC_ARG_ENABLE([mysql],
691 AC_HELP_STRING([--disable-mysql], [disable the MySQL Credential Cache]),
692 [mysql_enabled=$enableval], [mysql_enabled=default])
694 if test "x$mysql_enabled" = "x" ; then
698 # Are we trying to build MySQL?
699 AC_MSG_CHECKING(whether to build the MySQL ccache)
700 if test "$mysql_enabled" = "yes" ; then
703 elif test "$mysql_enabled" = "default" ; then
705 AC_MSG_RESULT([yes, if it can be found])
711 # If we're trying to build MySQL, try to find the mysql_config program,
712 # verify we've got mysql >= 4, and make sure we can build with mysqld
713 if test "$build_mysql" = "yes" ; then
716 AC_HELP_STRING([--with-mysql=PATH], [directory where mysql is installed]),
717 [if test "$with_mysql" = no ; then
718 AC_MSG_ERROR([Try running --disable-mysql instead.])
719 elif test "$with_mysql" != yes ; then
720 mysql_dir="$with_mysql/bin"
723 # Try to find the mysql_config program
724 AC_PATH_PROG(MYSQL_CONFIG, mysql_config, no, $mysql_dir $PATH )
726 if test "$MYSQL_CONFIG" = no ; then
727 if test "$mysql_enabled" = "yes" ; then
728 AC_MSG_ERROR(Cannot find mysql_config)
730 AC_MSG_WARN(MySQL not found. skipping.)
735 # if we found mysql_config then build_mysql is 'yes'
736 if test "$MYSQL_CONFIG" != no ; then
737 AC_MSG_CHECKING(for mysql version >= 4)
738 mysql_version=`$MYSQL_CONFIG --version`
739 mysql_major_version=`echo $mysql_version | awk -F. '{print $1}'`
741 if test $mysql_major_version -lt 4 ; then
743 if test "$mysql_enabled" = "yes" ; then
744 AC_MSG_ERROR(You need MySQL version >= 4, found $mysql_version)
746 AC_MSG_RESULT(no.. skipping MySQL)
752 # if mysql_version_ok is 'yes', then we've made it this far.. ;)
753 if test "$mysql_version_ok" = "yes" ; then
754 AC_MSG_CHECKING(for embedded-MySQL libraries)
755 MYSQL_LIBS=`$MYSQL_CONFIG --libmysqld-libs`
756 if test $? != 0 ; then
758 if test "$mysql_enabled" = "yes" ; then
759 AC_MSG_ERROR(Could not find the MySQL Embedded-server libraries.)
761 AC_MSG_RESULT(no.. skipping MySQL)
769 # if found_mysql=yes then test that we can actually build mysql
770 if test "$found_mysql" = yes ; then
771 MYSQL_CFLAGS=`$MYSQL_CONFIG --cflags`
772 MYSQL_CFLAGS=`eval echo $MYSQL_CFLAGS`
773 MYSQL_LIBS=`eval echo $MYSQL_LIBS`
775 save_CPPFLAGS="$CPPFLAGS"
776 CPPFLAGS="$CPPFLAGS $MYSQL_CFLAGS"
778 AC_CHECK_HEADER([mysql.h], [have_mysql_h=yes], [have_mysql_h=no])
779 if test "$have_mysql_h" = no -a "$mysql_enabled" = "yes" ; then
780 AC_MSG_ERROR(unable to find MySQL header files)
783 if test "$have_mysql_h" = yes ; then
785 LIBS="$LIBS $MYSQL_LIBS"
786 AC_MSG_CHECKING(if we can link againt mysql)
790 [mysql_server_init(0, NULL, NULL)],
791 [have_mysql_libs=yes],
792 [have_mysql_libs=no])
795 if test "$have_mysql_libs" = no ; then
796 if test "$mysql_enabled" = "yes" ; then
797 AC_MSG_ERROR([unable to link with MySQL Embedded Server Library])
799 AC_MSG_RESULT(no. skipping MySQL)
804 CPPFLAGS="$save_CPPFLAGS"
807 # if have_mysql_libs=yes then go ahead with building MySQL
808 if test "$have_mysql_libs" = yes ; then
809 # this AC_MSG_RESULT is from above!
811 WANT_SUBDIRS="$WANT_SUBDIRS shib-mysql-ccache"
812 AC_SUBST(MYSQL_CFLAGS)
817 AC_SUBST(WANT_SUBDIRS)
819 if test -n "$APXS_CC" && test "$APXS_CC" != "$CC" ; then
820 echo "=================================================================="
821 echo "WARNING: You have chosen to compile Apache-1.3 modules with a different"
822 echo " compiler than the one used to compile Apache."
824 echo " Current compiler: $CC"
825 echo " Apache's compiler: $APXS_CC"
827 echo "This could cause problems."
828 echo "=================================================================="
831 if test -n "$APXS2_CC" && test "$APXS2_CC" != "$CC" ; then
832 echo "=================================================================="
833 echo "WARNING: You have chosen to compile Apache-2 modules with a different"
834 echo " compiler than the one used to compile Apache."
836 echo " Current compiler: $CC"
837 echo " Apache's compiler: $APXS2_CC"
839 echo "This could cause problems."
840 echo "=================================================================="
843 LIBTOOL="$LIBTOOL --silent"