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)
76 APACHE_SUBST(INTERNAL_CPPFLAGS)
80 APACHE_SUBST(MODULE_DIRS)
81 APACHE_SUBST(MODULE_CLEANDIRS)
84 APACHE_SUBST(CORE_IMPLIB_FILE)
85 APACHE_SUBST(CORE_IMPLIB)
87 APACHE_SUBST(SH_LIBTOOL)
88 APACHE_SUBST(MK_IMPLIB)
90 APACHE_SUBST(INSTALL_PROG_FLAGS)
91 APACHE_SUBST(DSO_MODULES)
92 APACHE_SUBST(APR_BINDIR)
93 APACHE_SUBST(APR_INCLUDEDIR)
94 APACHE_SUBST(APR_VERSION)
95 APACHE_SUBST(APR_CONFIG)
96 APACHE_SUBST(APU_BINDIR)
97 APACHE_SUBST(APU_INCLUDEDIR)
98 APACHE_SUBST(APU_VERSION)
99 APACHE_SUBST(APU_CONFIG)
101 abs_srcdir="`(cd $srcdir && pwd)`"
103 echo creating config_vars.mk
104 test -d build || $mkdir_p build
105 > build/config_vars.mk
106 for i in $APACHE_VAR_SUBST; do
107 eval echo "$i = \$$i" >> build/config_vars.mk
111 dnl APACHE_GEN_MAKEFILES
112 dnl Creates Makefiles
113 AC_DEFUN(APACHE_GEN_MAKEFILES,[
114 $SHELL $srcdir/build/fastgen.sh $srcdir $ac_cv_mkdir_p $BSD_MAKEFILE $APACHE_FAST_OUTPUT_FILES
117 dnl ## APACHE_OUTPUT(file)
118 dnl ## adds "file" to the list of files generated by AC_OUTPUT
119 dnl ## This macro can be used several times.
120 AC_DEFUN(APACHE_OUTPUT, [
121 APACHE_OUTPUT_FILES="$APACHE_OUTPUT_FILES $1"
125 dnl APACHE_TYPE_RLIM_T
127 dnl If rlim_t is not defined, define it to int
129 AC_DEFUN(APACHE_TYPE_RLIM_T, [
130 AC_CACHE_CHECK([for rlim_t], ac_cv_type_rlim_t, [
132 #include <sys/types.h>
133 #include <sys/time.h>
134 #include <sys/resource.h>
135 ], [rlim_t spoon;], [
136 ac_cv_type_rlim_t=yes
137 ],[ac_cv_type_rlim_t=no
140 if test "$ac_cv_type_rlim_t" = "no" ; then
141 AC_DEFINE(rlim_t, int,
142 [Define to 'int' if <sys/resource.h> doesn't define it for us])
146 dnl APACHE_MODPATH_INIT(modpath)
147 AC_DEFUN(APACHE_MODPATH_INIT,[
149 modpath_current=modules/$1
152 test -d $1 || $srcdir/build/mkdir.sh $modpath_current
153 > $modpath_current/modules.mk
156 AC_DEFUN(APACHE_MODPATH_FINISH,[
157 echo "DISTCLEAN_TARGETS = modules.mk" >> $modpath_current/modules.mk
158 echo "static = $modpath_static" >> $modpath_current/modules.mk
159 echo "shared = $modpath_shared" >> $modpath_current/modules.mk
160 if test ! -z "$modpath_static" -o ! -z "$modpath_shared"; then
161 MODULE_DIRS="$MODULE_DIRS $current_dir"
163 MODULE_CLEANDIRS="$MODULE_CLEANDIRS $current_dir"
165 APACHE_FAST_OUTPUT($modpath_current/Makefile)
168 dnl APACHE_MODPATH_ADD(name[, shared[, objects [, ldflags[, libs]]]])
169 AC_DEFUN(APACHE_MODPATH_ADD,[
170 if test -z "$3"; then
176 if test -z "$module_standalone"; then
177 if test -z "$2"; then
178 # The filename of a convenience library must have a "lib" prefix:
179 libname="libmod_$1.la"
180 BUILTIN_LIBS="$BUILTIN_LIBS $modpath_current/$libname"
181 modpath_static="$modpath_static $libname"
182 cat >>$modpath_current/modules.mk<<EOF
184 \$(MOD_LINK) $objects $5
186 if test ! -z "$5"; then
187 APR_ADDTO(AP_LIBS, [$5])
190 apache_need_shared=yes
192 shobjects=`echo $objects | sed 's/\.lo/.slo/g'`
193 modpath_shared="$modpath_shared $libname"
194 cat >>$modpath_current/modules.mk<<EOF
196 \$(SH_LINK) -rpath \$(libexecdir) -module -avoid-version $4 $objects $5
203 dnl APACHE_MPM_MODULE(name[, shared[, objects[, config[, path[, libs]]]]])
205 dnl Provide information for building the MPM. (Enablement is handled using
206 dnl --with-mpm/--enable-mpms-shared.)
208 dnl name -- name of MPM, same as MPM directory name
209 dnl shared -- "shared" to indicate shared module build, empty string otherwise
210 dnl objects -- one or more .lo files to link into the MPM module (default: mpmname.lo)
211 dnl config -- configuration logic to run if the MPM is enabled
212 dnl path -- relative path to MPM (default: server/mpm/mpmname)
213 dnl libs -- libs needed by this MPM
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
235 APR_ADDTO(AP_LIBS, [$6])
237 cat >$mpmpath/modules.mk<<EOF
239 \$(MOD_LINK) $objects
240 DISTCLEAN_TARGETS = modules.mk
245 apache_need_shared=yes
246 libname="mod_mpm_$1.la"
247 shobjects=`echo $objects | sed 's/\.lo/.slo/g'`
248 cat >$mpmpath/modules.mk<<EOF
250 \$(SH_LINK) -rpath \$(libexecdir) -module -avoid-version $objects $6
251 DISTCLEAN_TARGETS = modules.mk
255 # add default MPM to LoadModule list
256 if test $1 = $default_mpm; then
257 DSO_MODULES="$DSO_MODULES mpm_$1"
265 dnl APACHE_MODULE(name, helptext[, objects[, structname[, default[, config]]]])
267 dnl default is one of:
268 dnl yes -- enabled by default. user must explicitly disable.
269 dnl no -- disabled under default, most, all. user must explicitly enable.
270 dnl most -- disabled by default. enabled explicitly or with most or all.
271 dnl static -- enabled as static by default, must be explicitly changed.
272 dnl "" -- disabled under default, most. enabled explicitly or with all.
274 dnl basically: yes/no is a hard setting. "most" means follow the "most"
275 dnl setting. otherwise, fall under the "all" setting.
276 dnl explicit yes/no always overrides, except if the user selects
279 AC_DEFUN(APACHE_MODULE,[
280 AC_MSG_CHECKING(whether to enable mod_$1)
281 define([optname],[--]ifelse($5,yes,disable,enable)[-]translit($1,_,-))dnl
282 AC_ARG_ENABLE(translit($1,_,-),APACHE_HELP_STRING(optname(),$2),,enable_$1=ifelse($5,,maybe-all,$5))
283 undefine([optname])dnl
285 dnl When --enable-modules=most or --enable-modules=reallyall is set and the
286 dnl module was not explicitly requested, allow a module to disable itself if
287 dnl its pre-reqs fail.
288 dnl XXX: Todo: Allow to disable specific modules even with "reallyall".
289 if test "$module_selection" = "most" -a "$enable_$1" = "most" ||
290 test "$module_selection" = "reallyall" -a "$enable_$1" != "yes" -a \
291 "$enable_$1" != "static"
293 _apmod_error_fatal="no"
295 _apmod_error_fatal="yes"
297 if test "$enable_$1" = "static"; then
299 elif test "$enable_$1" = "yes"; then
300 enable_$1=$module_default
301 elif test "$enable_$1" = "most"; then
302 if test "$module_selection" = "most" -o "$module_selection" = "all" -o \
303 "$module_selection" = "reallyall"
305 enable_$1=$module_default
306 elif test "$module_selection" = "few" -o "$module_selection" = "none"; then
309 _apmod_extra_msg=" ($module_selection)"
310 elif test "$enable_$1" = "maybe-all"; then
311 if test "$module_selection" = "all" -o "$module_selection" = "reallyall"
313 enable_$1=$module_default
314 _apmod_extra_msg=" ($module_selection)"
318 elif test "$enable_$1" = "no" -a "$module_selection" = "reallyall"; then
319 enable_$1=$module_default
320 _apmod_extra_msg=" ($module_selection)"
322 if test "$enable_$1" != "no"; then
323 dnl If we plan to enable it, allow the module to run some autoconf magic
324 dnl that may disable it because of missing dependencies.
325 ifelse([$6],,:,[AC_MSG_RESULT([checking dependencies])
327 AC_MSG_CHECKING(whether to enable mod_$1)
328 if test "$enable_$1" = "no"; then
329 if test "$_apmod_error_fatal" = "no"; then
330 _apmod_extra_msg=" (disabled)"
332 AC_MSG_ERROR([mod_$1 has been requested but can not be built due to prerequisite failures])
336 AC_MSG_RESULT($enable_$1$_apmod_extra_msg)
337 if test "$enable_$1" != "no"; then
340 MODLIST="$MODLIST ifelse($4,,$1,$4)"
341 if test "$1" = "so"; then
346 enable_$1=`echo $enable_$1|sed 's/shared,*//'`
349 DSO_MODULES="$DSO_MODULES $1"
352 define([modprefix], [MOD_]translit($1, [a-z-], [A-Z_]))
353 APACHE_MODPATH_ADD($1, $shared, $3,, [\$(]modprefix[_LDADD)])
354 APACHE_SUBST(modprefix[_LDADD])
355 undefine([modprefix])
360 dnl APACHE_ENABLE_MODULES
362 AC_DEFUN(APACHE_ENABLE_MODULES,[
363 module_selection=most
364 module_default=shared
366 dnl Check whether we have DSO support.
367 dnl If "yes", we build shared modules by default.
368 APR_CHECK_APR_DEFINE(APR_HAS_DSO)
370 if test $ac_cv_define_APR_HAS_DSO = "no"; then
371 AC_MSG_WARN([Missing DSO support - building static modules by default.])
372 module_default=static
376 AC_ARG_ENABLE(modules,
377 APACHE_HELP_STRING(--enable-modules=MODULE-LIST,Space-separated list of modules to enable | "all" | "most" | "few" | "none"| "reallyall"),[
378 if test "$enableval" = "none"; then
380 module_selection=none
382 for i in $enableval; do
383 if test "$i" = "all" -o "$i" = "most" -o "$i" = "few" -o "$i" = "reallyall"
387 i=`echo $i | sed 's/-/_/g'`
388 eval "enable_$i=shared"
394 AC_ARG_ENABLE(mods-shared,
395 APACHE_HELP_STRING(--enable-mods-shared=MODULE-LIST,Space-separated list of shared modules to enable | "all" | "most" | "few"| "reallyall"),[
396 for i in $enableval; do
397 if test "$i" = "all" -o "$i" = "most" -o "$i" = "few" -o "$i" = "reallyall"
400 module_default=shared
402 i=`echo $i | sed 's/-/_/g'`
403 eval "enable_$i=shared"
408 AC_ARG_ENABLE(mods-static,
409 APACHE_HELP_STRING(--enable-mods-static=MODULE-LIST,Space-separated list of static modules to enable | "all" | "most" | "few"),[
410 for i in $enableval; do
411 if test "$i" = "all" -o "$i" = "most" -o "$i" = "few"; then
413 module_default=static
415 i=`echo $i | sed 's/-/_/g'`
416 eval "enable_$i=static"
422 AC_DEFUN(APACHE_REQUIRE_CXX,[
423 if test -z "$apache_cxx_done"; then
431 dnl APACHE_CHECK_SSL_TOOLKIT
433 dnl Configure for the detected openssl/ssl-c toolkit installation, giving
434 dnl preference to "--with-ssl=<path>" if it was specified.
436 AC_DEFUN(APACHE_CHECK_SSL_TOOLKIT,[
437 if test "x$ap_ssltk_configured" = "x"; then
438 dnl initialise the variables we use
444 dnl Determine the SSL/TLS toolkit's base directory, if any
445 AC_MSG_CHECKING([for user-provided SSL/TLS toolkit base])
446 AC_ARG_WITH(sslc, APACHE_HELP_STRING(--with-sslc=DIR,RSA SSL-C SSL/TLS toolkit), [
447 dnl If --with-sslc specifies a directory, we use that directory or fail
448 if test "x$withval" != "xyes" -a "x$withval" != "x"; then
449 dnl This ensures $withval is actually a directory and that it is absolute
450 ap_ssltk_base="`cd $withval ; pwd`"
454 AC_ARG_WITH(ssl, APACHE_HELP_STRING(--with-ssl=DIR,OpenSSL SSL/TLS toolkit), [
455 dnl If --with-ssl specifies a directory, we use that directory or fail
456 if test "x$withval" != "xyes" -a "x$withval" != "x"; then
457 dnl This ensures $withval is actually a directory and that it is absolute
458 ap_ssltk_base="`cd $withval ; pwd`"
461 if test "x$ap_ssltk_base" = "x"; then
464 AC_MSG_RESULT($ap_ssltk_base)
467 dnl Run header and version checks
468 saved_CPPFLAGS="$CPPFLAGS"
470 saved_LDFLAGS="$LDFLAGS"
473 dnl Before doing anything else, load in pkg-config variables (if not sslc).
474 if test "x$ap_ssltk_type" = "x" -a -n "$PKGCONFIG"; then
475 saved_PKG_CONFIG_PATH="$PKG_CONFIG_PATH"
476 if test "x$ap_ssltk_base" != "x" -a \
477 -f "${ap_ssltk_base}/lib/pkgconfig/openssl.pc"; then
478 dnl Ensure that the given path is used by pkg-config too, otherwise
479 dnl the system openssl.pc might be picked up instead.
480 PKG_CONFIG_PATH="${ap_ssltk_base}/lib/pkgconfig${PKG_CONFIG_PATH+:}${PKG_CONFIG_PATH}"
481 export PKG_CONFIG_PATH
483 ap_ssltk_libs="`$PKGCONFIG --libs-only-l openssl 2>&1`"
484 if test $? -eq 0; then
486 pkglookup="`$PKGCONFIG --cflags-only-I openssl`"
487 APR_ADDTO(CPPFLAGS, [$pkglookup])
488 APR_ADDTO(INCLUDES, [$pkglookup])
489 pkglookup="`$PKGCONFIG --libs-only-L --libs-only-other openssl`"
490 APR_ADDTO(LDFLAGS, [$pkglookup])
491 APR_ADDTO(SSL_LIBS, [$pkglookup])
493 PKG_CONFIG_PATH="$saved_PKG_CONFIG_PATH"
495 if test "x$ap_ssltk_base" != "x" -a "x$ap_ssltk_found" = "x"; then
496 APR_ADDTO(CPPFLAGS, [-I$ap_ssltk_base/include])
497 APR_ADDTO(INCLUDES, [-I$ap_ssltk_base/include])
498 APR_ADDTO(LDFLAGS, [-L$ap_ssltk_base/lib])
499 APR_ADDTO(SSL_LIBS, [-L$ap_ssltk_base/lib])
500 if test "x$ap_platform_runtime_link_flag" != "x"; then
501 APR_ADDTO(LDFLAGS, [$ap_platform_runtime_link_flag$ap_ssltk_base/lib])
502 APR_ADDTO(SSL_LIBS, [$ap_platform_runtime_link_flag$ap_ssltk_base/lib])
505 if test "x$ap_ssltk_type" = "x"; then
506 dnl First check for manditory headers
507 AC_CHECK_HEADERS([openssl/opensslv.h openssl/ssl.h], [ap_ssltk_type="openssl"], [])
508 if test "$ap_ssltk_type" = "openssl"; then
509 dnl so it's OpenSSL - test for a good version
510 AC_MSG_CHECKING([for OpenSSL version])
511 AC_TRY_COMPILE([#include <openssl/opensslv.h>],[
512 #if !defined(OPENSSL_VERSION_NUMBER)
513 #error "Missing openssl version"
515 #if (OPENSSL_VERSION_NUMBER < 0x009060af) \
516 || ((OPENSSL_VERSION_NUMBER > 0x00907000) && (OPENSSL_VERSION_NUMBER < 0x0090702f))
517 #error "Insecure openssl version " OPENSSL_VERSION_TEXT
520 [dnl Replace this with OPENSSL_VERSION_TEXT from opensslv.h?
521 AC_MSG_RESULT([not encouraging])
522 AC_MSG_WARN([OpenSSL version may contain security vulnerabilities!]
523 [ Ensure the latest security patches have been applied!])
526 AC_MSG_RESULT([no OpenSSL headers found])
529 if test "$ap_ssltk_type" != "openssl"; then
530 dnl Might be SSL-C - report, then test anything relevant
531 AC_CHECK_HEADERS([sslc.h], [ap_ssltk_type="sslc"], [ap_ssltk_type=""])
532 if test "$ap_ssltk_type" = "sslc"; then
533 ap_ssltk_libs="-lsslc"
534 AC_MSG_CHECKING([for SSL-C version])
535 AC_TRY_COMPILE([#include <sslc.h>],[
536 #if !defined(SSLC_VERSION_NUMBER)
537 #error "Missing SSL-C version"
539 #if SSLC_VERSION_NUMBER < 0x2310
540 #define stringize_ver(x) #x
541 #error "Insecure SSL-C version " stringize_ver(SSLC_VERSION_NUMBER)
544 [dnl Replace this with SSLC_VERSION_NUMBER?
545 AC_MSG_RESULT([not encouraging])
546 echo "WARNING: SSL-C version may contain security vulnerabilities!"
547 echo " Ensure the latest security patches have been applied!"
550 AC_MSG_RESULT([no SSL-C headers found])
553 if test "x$ap_ssltk_type" = "x"; then
554 AC_MSG_ERROR([...No recognized SSL/TLS toolkit detected])
557 if test "$ap_ssltk_type" = "openssl" -a "x$ap_ssltk_found" = "x"; then
559 ap_ssltk_libs="-lssl -lcrypto `$apr_config --libs`"
561 APR_ADDTO(SSL_LIBS, [$ap_ssltk_libs])
562 APR_ADDTO(LIBS, [$ap_ssltk_libs])
563 APACHE_SUBST(SSL_LIBS)
565 dnl Run library and function checks
567 if test "$ap_ssltk_type" = "openssl"; then
568 AC_CHECK_HEADERS([openssl/engine.h])
569 AC_CHECK_FUNCS([SSLeay_version SSL_CTX_new], [], [liberrors="yes"])
570 AC_CHECK_FUNCS([ENGINE_init ENGINE_load_builtin_engines])
572 AC_CHECK_FUNCS([SSLC_library_version SSL_CTX_new], [], [liberrors="yes"])
573 AC_CHECK_FUNCS(SSL_set_state)
576 CPPFLAGS="$saved_CPPFLAGS"
578 LDFLAGS="$saved_LDFLAGS"
579 if test "x$liberrors" != "x"; then
580 AC_MSG_ERROR([... Error, SSL/TLS libraries were missing or unusable])
583 dnl Adjust apache's configuration based on what we found above.
584 dnl (a) define preprocessor symbols
585 if test "$ap_ssltk_type" = "openssl"; then
586 AC_DEFINE(HAVE_OPENSSL, 1, [Define if SSL is supported using OpenSSL])
588 AC_DEFINE(HAVE_SSLC, 1, [Define if SSL is supported using SSL-C])
594 dnl APACHE_CHECK_SERF
596 dnl Configure for the detected libserf, giving preference to
597 dnl "--with-serf=<path>" if it was specified.
599 AC_DEFUN([APACHE_CHECK_SERF], [
600 AC_CACHE_CHECK([for libserf], [ac_cv_serf], [
604 AC_ARG_WITH(serf, APACHE_HELP_STRING([--with-serf=PREFIX],
605 [Serf client library]),
607 if test "$withval" = "yes" ; then
614 if test "$serf_prefix" != "no" ; then
615 save_cppflags="$CPPFLAGS"
616 CPPFLAGS="$CPPFLAGS $APR_INCLUDES $APU_INCLUDES -I$serf_prefix/include/serf-0"
617 AC_CHECK_HEADERS(serf.h,[
618 save_ldflags="$LDFLAGS"
619 LDFLAGS="$LDFLAGS -L$serf_prefix/lib"
620 AC_CHECK_LIB(serf-0, serf_context_create,[ac_cv_serf="yes"])
621 LDFLAGS="$save_ldflags"])
622 CPPFLAGS="$save_cppflags"
626 APACHE_SUBST(SERF_LIBS)
627 if test "$ac_cv_serf" = "yes"; then
628 AC_DEFINE(HAVE_SERF, 1, [Define if libserf is available])
629 APR_SETVAR(SERF_LIBS, [-L$serf_prefix/lib -lserf-0])
630 APR_ADDTO(INCLUDES, [-I$serf_prefix/include/serf-0])
636 dnl APACHE_EXPORT_ARGUMENTS
637 dnl Export (via APACHE_SUBST) the various path-related variables that
638 dnl apache will use while generating scripts like autoconf and apxs and
639 dnl the default config file.
641 AC_DEFUN(APACHE_SUBST_EXPANDED_ARG,[
642 APR_EXPAND_VAR(exp_$1, [$]$1)
644 APR_PATH_RELATIVE(rel_$1, [$]exp_$1, ${prefix})
648 AC_DEFUN(APACHE_EXPORT_ARGUMENTS,[
649 APACHE_SUBST_EXPANDED_ARG(exec_prefix)
650 APACHE_SUBST_EXPANDED_ARG(bindir)
651 APACHE_SUBST_EXPANDED_ARG(sbindir)
652 APACHE_SUBST_EXPANDED_ARG(libdir)
653 APACHE_SUBST_EXPANDED_ARG(libexecdir)
654 APACHE_SUBST_EXPANDED_ARG(mandir)
655 APACHE_SUBST_EXPANDED_ARG(sysconfdir)
656 APACHE_SUBST_EXPANDED_ARG(datadir)
657 APACHE_SUBST_EXPANDED_ARG(installbuilddir)
658 APACHE_SUBST_EXPANDED_ARG(errordir)
659 APACHE_SUBST_EXPANDED_ARG(iconsdir)
660 APACHE_SUBST_EXPANDED_ARG(htdocsdir)
661 APACHE_SUBST_EXPANDED_ARG(manualdir)
662 APACHE_SUBST_EXPANDED_ARG(cgidir)
663 APACHE_SUBST_EXPANDED_ARG(includedir)
664 APACHE_SUBST_EXPANDED_ARG(localstatedir)
665 APACHE_SUBST_EXPANDED_ARG(runtimedir)
666 APACHE_SUBST_EXPANDED_ARG(logfiledir)
667 APACHE_SUBST_EXPANDED_ARG(proxycachedir)
671 dnl APACHE_CHECK_APxVER({apr|apu}, major, minor,
672 dnl [actions-if-ok], [actions-if-not-ok])
674 dnl Checks for APR or APR-util of given major/minor version or later;
675 dnl if so, runs actions-if-ok; otherwise runs actions-if-not-ok if given.
676 dnl If the version is not satisfactory and actions-if-not-ok is not
677 dnl given, then an error is printed and the configure script is aborted.
679 dnl The first argument must be [apr] or [apu].
681 AC_DEFUN([APACHE_CHECK_APxVER], [
682 define(ap_ckver_major, translit($1, [apru], [APRU])[_MAJOR_VERSION])
683 define(ap_ckver_minor, translit($1, [apru], [APRU])[_MINOR_VERSION])
684 define(ap_ckver_cvar, [ap_cv_$1ver$2$3])
685 define(ap_ckver_name, ifelse([$1],[apr],[APR],[APR-util]))
687 ap_ckver_CPPFLAGS="$CPPFLAGS"
688 CPPFLAGS="$CPPFLAGS `$[$1]_config --includes`"
690 AC_CACHE_CHECK([for ap_ckver_name version $2.$3.0 or later], ap_ckver_cvar, [
691 AC_EGREP_CPP([good], [
692 #include <$1_version.h>
693 #if ]ap_ckver_major[ > $2 || (]ap_ckver_major[ == $2 && ]ap_ckver_minor[ >= $3)
696 ], [ap_ckver_cvar=yes], [ap_ckver_cvar=no])])
698 if test "$ap_ckver_cvar" = "yes"; then
699 ifelse([$4],[],[:],[$4])
701 ifelse([$5],[],[AC_MSG_ERROR([ap_ckver_name version $2.$3.0 or later is required])], [$5])
704 CPPFLAGS="$ap_ckver_CPPFLAGS"
706 undefine([ap_ckver_major])
707 undefine([ap_ckver_minor])
708 undefine([ap_ckver_cvar])
709 undefine([ap_ckver_name])
713 dnl APACHE_CHECK_VOID_PTR_LEN
715 dnl Checks if the size of a void pointer is at least as big as a "long"
718 AC_DEFUN([APACHE_CHECK_VOID_PTR_LEN], [
720 AC_CACHE_CHECK([for void pointer length], [ap_cv_void_ptr_lt_long],
724 return sizeof(void *) < sizeof(long);
725 }], [ap_cv_void_ptr_lt_long=no], [ap_cv_void_ptr_lt_long=yes],
726 [ap_cv_void_ptr_lt_long=yes])])
728 if test "$ap_cv_void_ptr_lt_long" = "yes"; then
729 AC_MSG_ERROR([Size of "void *" is less than size of "long"])