2 dnl APACHE_HELP_STRING(LHS, RHS)
3 dnl Autoconf 2.50 can not handle substr correctly. It does have
4 dnl AC_HELP_STRING, so let's try to call it if we can.
5 dnl Note: this define must be on one line so that it can be properly returned
6 dnl as the help string.
7 AC_DEFUN(APACHE_HELP_STRING,[ifelse(regexp(AC_ACVERSION, 2\.1), -1, AC_HELP_STRING($1,$2),[ ]$1 substr([ ],len($1))$2)])dnl
9 dnl APACHE_SUBST(VARIABLE)
10 dnl Makes VARIABLE available in generated files
11 dnl (do not use @variable@ in Makefiles, but $(variable))
12 AC_DEFUN(APACHE_SUBST,[
13 APACHE_VAR_SUBST="$APACHE_VAR_SUBST $1"
17 dnl APACHE_FAST_OUTPUT(FILENAME)
18 dnl Perform substitutions on FILENAME (Makefiles only)
19 AC_DEFUN(APACHE_FAST_OUTPUT,[
20 APACHE_FAST_OUTPUT_FILES="$APACHE_FAST_OUTPUT_FILES $1"
23 dnl APACHE_GEN_CONFIG_VARS
24 dnl Creates config_vars.mk
25 AC_DEFUN(APACHE_GEN_CONFIG_VARS,[
26 APACHE_SUBST(abs_srcdir)
30 APACHE_SUBST(logfiledir)
31 APACHE_SUBST(exec_prefix)
33 APACHE_SUBST(localstatedir)
36 APACHE_SUBST(libexecdir)
37 APACHE_SUBST(htdocsdir)
38 APACHE_SUBST(manualdir)
39 APACHE_SUBST(includedir)
40 APACHE_SUBST(errordir)
41 APACHE_SUBST(iconsdir)
42 APACHE_SUBST(sysconfdir)
43 APACHE_SUBST(installbuilddir)
44 APACHE_SUBST(runtimedir)
45 APACHE_SUBST(proxycachedir)
46 APACHE_SUBST(other_targets)
47 APACHE_SUBST(progname)
53 APACHE_SUBST(CPPFLAGS)
55 APACHE_SUBST(CXXFLAGS)
58 APACHE_SUBST(LT_LDFLAGS)
59 APACHE_SUBST(SH_LDFLAGS)
60 APACHE_SUBST(HTTPD_LDFLAGS)
61 APACHE_SUBST(UTIL_LDFLAGS)
64 APACHE_SUBST(INCLUDES)
65 APACHE_SUBST(NOTEST_CPPFLAGS)
66 APACHE_SUBST(NOTEST_CFLAGS)
67 APACHE_SUBST(NOTEST_CXXFLAGS)
68 APACHE_SUBST(NOTEST_LDFLAGS)
69 APACHE_SUBST(NOTEST_LIBS)
70 APACHE_SUBST(EXTRA_CPPFLAGS)
71 APACHE_SUBST(EXTRA_CFLAGS)
72 APACHE_SUBST(EXTRA_CXXFLAGS)
73 APACHE_SUBST(EXTRA_LDFLAGS)
74 APACHE_SUBST(EXTRA_LIBS)
75 APACHE_SUBST(EXTRA_INCLUDES)
79 APACHE_SUBST(MODULE_DIRS)
80 APACHE_SUBST(MODULE_CLEANDIRS)
83 APACHE_SUBST(nonssl_listen_stmt_1)
84 APACHE_SUBST(nonssl_listen_stmt_2)
85 APACHE_SUBST(CORE_IMPLIB_FILE)
86 APACHE_SUBST(CORE_IMPLIB)
88 APACHE_SUBST(SH_LIBTOOL)
89 APACHE_SUBST(MK_IMPLIB)
91 APACHE_SUBST(INSTALL_PROG_FLAGS)
92 APACHE_SUBST(DSO_MODULES)
93 APACHE_SUBST(APR_BINDIR)
94 APACHE_SUBST(APR_INCLUDEDIR)
95 APACHE_SUBST(APR_VERSION)
96 APACHE_SUBST(APR_CONFIG)
97 APACHE_SUBST(APU_BINDIR)
98 APACHE_SUBST(APU_INCLUDEDIR)
99 APACHE_SUBST(APU_VERSION)
100 APACHE_SUBST(APU_CONFIG)
102 abs_srcdir="`(cd $srcdir && pwd)`"
104 echo creating config_vars.mk
105 test -d build || $mkdir_p build
106 > build/config_vars.mk
107 for i in $APACHE_VAR_SUBST; do
108 eval echo "$i = \$$i" >> build/config_vars.mk
112 dnl APACHE_GEN_MAKEFILES
113 dnl Creates Makefiles
114 AC_DEFUN(APACHE_GEN_MAKEFILES,[
115 $SHELL $srcdir/build/fastgen.sh $srcdir $ac_cv_mkdir_p $BSD_MAKEFILE $APACHE_FAST_OUTPUT_FILES
118 dnl ## APACHE_OUTPUT(file)
119 dnl ## adds "file" to the list of files generated by AC_OUTPUT
120 dnl ## This macro can be used several times.
121 AC_DEFUN(APACHE_OUTPUT, [
122 APACHE_OUTPUT_FILES="$APACHE_OUTPUT_FILES $1"
126 dnl APACHE_TYPE_RLIM_T
128 dnl If rlim_t is not defined, define it to int
130 AC_DEFUN(APACHE_TYPE_RLIM_T, [
131 AC_CACHE_CHECK([for rlim_t], ac_cv_type_rlim_t, [
133 #include <sys/types.h>
134 #include <sys/time.h>
135 #include <sys/resource.h>
136 ], [rlim_t spoon;], [
137 ac_cv_type_rlim_t=yes
138 ],[ac_cv_type_rlim_t=no
141 if test "$ac_cv_type_rlim_t" = "no" ; then
142 AC_DEFINE(rlim_t, int,
143 [Define to 'int' if <sys/resource.h> doesn't define it for us])
147 dnl APACHE_MODPATH_INIT(modpath)
148 AC_DEFUN(APACHE_MODPATH_INIT,[
150 modpath_current=modules/$1
153 test -d $1 || $srcdir/build/mkdir.sh $modpath_current
154 > $modpath_current/modules.mk
157 AC_DEFUN(APACHE_MODPATH_FINISH,[
158 echo "DISTCLEAN_TARGETS = modules.mk" >> $modpath_current/modules.mk
159 echo "static = $modpath_static" >> $modpath_current/modules.mk
160 echo "shared = $modpath_shared" >> $modpath_current/modules.mk
161 if test ! -z "$modpath_static" -o ! -z "$modpath_shared"; then
162 MODULE_DIRS="$MODULE_DIRS $current_dir"
164 MODULE_CLEANDIRS="$MODULE_CLEANDIRS $current_dir"
166 APACHE_FAST_OUTPUT($modpath_current/Makefile)
169 dnl APACHE_MODPATH_ADD(name[, shared[, objects [, ldflags[, libs]]]])
170 AC_DEFUN(APACHE_MODPATH_ADD,[
171 if test -z "$3"; then
177 if test -z "$module_standalone"; then
178 if test -z "$2"; then
179 # The filename of a convenience library must have a "lib" prefix:
180 libname="libmod_$1.la"
181 BUILTIN_LIBS="$BUILTIN_LIBS $modpath_current/$libname"
182 modpath_static="$modpath_static $libname"
183 cat >>$modpath_current/modules.mk<<EOF
185 \$(MOD_LINK) $objects $5
187 if test ! -z "$5"; then
188 APR_ADDTO(AP_LIBS, [$5])
191 apache_need_shared=yes
193 shobjects=`echo $objects | sed 's/\.lo/.slo/g'`
194 modpath_shared="$modpath_shared $libname"
195 cat >>$modpath_current/modules.mk<<EOF
197 \$(SH_LINK) -rpath \$(libexecdir) -module -avoid-version $4 $objects $5
204 dnl APACHE_MPM_MODULE(name[, shared[, objects[, config[, path]]]])
206 dnl Provide information for building the MPM. (Enablement is handled using
207 dnl --with-mpm/--enable-mpms-shared.)
209 dnl name -- name of MPM, same as MPM directory name
210 dnl shared -- "shared" to indicate shared module build, empty string otherwise
211 dnl objects -- one or more .lo files to link into the MPM module (default: mpmname.lo)
212 dnl config -- configuration logic to run if the MPM is enabled
213 dnl path -- relative path to MPM (default: server/mpm/mpmname)
215 AC_DEFUN(APACHE_MPM_MODULE,[
216 if ap_mpm_is_enabled $1; then
217 if test -z "$3"; then
223 if test -z "$5"; then
224 mpmpath="server/mpm/$1"
230 test -d $mpmpath || $srcdir/build/mkdir.sh $mpmpath
232 APACHE_FAST_OUTPUT($mpmpath/Makefile)
234 if test -z "$2"; then
236 cat >$mpmpath/modules.mk<<EOF
238 \$(MOD_LINK) $objects
239 DISTCLEAN_TARGETS = modules.mk
244 apache_need_shared=yes
245 libname="mod_mpm_$1.la"
246 shobjects=`echo $objects | sed 's/\.lo/.slo/g'`
247 cat >$mpmpath/modules.mk<<EOF
249 \$(SH_LINK) -rpath \$(libexecdir) -module -avoid-version $objects
250 DISTCLEAN_TARGETS = modules.mk
254 # add default MPM to LoadModule list
255 if test $1 = $default_mpm; then
256 DSO_MODULES="$DSO_MODULES mpm_$1"
264 dnl APACHE_MODULE(name, helptext[, objects[, structname[, default[, config]]]])
266 dnl default is one of:
267 dnl yes -- enabled by default. user must explicitly disable.
268 dnl no -- disabled under default, most, all. user must explicitly enable.
269 dnl most -- disabled by default. enabled explicitly or with most or all.
270 dnl static -- enabled as static by default, must be explicitly changed.
271 dnl "" -- disabled under default, most. enabled explicitly or with all.
273 dnl basically: yes/no is a hard setting. "most" means follow the "most"
274 dnl setting. otherwise, fall under the "all" setting.
275 dnl explicit yes/no always overrides.
277 AC_DEFUN(APACHE_MODULE,[
278 AC_MSG_CHECKING(whether to enable mod_$1)
279 define([optname],[--]ifelse($5,yes,disable,enable)[-]translit($1,_,-))dnl
280 AC_ARG_ENABLE(translit($1,_,-),APACHE_HELP_STRING(optname(),$2),,enable_$1=ifelse($5,,maybe-all,$5))
281 undefine([optname])dnl
283 dnl When --enable-modules=most is set and the module was not explicitly
284 dnl requested, allow a module to disable itself if its pre-reqs fail.
285 if test "$module_selection" = "most" -a "$enable_$1" = "most"; then
286 _apmod_error_fatal="no"
288 _apmod_error_fatal="yes"
290 if test "$enable_$1" = "static"; then
292 elif test "$enable_$1" = "yes"; then
293 enable_$1=$module_default
294 elif test "$enable_$1" = "most"; then
295 if test "$module_selection" = "most" -o "$module_selection" = "all"; then
296 enable_$1=$module_default
297 elif test "$module_selection" = "few" -o "$module_selection" = "none"; then
300 _apmod_extra_msg=" ($module_selection)"
301 elif test "$enable_$1" = "maybe-all"; then
302 if test "$module_selection" = "all"; then
303 enable_$1=$module_default
304 _apmod_extra_msg=" (all)"
309 if test "$enable_$1" != "no"; then
310 dnl If we plan to enable it, allow the module to run some autoconf magic
311 dnl that may disable it because of missing dependencies.
312 ifelse([$6],,:,[AC_MSG_RESULT([checking dependencies])
314 AC_MSG_CHECKING(whether to enable mod_$1)
315 if test "$enable_$1" = "no"; then
316 if test "$_apmod_error_fatal" = "no"; then
317 _apmod_extra_msg=" (disabled)"
319 AC_MSG_ERROR([mod_$1 has been requested but can not be built due to prerequisite failures])
323 AC_MSG_RESULT($enable_$1$_apmod_extra_msg)
324 if test "$enable_$1" != "no"; then
327 MODLIST="$MODLIST ifelse($4,,$1,$4)"
328 if test "$1" = "so"; then
333 enable_$1=`echo $enable_$1|sed 's/shared,*//'`
336 DSO_MODULES="$DSO_MODULES $1"
339 define([modprefix], [MOD_]translit($1, [a-z-], [A-Z_]))
340 APACHE_MODPATH_ADD($1, $shared, $3,, [\$(]modprefix[_LDADD)])
341 APACHE_SUBST(modprefix[_LDADD])
342 undefine([modprefix])
347 dnl APACHE_ENABLE_MODULES
349 AC_DEFUN(APACHE_ENABLE_MODULES,[
350 module_selection=most
351 module_default=shared
353 dnl Check whether we have DSO support.
354 dnl If "yes", we build shared modules by default.
355 APR_CHECK_APR_DEFINE(APR_HAS_DSO)
357 if test $ac_cv_define_APR_HAS_DSO = "no"; then
358 AC_MSG_WARN([Missing DSO support - building static modules by default.])
359 module_default=static
363 AC_ARG_ENABLE(modules,
364 APACHE_HELP_STRING(--enable-modules=MODULE-LIST,Space-separated list of modules to enable | "all" | "most" | "few" | "none"),[
365 if test "$enableval" = "none"; then
367 module_selection=none
369 for i in $enableval; do
370 if test "$i" = "all" -o "$i" = "most" -o "$i" = "few"; then
373 i=`echo $i | sed 's/-/_/g'`
374 eval "enable_$i=shared"
380 AC_ARG_ENABLE(mods-shared,
381 APACHE_HELP_STRING(--enable-mods-shared=MODULE-LIST,Space-separated list of shared modules to enable | "all" | "most" | "few"),[
382 for i in $enableval; do
383 if test "$i" = "all" -o "$i" = "most" -o "$i" = "few"; then
385 module_default=shared
387 i=`echo $i | sed 's/-/_/g'`
388 eval "enable_$i=shared"
393 AC_ARG_ENABLE(mods-static,
394 APACHE_HELP_STRING(--enable-mods-static=MODULE-LIST,Space-separated list of static modules to enable | "all" | "most" | "few"),[
395 for i in $enableval; do
396 if test "$i" = "all" -o "$i" = "most" -o "$i" = "few"; then
398 module_default=static
400 i=`echo $i | sed 's/-/_/g'`
401 eval "enable_$i=static"
407 AC_DEFUN(APACHE_REQUIRE_CXX,[
408 if test -z "$apache_cxx_done"; then
416 dnl APACHE_CHECK_SSL_TOOLKIT
418 dnl Configure for the detected openssl/ssl-c toolkit installation, giving
419 dnl preference to "--with-ssl=<path>" if it was specified.
421 AC_DEFUN(APACHE_CHECK_SSL_TOOLKIT,[
422 if test "x$ap_ssltk_configured" = "x"; then
423 dnl initialise the variables we use
429 dnl Determine the SSL/TLS toolkit's base directory, if any
430 AC_MSG_CHECKING([for user-provided SSL/TLS toolkit base])
431 AC_ARG_WITH(sslc, APACHE_HELP_STRING(--with-sslc=DIR,RSA SSL-C SSL/TLS toolkit), [
432 dnl If --with-sslc specifies a directory, we use that directory or fail
433 if test "x$withval" != "xyes" -a "x$withval" != "x"; then
434 dnl This ensures $withval is actually a directory and that it is absolute
435 ap_ssltk_base="`cd $withval ; pwd`"
439 AC_ARG_WITH(ssl, APACHE_HELP_STRING(--with-ssl=DIR,OpenSSL SSL/TLS toolkit), [
440 dnl If --with-ssl specifies a directory, we use that directory or fail
441 if test "x$withval" != "xyes" -a "x$withval" != "x"; then
442 dnl This ensures $withval is actually a directory and that it is absolute
443 ap_ssltk_base="`cd $withval ; pwd`"
446 if test "x$ap_ssltk_base" = "x"; then
449 AC_MSG_RESULT($ap_ssltk_base)
452 dnl Run header and version checks
453 saved_CPPFLAGS="$CPPFLAGS"
455 saved_LDFLAGS="$LDFLAGS"
458 dnl Before doing anything else, load in pkg-config variables (if not sslc).
459 if test "x$ap_ssltk_type" = "x" -a -n "$PKGCONFIG"; then
460 saved_PKG_CONFIG_PATH="$PKG_CONFIG_PATH"
461 if test "x$ap_ssltk_base" != "x" -a \
462 -f "${ap_ssltk_base}/lib/pkgconfig/openssl.pc"; then
463 dnl Ensure that the given path is used by pkg-config too, otherwise
464 dnl the system openssl.pc might be picked up instead.
465 PKG_CONFIG_PATH="${ap_ssltk_base}/lib/pkgconfig${PKG_CONFIG_PATH+:}${PKG_CONFIG_PATH}"
466 export PKG_CONFIG_PATH
468 ap_ssltk_libs="`$PKGCONFIG --libs-only-l openssl 2>&1`"
469 if test $? -eq 0; then
471 pkglookup="`$PKGCONFIG --cflags-only-I openssl`"
472 APR_ADDTO(CPPFLAGS, [$pkglookup])
473 APR_ADDTO(INCLUDES, [$pkglookup])
474 pkglookup="`$PKGCONFIG --libs-only-L --libs-only-other openssl`"
475 APR_ADDTO(LDFLAGS, [$pkglookup])
476 APR_ADDTO(SSL_LIBS, [$pkglookup])
478 PKG_CONFIG_PATH="$saved_PKG_CONFIG_PATH"
480 if test "x$ap_ssltk_base" != "x" -a "x$ap_ssltk_found" = "x"; then
481 APR_ADDTO(CPPFLAGS, [-I$ap_ssltk_base/include])
482 APR_ADDTO(INCLUDES, [-I$ap_ssltk_base/include])
483 APR_ADDTO(LDFLAGS, [-L$ap_ssltk_base/lib])
484 APR_ADDTO(SSL_LIBS, [-L$ap_ssltk_base/lib])
485 if test "x$ap_platform_runtime_link_flag" != "x"; then
486 APR_ADDTO(LDFLAGS, [$ap_platform_runtime_link_flag$ap_ssltk_base/lib])
487 APR_ADDTO(SSL_LIBS, [$ap_platform_runtime_link_flag$ap_ssltk_base/lib])
490 if test "x$ap_ssltk_type" = "x"; then
491 dnl First check for manditory headers
492 AC_CHECK_HEADERS([openssl/opensslv.h openssl/ssl.h], [ap_ssltk_type="openssl"], [])
493 if test "$ap_ssltk_type" = "openssl"; then
494 dnl so it's OpenSSL - test for a good version
495 AC_MSG_CHECKING([for OpenSSL version])
496 AC_TRY_COMPILE([#include <openssl/opensslv.h>],[
497 #if !defined(OPENSSL_VERSION_NUMBER)
498 #error "Missing openssl version"
500 #if (OPENSSL_VERSION_NUMBER < 0x009060af) \
501 || ((OPENSSL_VERSION_NUMBER > 0x00907000) && (OPENSSL_VERSION_NUMBER < 0x0090702f))
502 #error "Insecure openssl version " OPENSSL_VERSION_TEXT
505 [dnl Replace this with OPENSSL_VERSION_TEXT from opensslv.h?
506 AC_MSG_RESULT([not encouraging])
507 AC_MSG_WARN([OpenSSL version may contain security vulnerabilities!]
508 [ Ensure the latest security patches have been applied!])
511 AC_MSG_RESULT([no OpenSSL headers found])
514 if test "$ap_ssltk_type" != "openssl"; then
515 dnl Might be SSL-C - report, then test anything relevant
516 AC_CHECK_HEADERS([sslc.h], [ap_ssltk_type="sslc"], [ap_ssltk_type=""])
517 if test "$ap_ssltk_type" = "sslc"; then
518 ap_ssltk_libs="-lsslc"
519 AC_MSG_CHECKING([for SSL-C version])
520 AC_TRY_COMPILE([#include <sslc.h>],[
521 #if !defined(SSLC_VERSION_NUMBER)
522 #error "Missing SSL-C version"
524 #if SSLC_VERSION_NUMBER < 0x2310
525 #define stringize_ver(x) #x
526 #error "Insecure SSL-C version " stringize_ver(SSLC_VERSION_NUMBER)
529 [dnl Replace this with SSLC_VERSION_NUMBER?
530 AC_MSG_RESULT([not encouraging])
531 echo "WARNING: SSL-C version may contain security vulnerabilities!"
532 echo " Ensure the latest security patches have been applied!"
535 AC_MSG_RESULT([no SSL-C headers found])
538 if test "x$ap_ssltk_type" = "x"; then
539 AC_MSG_ERROR([...No recognized SSL/TLS toolkit detected])
542 if test "$ap_ssltk_type" = "openssl" -a "x$ap_ssltk_found" = "x"; then
544 ap_ssltk_libs="-lssl -lcrypto `$apr_config --libs`"
546 APR_ADDTO(SSL_LIBS, [$ap_ssltk_libs])
547 APR_ADDTO(LIBS, [$ap_ssltk_libs])
548 APACHE_SUBST(SSL_LIBS)
550 dnl Run library and function checks
552 if test "$ap_ssltk_type" = "openssl"; then
553 AC_CHECK_HEADERS([openssl/engine.h])
554 AC_CHECK_FUNCS([SSLeay_version SSL_CTX_new], [], [liberrors="yes"])
555 AC_CHECK_FUNCS([ENGINE_init ENGINE_load_builtin_engines])
557 AC_CHECK_FUNCS([SSLC_library_version SSL_CTX_new], [], [liberrors="yes"])
558 AC_CHECK_FUNCS(SSL_set_state)
561 CPPFLAGS="$saved_CPPFLAGS"
563 LDFLAGS="$saved_LDFLAGS"
564 if test "x$liberrors" != "x"; then
565 AC_MSG_ERROR([... Error, SSL/TLS libraries were missing or unusable])
568 dnl Adjust apache's configuration based on what we found above.
569 dnl (a) define preprocessor symbols
570 if test "$ap_ssltk_type" = "openssl"; then
571 AC_DEFINE(HAVE_OPENSSL, 1, [Define if SSL is supported using OpenSSL])
573 AC_DEFINE(HAVE_SSLC, 1, [Define if SSL is supported using SSL-C])
579 dnl APACHE_EXPORT_ARGUMENTS
580 dnl Export (via APACHE_SUBST) the various path-related variables that
581 dnl apache will use while generating scripts like autoconf and apxs and
582 dnl the default config file.
584 AC_DEFUN(APACHE_SUBST_EXPANDED_ARG,[
585 APR_EXPAND_VAR(exp_$1, [$]$1)
587 APR_PATH_RELATIVE(rel_$1, [$]exp_$1, ${prefix})
591 AC_DEFUN(APACHE_EXPORT_ARGUMENTS,[
592 APACHE_SUBST_EXPANDED_ARG(exec_prefix)
593 APACHE_SUBST_EXPANDED_ARG(bindir)
594 APACHE_SUBST_EXPANDED_ARG(sbindir)
595 APACHE_SUBST_EXPANDED_ARG(libdir)
596 APACHE_SUBST_EXPANDED_ARG(libexecdir)
597 APACHE_SUBST_EXPANDED_ARG(mandir)
598 APACHE_SUBST_EXPANDED_ARG(sysconfdir)
599 APACHE_SUBST_EXPANDED_ARG(datadir)
600 APACHE_SUBST_EXPANDED_ARG(installbuilddir)
601 APACHE_SUBST_EXPANDED_ARG(errordir)
602 APACHE_SUBST_EXPANDED_ARG(iconsdir)
603 APACHE_SUBST_EXPANDED_ARG(htdocsdir)
604 APACHE_SUBST_EXPANDED_ARG(manualdir)
605 APACHE_SUBST_EXPANDED_ARG(cgidir)
606 APACHE_SUBST_EXPANDED_ARG(includedir)
607 APACHE_SUBST_EXPANDED_ARG(localstatedir)
608 APACHE_SUBST_EXPANDED_ARG(runtimedir)
609 APACHE_SUBST_EXPANDED_ARG(logfiledir)
610 APACHE_SUBST_EXPANDED_ARG(proxycachedir)
614 dnl APACHE_CHECK_APxVER({apr|apu}, major, minor,
615 dnl [actions-if-ok], [actions-if-not-ok])
617 dnl Checks for APR or APR-util of given major/minor version or later;
618 dnl if so, runs actions-if-ok; otherwise runs actions-if-not-ok if given.
619 dnl If the version is not satisfactory and actions-if-not-ok is not
620 dnl given, then an error is printed and the configure script is aborted.
622 dnl The first argument must be [apr] or [apu].
624 AC_DEFUN([APACHE_CHECK_APxVER], [
625 define(ap_ckver_major, translit($1, [apru], [APRU])[_MAJOR_VERSION])
626 define(ap_ckver_minor, translit($1, [apru], [APRU])[_MINOR_VERSION])
627 define(ap_ckver_cvar, [ap_cv_$1ver$2$3])
628 define(ap_ckver_name, ifelse([$1],[apr],[APR],[APR-util]))
630 ap_ckver_CPPFLAGS="$CPPFLAGS"
631 CPPFLAGS="$CPPFLAGS `$[$1]_config --includes`"
633 AC_CACHE_CHECK([for ap_ckver_name version $2.$3.0 or later], ap_ckver_cvar, [
634 AC_EGREP_CPP([good], [
635 #include <$1_version.h>
636 #if ]ap_ckver_major[ > $2 || (]ap_ckver_major[ == $2 && ]ap_ckver_minor[ >= $3)
639 ], [ap_ckver_cvar=yes], [ap_ckver_cvar=no])])
641 if test "$ap_ckver_cvar" = "yes"; then
642 ifelse([$4],[],[:],[$4])
644 ifelse([$5],[],[AC_MSG_ERROR([ap_ckver_name version $2.$3.0 or later is required])], [$5])
647 CPPFLAGS="$ap_ckver_CPPFLAGS"
649 undefine([ap_ckver_major])
650 undefine([ap_ckver_minor])
651 undefine([ap_ckver_cvar])
652 undefine([ap_ckver_name])
656 dnl APACHE_CHECK_VOID_PTR_LEN
658 dnl Checks if the size of a void pointer is at least as big as a "long"
661 AC_DEFUN([APACHE_CHECK_VOID_PTR_LEN], [
663 AC_CACHE_CHECK([for void pointer length], [ap_cv_void_ptr_lt_long],
667 return sizeof(void *) < sizeof(long);
668 }], [ap_cv_void_ptr_lt_long=no], [ap_cv_void_ptr_lt_long=yes],
669 [ap_cv_void_ptr_lt_long=yes])])
671 if test "$ap_cv_void_ptr_lt_long" = "yes"; then
672 AC_MSG_ERROR([Size of "void *" is less than size of "long"])