]> granicus.if.org Git - apache/blob - acinclude.m4
Improve logged information and fix broken doc.
[apache] / acinclude.m4
1
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
8
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"
14   AC_SUBST($1)
15 ])
16
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"
21 ])
22
23 dnl APACHE_GEN_CONFIG_VARS
24 dnl Creates config_vars.mk
25 AC_DEFUN(APACHE_GEN_CONFIG_VARS,[
26   APACHE_SUBST(abs_srcdir)
27   APACHE_SUBST(bindir)
28   APACHE_SUBST(sbindir)
29   APACHE_SUBST(cgidir)
30   APACHE_SUBST(logfiledir)
31   APACHE_SUBST(exec_prefix)
32   APACHE_SUBST(datadir)
33   APACHE_SUBST(localstatedir)
34   APACHE_SUBST(mandir)
35   APACHE_SUBST(libdir)
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)
48   APACHE_SUBST(prefix)
49   APACHE_SUBST(AWK)
50   APACHE_SUBST(CC)
51   APACHE_SUBST(CPP)
52   APACHE_SUBST(CXX)
53   APACHE_SUBST(CPPFLAGS)
54   APACHE_SUBST(CFLAGS)
55   APACHE_SUBST(CXXFLAGS)
56   APACHE_SUBST(LTFLAGS)
57   APACHE_SUBST(LDFLAGS)
58   APACHE_SUBST(LT_LDFLAGS)
59   APACHE_SUBST(SH_LDFLAGS)
60   APACHE_SUBST(HTTPD_LDFLAGS)
61   APACHE_SUBST(UTIL_LDFLAGS)
62   APACHE_SUBST(LIBS)
63   APACHE_SUBST(DEFS)
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(LIBTOOL)
77   APACHE_SUBST(SHELL)
78   APACHE_SUBST(RSYNC)
79   APACHE_SUBST(MODULE_DIRS)
80   APACHE_SUBST(MODULE_CLEANDIRS)
81   APACHE_SUBST(PORT)
82   APACHE_SUBST(nonssl_listen_stmt_1)
83   APACHE_SUBST(nonssl_listen_stmt_2)
84   APACHE_SUBST(CORE_IMPLIB_FILE)
85   APACHE_SUBST(CORE_IMPLIB)
86   APACHE_SUBST(SH_LIBS)
87   APACHE_SUBST(SH_LIBTOOL)
88   APACHE_SUBST(MK_IMPLIB)
89   APACHE_SUBST(MKDEP)
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)
100
101   abs_srcdir="`(cd $srcdir && pwd)`"
102
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
108   done
109 ])
110
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
115 ])
116
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"
122 ])
123
124 dnl
125 dnl APACHE_TYPE_RLIM_T
126 dnl
127 dnl If rlim_t is not defined, define it to int
128 dnl
129 AC_DEFUN(APACHE_TYPE_RLIM_T, [
130   AC_CACHE_CHECK([for rlim_t], ac_cv_type_rlim_t, [
131     AC_TRY_COMPILE([
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
138     ])
139   ])
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])
143   fi
144 ])
145
146 dnl APACHE_MODPATH_INIT(modpath)
147 AC_DEFUN(APACHE_MODPATH_INIT,[
148   current_dir=$1
149   modpath_current=modules/$1
150   modpath_static=
151   modpath_shared=
152   test -d $1 || $srcdir/build/mkdir.sh $modpath_current
153   > $modpath_current/modules.mk
154 ])dnl
155 dnl
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"
162   else
163     MODULE_CLEANDIRS="$MODULE_CLEANDIRS $current_dir"
164   fi
165   APACHE_FAST_OUTPUT($modpath_current/Makefile)
166 ])dnl
167 dnl
168 dnl APACHE_MODPATH_ADD(name[, shared[, objects [, ldflags[, libs]]]])
169 AC_DEFUN(APACHE_MODPATH_ADD,[
170   if test -z "$3"; then
171     objects="mod_$1.lo"
172   else
173     objects="$3"
174   fi
175
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
183 $libname: $objects
184         \$(MOD_LINK) $objects $5
185 EOF
186       if test ! -z "$5"; then
187         APR_ADDTO(AP_LIBS, [$5])
188       fi
189     else
190       apache_need_shared=yes
191       libname="mod_$1.la"
192       shobjects=`echo $objects | sed 's/\.lo/.slo/g'`
193       modpath_shared="$modpath_shared $libname"
194       cat >>$modpath_current/modules.mk<<EOF
195 $libname: $shobjects
196         \$(SH_LINK) -rpath \$(libexecdir) -module -avoid-version $4 $objects $5
197 EOF
198     fi
199   fi
200 ])dnl
201
202 dnl
203 dnl APACHE_MODULE(name, helptext[, objects[, structname[, default[, config]]]])
204 dnl
205 dnl default is one of:
206 dnl   yes    -- enabled by default. user must explicitly disable.
207 dnl   no     -- disabled under default, most, all. user must explicitly enable.
208 dnl   most   -- disabled by default. enabled explicitly or with most or all.
209 dnl   static -- enabled as static by default, must be explicitly changed.
210 dnl   ""     -- disabled under default, most. enabled explicitly or with all.
211 dnl
212 dnl basically: yes/no is a hard setting. "most" means follow the "most"
213 dnl            setting. otherwise, fall under the "all" setting.
214 dnl            explicit yes/no always overrides.
215 dnl
216 AC_DEFUN(APACHE_MODULE,[
217   AC_MSG_CHECKING(whether to enable mod_$1)
218   define([optname],[--]ifelse($5,yes,disable,enable)[-]translit($1,_,-))dnl
219   AC_ARG_ENABLE(translit($1,_,-),APACHE_HELP_STRING(optname(),$2),,enable_$1=ifelse($5,,maybe-all,$5))
220   undefine([optname])dnl
221   _apmod_extra_msg=""
222   dnl When --enable-modules=most is set and the module was not explicitly
223   dnl requested, allow a module to disable itself if its pre-reqs fail.
224   if test "$module_selection" = "most" -a "$enable_$1" = "most"; then
225     _apmod_error_fatal="no"
226   else
227     _apmod_error_fatal="yes"
228   fi
229   if test "$enable_$1" = "static"; then
230     enable_$1=yes
231   elif test "$enable_$1" = "yes"; then
232     enable_$1=$module_default
233     _apmod_extra_msg=" ($module_selection)"
234   elif test "$enable_$1" = "most"; then
235     if test "$module_selection" = "most" -o "$module_selection" = "all"; then
236       enable_$1=$module_default
237       _apmod_extra_msg=" ($module_selection)"
238     elif test "$enable_$1" != "yes"; then
239       enable_$1=no
240     fi
241   elif test "$enable_$1" = "maybe-all"; then
242     if test "$module_selection" = "all"; then
243       enable_$1=$module_default
244       _apmod_extra_msg=" (all)"
245     else
246       enable_$1=no
247     fi
248   fi
249   if test "$enable_$1" != "no"; then
250     dnl If we plan to enable it, allow the module to run some autoconf magic
251     dnl that may disable it because of missing dependencies.
252     ifelse([$6],,:,[AC_MSG_RESULT([checking dependencies])
253                     $6
254                     AC_MSG_CHECKING(whether to enable mod_$1)
255                     if test "$enable_$1" = "no"; then
256                       if test "$_apmod_error_fatal" = "no"; then
257                         _apmod_extra_msg=" (disabled)"
258                       else
259                         AC_MSG_ERROR([mod_$1 has been requested but can not be built due to prerequisite failures])
260                       fi
261                     fi])
262   fi
263   AC_MSG_RESULT($enable_$1$_apmod_extra_msg)
264   if test "$enable_$1" != "no"; then
265     case "$enable_$1" in
266     shared*)
267       enable_$1=`echo $enable_$1|sed 's/shared,*//'`
268       sharedobjs=yes
269       shared=yes
270       DSO_MODULES="$DSO_MODULES $1"
271       ;;
272     *)
273       MODLIST="$MODLIST ifelse($4,,$1,$4)"
274       if test "$1" = "so"; then
275           sharedobjs=yes
276       fi
277       shared="";;
278     esac
279     define([modprefix], [MOD_]translit($1, [a-z-], [A-Z_]))
280     APACHE_MODPATH_ADD($1, $shared, $3,, [\$(]modprefix[_LDADD)])
281     APACHE_SUBST(modprefix[_LDADD])
282     undefine([modprefix])
283   fi
284 ])dnl
285
286 dnl
287 dnl APACHE_ENABLE_MODULES
288 dnl
289 AC_DEFUN(APACHE_ENABLE_MODULES,[
290   module_selection=default
291   module_default=yes
292
293   AC_ARG_ENABLE(modules,
294   APACHE_HELP_STRING(--enable-modules=MODULE-LIST,Space-separated list of modules to enable | "all" | "most" | "none"),[
295     if test "$enableval" = "none"; then
296        module_default=no
297        module_selection=none
298     else
299       for i in $enableval; do
300         if test "$i" = "all" -o "$i" = "most"; then
301           module_selection=$i
302         else
303           i=`echo $i | sed 's/-/_/g'`
304           eval "enable_$i=yes"
305         fi
306       done
307     fi
308   ])
309   
310   AC_ARG_ENABLE(mods-shared,
311   APACHE_HELP_STRING(--enable-mods-shared=MODULE-LIST,Space-separated list of shared modules to enable | "all" | "most"),[
312     for i in $enableval; do
313       if test "$i" = "all" -o "$i" = "most"; then
314         module_selection=$i
315         module_default=shared
316       else
317         i=`echo $i | sed 's/-/_/g'`
318         eval "enable_$i=shared"
319       fi
320     done
321   ])
322 ])
323
324 AC_DEFUN(APACHE_REQUIRE_CXX,[
325   if test -z "$apache_cxx_done"; then
326     AC_PROG_CXX
327     AC_PROG_CXXCPP
328     apache_cxx_done=yes
329   fi
330 ])
331
332 dnl
333 dnl APACHE_CHECK_SSL_TOOLKIT
334 dnl
335 dnl Configure for the detected openssl/ssl-c toolkit installation, giving
336 dnl preference to "--with-ssl=<path>" if it was specified.
337 dnl
338 AC_DEFUN(APACHE_CHECK_SSL_TOOLKIT,[
339 if test "x$ap_ssltk_configured" = "x"; then
340   dnl initialise the variables we use
341   ap_ssltk_base=""
342   ap_ssltk_inc=""
343   ap_ssltk_lib=""
344   ap_ssltk_type=""
345
346   dnl Determine the SSL/TLS toolkit's base directory, if any
347   AC_MSG_CHECKING(for SSL/TLS toolkit base)
348   AC_ARG_WITH(sslc, APACHE_HELP_STRING(--with-sslc=DIR,RSA SSL-C SSL/TLS toolkit), [
349     dnl If --with-sslc specifies a directory, we use that directory or fail
350     if test "x$withval" != "xyes" -a "x$withval" != "x"; then
351       dnl This ensures $withval is actually a directory and that it is absolute
352       ap_ssltk_base="`cd $withval ; pwd`"
353     fi
354     ap_ssltk_type="sslc"
355   ])
356   AC_ARG_WITH(ssl, APACHE_HELP_STRING(--with-ssl=DIR,OpenSSL SSL/TLS toolkit), [
357     dnl If --with-ssl specifies a directory, we use that directory or fail
358     if test "x$withval" != "xyes" -a "x$withval" != "x"; then
359       dnl This ensures $withval is actually a directory and that it is absolute
360       ap_ssltk_base="`cd $withval ; pwd`"
361     fi
362   ])
363   if test "x$ap_ssltk_base" = "x"; then
364     AC_MSG_RESULT(none)
365   else
366     AC_MSG_RESULT($ap_ssltk_base)
367   fi
368
369   dnl Run header and version checks
370   saved_CPPFLAGS=$CPPFLAGS
371   if test "x$ap_ssltk_base" != "x"; then
372     ap_ssltk_inc="-I$ap_ssltk_base/include"
373     CPPFLAGS="$CPPFLAGS $ap_ssltk_inc"
374     # Ensure that the given path is used by pkg-config too, otherwise
375     # the system openssl.pc might be picked up instead.
376     PKG_CONFIG_PATH="${ap_ssltk_base}/lib/pkgconfig${PKG_CONFIG_PATH+:}${PKG_CONFIG_PATH}"
377     export PKG_CONFIG_PATH
378   fi
379   if test "x$ap_ssltk_type" = "x"; then
380     AC_MSG_CHECKING(for OpenSSL version)
381     dnl First check for manditory headers
382     AC_CHECK_HEADERS([openssl/opensslv.h openssl/ssl.h], [ap_ssltk_type="openssl"], [])
383     if test "$ap_ssltk_type" = "openssl"; then
384       dnl so it's OpenSSL - test for a good version
385       AC_TRY_COMPILE([#include <openssl/opensslv.h>],[
386 #if !defined(OPENSSL_VERSION_NUMBER)
387 #error "Missing openssl version"
388 #endif
389 #if  (OPENSSL_VERSION_NUMBER < 0x009060af) \
390  || ((OPENSSL_VERSION_NUMBER > 0x00907000) && (OPENSSL_VERSION_NUMBER < 0x0090702f))
391 #error "Insecure openssl version " OPENSSL_VERSION_TEXT
392 #endif],
393       [AC_MSG_RESULT(OK)],
394       [dnl Replace this with OPENSSL_VERSION_TEXT from opensslv.h?
395        AC_MSG_RESULT([not encouraging])
396        echo "WARNING: OpenSSL version may contain security vulnerabilities!"
397        echo "         Ensure the latest security patches have been applied!"
398       ])
399       dnl Look for additional, possibly missing headers
400       AC_CHECK_HEADERS(openssl/engine.h)
401       if test -n "$PKGCONFIG"; then
402         $PKGCONFIG openssl
403         if test $? -eq 0; then
404           ap_ssltk_inc="$ap_ssltk_inc `$PKGCONFIG --cflags-only-I openssl`"
405           CPPFLAGS="$CPPFLAGS $ap_ssltk_inc"
406         fi
407       fi
408     else
409       AC_MSG_RESULT([no OpenSSL headers found])
410     fi
411   fi
412   if test "$ap_ssltk_type" != "openssl"; then
413     dnl Might be SSL-C - report, then test anything relevant
414     AC_MSG_CHECKING(for SSL-C version)
415     AC_CHECK_HEADERS([sslc.h], [ap_ssltk_type="sslc"], [ap_ssltk_type=""])
416     if test "$ap_ssltk_type" = "sslc"; then
417       AC_MSG_CHECKING(for SSL-C version)
418       AC_TRY_COMPILE([#include <sslc.h>],[
419 #if !defined(SSLC_VERSION_NUMBER)
420 #error "Missing SSL-C version"
421 #endif
422 #if SSLC_VERSION_NUMBER < 0x2310
423 #define stringize_ver(x) #x
424 #error "Insecure SSL-C version " stringize_ver(SSLC_VERSION_NUMBER)
425 #endif],
426       [AC_MSG_RESULT(OK)],
427       [dnl Replace this with SSLC_VERSION_NUMBER?
428        AC_MSG_RESULT([not encouraging])
429        echo "WARNING: SSL-C version may contain security vulnerabilities!"
430        echo "         Ensure the latest security patches have been applied!"
431       ])
432     else
433       AC_MSG_RESULT([no SSL-C headers found])
434     fi
435   fi
436   dnl restore
437   CPPFLAGS=$saved_CPPFLAGS
438   if test "x$ap_ssltk_type" = "x"; then
439     AC_MSG_ERROR([...No recognized SSL/TLS toolkit detected])
440   fi
441
442   dnl Run library and function checks
443   saved_LDFLAGS=$LDFLAGS
444   saved_LIBS=$LIBS
445   if test "x$ap_ssltk_base" != "x"; then
446     if test -d "$ap_ssltk_base/lib"; then
447       ap_ssltk_lib="$ap_ssltk_base/lib"
448     else
449       ap_ssltk_lib="$ap_ssltk_base"
450     fi
451     LDFLAGS="$LDFLAGS -L$ap_ssltk_lib"
452   fi
453   dnl make sure "other" flags are available so libcrypto and libssl can link
454   LIBS="$LIBS `$apr_config --libs`"
455   liberrors=""
456   if test "$ap_ssltk_type" = "openssl"; then
457     AC_CHECK_LIB(crypto, SSLeay_version, [], [liberrors="yes"])
458     AC_CHECK_LIB(ssl, SSL_CTX_new, [], [liberrors="yes"])
459     AC_CHECK_FUNCS(ENGINE_init)
460     AC_CHECK_FUNCS(ENGINE_load_builtin_engines)
461   else
462     AC_CHECK_LIB(sslc, SSLC_library_version, [], [liberrors="yes"])
463     AC_CHECK_LIB(sslc, SSL_CTX_new, [], [liberrors="yes"])
464     AC_CHECK_FUNCS(SSL_set_state)
465   fi
466   AC_CHECK_FUNCS(SSL_set_cert_store)
467   dnl restore
468   LDFLAGS=$saved_LDFLAGS
469   LIBS=$saved_LIBS
470   if test "x$liberrors" != "x"; then
471     AC_MSG_ERROR([... Error, SSL/TLS libraries were missing or unusable])
472   fi
473
474   dnl Adjust apache's configuration based on what we found above.
475   dnl (a) define preprocessor symbols
476   if test "$ap_ssltk_type" = "openssl"; then
477     AC_DEFINE(HAVE_OPENSSL, 1, [Define if SSL is supported using OpenSSL])
478   else
479     AC_DEFINE(HAVE_SSLC, 1, [Define if SSL is supported using SSL-C])
480   fi
481   dnl (b) hook up include paths
482   if test "x$ap_ssltk_inc" != "x"; then
483     APR_ADDTO(INCLUDES, [$ap_ssltk_inc])
484   fi
485   dnl (c) hook up linker paths
486   if test "x$ap_ssltk_lib" != "x"; then
487     APR_ADDTO(LDFLAGS, ["-L$ap_ssltk_lib"])
488     if test "x$ap_platform_runtime_link_flag" != "x"; then
489       APR_ADDTO(LDFLAGS, ["$ap_platform_runtime_link_flag$ap_ssltk_lib"])
490     fi
491   fi
492   # Put SSL libraries in SSL_LIBS.
493   if test "$ap_ssltk_type" = "openssl"; then
494     APR_SETVAR(SSL_LIBS, [-lssl -lcrypto])
495     if test -n "$PKGCONFIG"; then
496       $PKGCONFIG openssl
497       if test $? -eq 0; then
498         ap_ssltk_libdep=`$PKGCONFIG --libs openssl`
499         APR_ADDTO(SSL_LIBS, $ap_ssltk_libdep)
500       fi
501     fi
502   else
503     APR_SETVAR(SSL_LIBS, [-lsslc])
504   fi
505   APACHE_SUBST(SSL_LIBS)
506 fi
507 ])
508
509 dnl
510 dnl APACHE_EXPORT_ARGUMENTS
511 dnl Export (via APACHE_SUBST) the various path-related variables that
512 dnl apache will use while generating scripts like autoconf and apxs and
513 dnl the default config file.
514
515 AC_DEFUN(APACHE_SUBST_EXPANDED_ARG,[
516   APR_EXPAND_VAR(exp_$1, [$]$1)
517   APACHE_SUBST(exp_$1)
518   APR_PATH_RELATIVE(rel_$1, [$]exp_$1, ${prefix})
519   APACHE_SUBST(rel_$1)
520 ])
521
522 AC_DEFUN(APACHE_EXPORT_ARGUMENTS,[
523   APACHE_SUBST_EXPANDED_ARG(exec_prefix)
524   APACHE_SUBST_EXPANDED_ARG(bindir)
525   APACHE_SUBST_EXPANDED_ARG(sbindir)
526   APACHE_SUBST_EXPANDED_ARG(libdir)
527   APACHE_SUBST_EXPANDED_ARG(libexecdir)
528   APACHE_SUBST_EXPANDED_ARG(mandir)
529   APACHE_SUBST_EXPANDED_ARG(sysconfdir)
530   APACHE_SUBST_EXPANDED_ARG(datadir)
531   APACHE_SUBST_EXPANDED_ARG(installbuilddir)
532   APACHE_SUBST_EXPANDED_ARG(errordir)
533   APACHE_SUBST_EXPANDED_ARG(iconsdir)
534   APACHE_SUBST_EXPANDED_ARG(htdocsdir)
535   APACHE_SUBST_EXPANDED_ARG(manualdir)
536   APACHE_SUBST_EXPANDED_ARG(cgidir)
537   APACHE_SUBST_EXPANDED_ARG(includedir)
538   APACHE_SUBST_EXPANDED_ARG(localstatedir)
539   APACHE_SUBST_EXPANDED_ARG(runtimedir)
540   APACHE_SUBST_EXPANDED_ARG(logfiledir)
541   APACHE_SUBST_EXPANDED_ARG(proxycachedir)
542 ])
543
544 dnl 
545 dnl APACHE_CHECK_APxVER({apr|apu}, major, minor, 
546 dnl                     [actions-if-ok], [actions-if-not-ok])
547 dnl
548 dnl Checks for APR or APR-util of given major/minor version or later; 
549 dnl if so, runs actions-if-ok; otherwise runs actions-if-not-ok if given.
550 dnl If the version is not satisfactory and actions-if-not-ok is not
551 dnl given, then an error is printed and the configure script is aborted.
552 dnl
553 dnl The first argument must be [apr] or [apu].
554 dnl
555 AC_DEFUN([APACHE_CHECK_APxVER], [
556 define(ap_ckver_major, translit($1, [apru], [APRU])[_MAJOR_VERSION])
557 define(ap_ckver_minor, translit($1, [apru], [APRU])[_MINOR_VERSION])
558 define(ap_ckver_cvar, [ap_cv_$1ver$2$3])
559 define(ap_ckver_name, ifelse([$1],[apr],[APR],[APR-util]))
560
561 ap_ckver_CPPFLAGS="$CPPFLAGS"
562 CPPFLAGS="$CPPFLAGS `$[$1]_config --includes`"
563
564 AC_CACHE_CHECK([for ap_ckver_name version $2.$3.0 or later], ap_ckver_cvar, [
565 AC_EGREP_CPP([good], [
566 #include <$1_version.h>
567 #if ]ap_ckver_major[ > $2 || (]ap_ckver_major[ == $2 && ]ap_ckver_minor[ >= $3)
568 good
569 #endif
570 ], [ap_ckver_cvar=yes], [ap_ckver_cvar=no])])
571
572 if test "$ap_ckver_cvar" = "yes"; then
573   ifelse([$4],[],[:],[$4])
574 else
575   ifelse([$5],[],[AC_MSG_ERROR([ap_ckver_name version $2.$3.0 or later is required])], [$5])
576 fi
577
578 CPPFLAGS="$ap_ckver_CPPFLAGS"
579
580 undefine([ap_ckver_major])
581 undefine([ap_ckver_minor])
582 undefine([ap_ckver_cvar])
583 undefine([ap_ckver_name])
584 ])
585
586 dnl
587 dnl APACHE_CHECK_VOID_PTR_LEN
588 dnl
589 dnl Checks if the size of a void pointer is at least as big as a "long" 
590 dnl integer type.
591 dnl
592 AC_DEFUN([APACHE_CHECK_VOID_PTR_LEN], [
593
594 AC_CACHE_CHECK([for void pointer length], [ap_void_ptr_lt_long],
595 [AC_TRY_RUN([
596 int main(void)
597 {
598     return sizeof(void *) < sizeof(long); 
599 }], [ap_void_ptr_lt_long=no], [ap_void_ptr_lt_long=yes], 
600     [ap_void_ptr_lt_long=yes])])
601
602 if test "$ap_void_ptr_lt_long" = "yes"; then
603     AC_MSG_ERROR([Size of "void *" is less than size of "long"])
604 fi
605 ])