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(ENABLED_DSO_MODULES)
93 APACHE_SUBST(LOAD_ALL_MODULES)
94 APACHE_SUBST(APR_BINDIR)
95 APACHE_SUBST(APR_INCLUDEDIR)
96 APACHE_SUBST(APR_VERSION)
97 APACHE_SUBST(APR_CONFIG)
98 APACHE_SUBST(APU_BINDIR)
99 APACHE_SUBST(APU_INCLUDEDIR)
100 APACHE_SUBST(APU_VERSION)
101 APACHE_SUBST(APU_CONFIG)
103 abs_srcdir="`(cd $srcdir && pwd)`"
105 echo creating config_vars.mk
106 test -d build || $mkdir_p build
107 > build/config_vars.mk
108 for i in $APACHE_VAR_SUBST; do
109 eval echo "$i = \$$i" >> build/config_vars.mk
113 dnl APACHE_GEN_MAKEFILES
114 dnl Creates Makefiles
115 AC_DEFUN(APACHE_GEN_MAKEFILES,[
116 $SHELL $srcdir/build/fastgen.sh $srcdir $ac_cv_mkdir_p $BSD_MAKEFILE $APACHE_FAST_OUTPUT_FILES
119 dnl ## APACHE_OUTPUT(file)
120 dnl ## adds "file" to the list of files generated by AC_OUTPUT
121 dnl ## This macro can be used several times.
122 AC_DEFUN(APACHE_OUTPUT, [
123 APACHE_OUTPUT_FILES="$APACHE_OUTPUT_FILES $1"
127 dnl APACHE_TYPE_RLIM_T
129 dnl If rlim_t is not defined, define it to int
131 AC_DEFUN(APACHE_TYPE_RLIM_T, [
132 AC_CACHE_CHECK([for rlim_t], ac_cv_type_rlim_t, [
134 #include <sys/types.h>
135 #include <sys/time.h>
136 #include <sys/resource.h>
137 ], [rlim_t spoon;], [
138 ac_cv_type_rlim_t=yes
139 ],[ac_cv_type_rlim_t=no
142 if test "$ac_cv_type_rlim_t" = "no" ; then
143 AC_DEFINE(rlim_t, int,
144 [Define to 'int' if <sys/resource.h> doesn't define it for us])
148 dnl APACHE_MODPATH_INIT(modpath)
149 AC_DEFUN(APACHE_MODPATH_INIT,[
151 modpath_current=modules/$1
154 test -d $1 || $srcdir/build/mkdir.sh $modpath_current
155 > $modpath_current/modules.mk
158 AC_DEFUN(APACHE_MODPATH_FINISH,[
159 echo "DISTCLEAN_TARGETS = modules.mk" >> $modpath_current/modules.mk
160 echo "static = $modpath_static" >> $modpath_current/modules.mk
161 echo "shared = $modpath_shared" >> $modpath_current/modules.mk
162 if test ! -z "$modpath_static" -o ! -z "$modpath_shared"; then
163 MODULE_DIRS="$MODULE_DIRS $current_dir"
165 MODULE_CLEANDIRS="$MODULE_CLEANDIRS $current_dir"
167 APACHE_FAST_OUTPUT($modpath_current/Makefile)
170 dnl APACHE_MODPATH_ADD(name[, shared[, objects [, ldflags[, libs]]]])
171 AC_DEFUN(APACHE_MODPATH_ADD,[
172 if test -z "$3"; then
178 if test -z "$module_standalone"; then
179 if test -z "$2"; then
180 # The filename of a convenience library must have a "lib" prefix:
181 libname="libmod_$1.la"
182 BUILTIN_LIBS="$BUILTIN_LIBS $modpath_current/$libname"
183 modpath_static="$modpath_static $libname"
184 cat >>$modpath_current/modules.mk<<EOF
186 \$(MOD_LINK) $objects $5
188 if test ! -z "$5"; then
189 APR_ADDTO(AP_LIBS, [$5])
192 apache_need_shared=yes
194 shobjects=`echo $objects | sed 's/\.lo/.slo/g'`
195 modpath_shared="$modpath_shared $libname"
196 cat >>$modpath_current/modules.mk<<EOF
198 \$(SH_LINK) -rpath \$(libexecdir) -module -avoid-version $4 $objects $5
205 dnl APACHE_MPM_MODULE(name[, shared[, objects[, config[, path[, libs]]]]])
207 dnl Provide information for building the MPM. (Enablement is handled using
208 dnl --with-mpm/--enable-mpms-shared.)
210 dnl name -- name of MPM, same as MPM directory name
211 dnl shared -- "shared" to indicate shared module build, empty string otherwise
212 dnl objects -- one or more .lo files to link into the MPM module (default: mpmname.lo)
213 dnl config -- configuration logic to run if the MPM is enabled
214 dnl path -- relative path to MPM (default: server/mpm/mpmname)
215 dnl libs -- libs needed by this MPM
217 AC_DEFUN(APACHE_MPM_MODULE,[
218 if ap_mpm_is_enabled $1; then
219 if test -z "$3"; then
225 if test -z "$5"; then
226 mpmpath="server/mpm/$1"
232 test -d $mpmpath || $srcdir/build/mkdir.sh $mpmpath
234 APACHE_FAST_OUTPUT($mpmpath/Makefile)
236 if test -z "$2"; then
237 APR_ADDTO(AP_LIBS, [$6])
239 cat >$mpmpath/modules.mk<<EOF
241 \$(MOD_LINK) $objects
242 DISTCLEAN_TARGETS = modules.mk
247 apache_need_shared=yes
248 libname="mod_mpm_$1.la"
249 shobjects=`echo $objects | sed 's/\.lo/.slo/g'`
250 cat >$mpmpath/modules.mk<<EOF
252 \$(SH_LINK) -rpath \$(libexecdir) -module -avoid-version $objects $6
253 DISTCLEAN_TARGETS = modules.mk
257 # add default MPM to LoadModule list
258 if test $1 = $default_mpm; then
259 DSO_MODULES="$DSO_MODULES mpm_$1"
260 ENABLED_DSO_MODULES="${ENABLED_DSO_MODULES},mpm_$1"
268 dnl APACHE_MODULE(name, helptext[, objects[, structname[, default[, config[, prereq_module]]]]])
270 dnl default is one of:
271 dnl yes -- enabled by default. user must explicitly disable.
272 dnl no -- disabled under default, most, all. user must explicitly enable.
273 dnl most -- disabled by default. enabled explicitly or with most or all.
274 dnl static -- enabled as static by default, must be explicitly changed.
275 dnl "" -- disabled under default, most. enabled explicitly or with all.
276 dnl XXX: The arg must really be empty here. Passing an empty shell
277 dnl XXX: variable doesn't work for some reason. This should be
280 dnl basically: yes/no is a hard setting. "most" means follow the "most"
281 dnl setting. otherwise, fall under the "all" setting.
282 dnl explicit yes/no always overrides, except if the user selects
285 dnl prereq_module is a module (without the "mod_" prefix) that must be enabled
286 dnl if the current module is enabled. If the current module is built
287 dnl statically, prereq_module must be built statically, too. If these
288 dnl conditions are not fulfilled, configure will abort if the current module
289 dnl has been enabled explicitly. Otherwise, configure will disable the
291 dnl prereq_module's APACHE_MODULE() statement must have been processed
292 dnl before the current APACHE_MODULE() statement.
294 AC_DEFUN(APACHE_MODULE,[
295 AC_MSG_CHECKING(whether to enable mod_$1)
296 define([optname],[--]ifelse($5,yes,disable,enable)[-]translit($1,_,-))dnl
297 AC_ARG_ENABLE(translit($1,_,-),APACHE_HELP_STRING(optname(),$2),force_$1=$enableval,enable_$1=ifelse($5,,maybe-all,$5))
298 undefine([optname])dnl
300 dnl When --enable-modules=most or --enable-modules=(really)all is set and the
301 dnl module was not explicitly requested, allow a module to disable itself if
302 dnl its pre-reqs fail.
305 _apmod_required="yes"
308 case "$module_selection" in
313 _apmod_required="yes"
317 if test "$enable_$1" = "static"; then
319 elif test "$enable_$1" = "yes"; then
320 enable_$1=$module_default
321 elif test "$enable_$1" = "most"; then
322 if test "$module_selection" = "most" -o "$module_selection" = "all" -o \
323 "$module_selection" = "reallyall"
325 enable_$1=$module_default
326 elif test "$module_selection" = "few" -o "$module_selection" = "none"; then
329 _apmod_extra_msg=" ($module_selection)"
330 elif test "$enable_$1" = "maybe-all"; then
331 if test "$module_selection" = "all" -o "$module_selection" = "reallyall"
333 enable_$1=$module_default
334 _apmod_extra_msg=" ($module_selection)"
338 elif test "$enable_$1" = "no" -a "$module_selection" = "reallyall" -a \
339 "$force_$1" != "no" ; then
340 enable_$1=$module_default
341 _apmod_extra_msg=" ($module_selection)"
343 if test "$enable_$1" != "no"; then
344 dnl If we plan to enable it, allow the module to run some autoconf magic
345 dnl that may disable it because of missing dependencies.
347 [AC_MSG_RESULT([checking dependencies])
348 ifelse([$7],,:,[if test "$enable_$7" = "no" ; then
350 AC_MSG_WARN("mod_$7 is disabled but required for mod_$1")
351 elif test "$enable_$1" = "static" && test "$enable_$7" != "static" ; then
353 AC_MSG_WARN("cannot build mod_$1 statically if mod_$7 is built shared")
355 ifelse([$6],,:,[ $6])
357 AC_MSG_CHECKING(whether to enable mod_$1)
358 if test "$enable_$1" = "no"; then
359 if test "$_apmod_required" = "no"; then
360 _apmod_extra_msg=" (disabled)"
362 AC_MSG_ERROR([mod_$1 has been requested but can not be built due to prerequisite failures])
366 AC_MSG_RESULT($enable_$1$_apmod_extra_msg)
367 if test "$enable_$1" != "no"; then
370 MODLIST="$MODLIST ifelse($4,,$1,$4)"
371 if test "$1" = "so"; then
376 enable_$1=`echo $enable_$1|sed 's/shared,*//'`
379 DSO_MODULES="$DSO_MODULES $1"
380 if test "$5" = "yes" ; then
381 ENABLED_DSO_MODULES="${ENABLED_DSO_MODULES},$1"
385 define([modprefix], [MOD_]translit($1, [a-z-], [A-Z_]))
386 APACHE_MODPATH_ADD($1, $shared, $3,, [\$(]modprefix[_LDADD)])
387 APACHE_SUBST(modprefix[_LDADD])
388 undefine([modprefix])
393 dnl APACHE_ENABLE_MODULES
395 AC_DEFUN(APACHE_ENABLE_MODULES,[
396 module_selection=most
397 module_default=shared
399 dnl Check whether we have DSO support.
400 dnl If "yes", we build shared modules by default.
401 APR_CHECK_APR_DEFINE(APR_HAS_DSO)
403 if test $ac_cv_define_APR_HAS_DSO = "no"; then
404 AC_MSG_WARN([Missing DSO support - building static modules by default.])
405 module_default=static
409 AC_ARG_ENABLE(modules,
410 APACHE_HELP_STRING(--enable-modules=MODULE-LIST,Space-separated list of modules to enable | "all" | "most" | "few" | "none" | "reallyall"),[
411 if test "$enableval" = "none"; then
413 module_selection=none
415 for i in $enableval; do
416 if test "$i" = "all" -o "$i" = "most" -o "$i" = "few" -o "$i" = "reallyall"
420 i=`echo $i | sed 's/-/_/g'`
421 eval "enable_$i=shared"
427 AC_ARG_ENABLE(mods-shared,
428 APACHE_HELP_STRING(--enable-mods-shared=MODULE-LIST,Space-separated list of shared modules to enable | "all" | "most" | "few" | "reallyall"),[
429 for i in $enableval; do
430 if test "$i" = "all" -o "$i" = "most" -o "$i" = "few" -o "$i" = "reallyall"
433 module_default=shared
435 i=`echo $i | sed 's/-/_/g'`
436 eval "enable_$i=shared"
441 AC_ARG_ENABLE(mods-static,
442 APACHE_HELP_STRING(--enable-mods-static=MODULE-LIST,Space-separated list of static modules to enable | "all" | "most" | "few" | "reallyall"),[
443 for i in $enableval; do
444 if test "$i" = "all" -o "$i" = "most" -o "$i" = "few" -o "$i" = "reallyall"; then
446 module_default=static
448 i=`echo $i | sed 's/-/_/g'`
449 eval "enable_$i=static"
455 AC_DEFUN(APACHE_REQUIRE_CXX,[
456 if test -z "$apache_cxx_done"; then
464 dnl APACHE_CHECK_OPENSSL
466 dnl Configure for OpenSSL, giving preference to
467 dnl "--with-ssl=<path>" if it was specified.
469 AC_DEFUN(APACHE_CHECK_OPENSSL,[
470 AC_CACHE_CHECK([for OpenSSL], [ac_cv_openssl], [
471 dnl initialise the variables we use
477 dnl Determine the OpenSSL base directory, if any
478 AC_MSG_CHECKING([for user-provided OpenSSL base directory])
479 AC_ARG_WITH(ssl, APACHE_HELP_STRING(--with-ssl=DIR,OpenSSL base directory), [
480 dnl If --with-ssl specifies a directory, we use that directory
481 if test "x$withval" != "xyes" -a "x$withval" != "x"; then
482 dnl This ensures $withval is actually a directory and that it is absolute
483 ap_openssl_base="`cd $withval ; pwd`"
486 if test "x$ap_openssl_base" = "x"; then
489 AC_MSG_RESULT($ap_openssl_base)
492 dnl Run header and version checks
493 saved_CPPFLAGS="$CPPFLAGS"
495 saved_LDFLAGS="$LDFLAGS"
498 dnl Before doing anything else, load in pkg-config variables
499 if test -n "$PKGCONFIG"; then
500 saved_PKG_CONFIG_PATH="$PKG_CONFIG_PATH"
501 if test "x$ap_openssl_base" != "x" -a \
502 -f "${ap_openssl_base}/lib/pkgconfig/openssl.pc"; then
503 dnl Ensure that the given path is used by pkg-config too, otherwise
504 dnl the system openssl.pc might be picked up instead.
505 PKG_CONFIG_PATH="${ap_openssl_base}/lib/pkgconfig${PKG_CONFIG_PATH+:}${PKG_CONFIG_PATH}"
506 export PKG_CONFIG_PATH
508 ap_openssl_libs="`$PKGCONFIG --libs-only-l openssl 2>&1`"
509 if test $? -eq 0; then
510 ap_openssl_found="yes"
511 pkglookup="`$PKGCONFIG --cflags-only-I openssl`"
512 APR_ADDTO(CPPFLAGS, [$pkglookup])
513 APR_ADDTO(INCLUDES, [$pkglookup])
514 pkglookup="`$PKGCONFIG --libs-only-L --libs-only-other openssl`"
515 APR_ADDTO(LDFLAGS, [$pkglookup])
516 APR_ADDTO(SSL_LIBS, [$pkglookup])
518 PKG_CONFIG_PATH="$saved_PKG_CONFIG_PATH"
521 dnl fall back to the user-supplied directory if not found via pkg-config
522 if test "x$ap_openssl_base" != "x" -a "x$ap_openssl_found" = "x"; then
523 APR_ADDTO(CPPFLAGS, [-I$ap_openssl_base/include])
524 APR_ADDTO(INCLUDES, [-I$ap_openssl_base/include])
525 APR_ADDTO(LDFLAGS, [-L$ap_openssl_base/lib])
526 APR_ADDTO(SSL_LIBS, [-L$ap_openssl_base/lib])
527 if test "x$ap_platform_runtime_link_flag" != "x"; then
528 APR_ADDTO(LDFLAGS, [$ap_platform_runtime_link_flag$ap_openssl_base/lib])
529 APR_ADDTO(SSL_LIBS, [$ap_platform_runtime_link_flag$ap_openssl_base/lib])
533 AC_MSG_CHECKING([for OpenSSL version >= 0.9.7])
534 AC_TRY_COMPILE([#include <openssl/opensslv.h>],[
535 #if !defined(OPENSSL_VERSION_NUMBER)
536 #error "Missing OpenSSL version"
538 #if OPENSSL_VERSION_NUMBER < 0x0090700f
539 #error "Unsupported OpenSSL version " OPENSSL_VERSION_TEXT
543 [AC_MSG_RESULT(FAILED)])
545 if test "x$ac_cv_openssl" = "xyes"; then
546 ap_openssl_libs="-lssl -lcrypto `$apr_config --libs`"
547 APR_ADDTO(SSL_LIBS, [$ap_openssl_libs])
548 APR_ADDTO(LIBS, [$ap_openssl_libs])
549 APACHE_SUBST(SSL_LIBS)
551 dnl Run library and function checks
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])
556 if test "x$liberrors" != "x"; then
557 AC_MSG_WARN([OpenSSL libraries are unusable])
560 AC_MSG_WARN([OpenSSL version is too old])
564 CPPFLAGS="$saved_CPPFLAGS"
566 LDFLAGS="$saved_LDFLAGS"
568 if test "x$ac_cv_openssl" = "xyes"; then
569 AC_DEFINE(HAVE_OPENSSL, 1, [Define if OpenSSL is available])
574 dnl APACHE_EXPORT_ARGUMENTS
575 dnl Export (via APACHE_SUBST) the various path-related variables that
576 dnl apache will use while generating scripts like autoconf and apxs and
577 dnl the default config file.
579 AC_DEFUN(APACHE_SUBST_EXPANDED_ARG,[
580 APR_EXPAND_VAR(exp_$1, [$]$1)
582 APR_PATH_RELATIVE(rel_$1, [$]exp_$1, ${prefix})
586 AC_DEFUN(APACHE_EXPORT_ARGUMENTS,[
587 APACHE_SUBST_EXPANDED_ARG(exec_prefix)
588 APACHE_SUBST_EXPANDED_ARG(bindir)
589 APACHE_SUBST_EXPANDED_ARG(sbindir)
590 APACHE_SUBST_EXPANDED_ARG(libdir)
591 APACHE_SUBST_EXPANDED_ARG(libexecdir)
592 APACHE_SUBST_EXPANDED_ARG(mandir)
593 APACHE_SUBST_EXPANDED_ARG(sysconfdir)
594 APACHE_SUBST_EXPANDED_ARG(datadir)
595 APACHE_SUBST_EXPANDED_ARG(installbuilddir)
596 APACHE_SUBST_EXPANDED_ARG(errordir)
597 APACHE_SUBST_EXPANDED_ARG(iconsdir)
598 APACHE_SUBST_EXPANDED_ARG(htdocsdir)
599 APACHE_SUBST_EXPANDED_ARG(manualdir)
600 APACHE_SUBST_EXPANDED_ARG(cgidir)
601 APACHE_SUBST_EXPANDED_ARG(includedir)
602 APACHE_SUBST_EXPANDED_ARG(localstatedir)
603 APACHE_SUBST_EXPANDED_ARG(runtimedir)
604 APACHE_SUBST_EXPANDED_ARG(logfiledir)
605 APACHE_SUBST_EXPANDED_ARG(proxycachedir)
609 dnl APACHE_CHECK_APxVER({apr|apu}, major, minor,
610 dnl [actions-if-ok], [actions-if-not-ok])
612 dnl Checks for APR or APR-util of given major/minor version or later;
613 dnl if so, runs actions-if-ok; otherwise runs actions-if-not-ok if given.
614 dnl If the version is not satisfactory and actions-if-not-ok is not
615 dnl given, then an error is printed and the configure script is aborted.
617 dnl The first argument must be [apr] or [apu].
619 AC_DEFUN([APACHE_CHECK_APxVER], [
620 define(ap_ckver_major, translit($1, [apru], [APRU])[_MAJOR_VERSION])
621 define(ap_ckver_minor, translit($1, [apru], [APRU])[_MINOR_VERSION])
622 define(ap_ckver_cvar, [ap_cv_$1ver$2$3])
623 define(ap_ckver_name, ifelse([$1],[apr],[APR],[APR-util]))
625 ap_ckver_CPPFLAGS="$CPPFLAGS"
626 CPPFLAGS="$CPPFLAGS `$[$1]_config --includes`"
628 AC_CACHE_CHECK([for ap_ckver_name version $2.$3.0 or later], ap_ckver_cvar, [
629 AC_EGREP_CPP([good], [
630 #include <$1_version.h>
631 #if ]ap_ckver_major[ > $2 || (]ap_ckver_major[ == $2 && ]ap_ckver_minor[ >= $3)
634 ], [ap_ckver_cvar=yes], [ap_ckver_cvar=no])])
636 if test "$ap_ckver_cvar" = "yes"; then
637 ifelse([$4],[],[:],[$4])
639 ifelse([$5],[],[AC_MSG_ERROR([ap_ckver_name version $2.$3.0 or later is required])], [$5])
642 CPPFLAGS="$ap_ckver_CPPFLAGS"
644 undefine([ap_ckver_major])
645 undefine([ap_ckver_minor])
646 undefine([ap_ckver_cvar])
647 undefine([ap_ckver_name])
651 dnl APACHE_CHECK_VOID_PTR_LEN
653 dnl Checks if the size of a void pointer is at least as big as a "long"
656 AC_DEFUN([APACHE_CHECK_VOID_PTR_LEN], [
658 AC_CACHE_CHECK([for void pointer length], [ap_cv_void_ptr_lt_long],
662 return sizeof(void *) < sizeof(long);
663 }], [ap_cv_void_ptr_lt_long=no], [ap_cv_void_ptr_lt_long=yes],
664 [ap_cv_void_ptr_lt_long=yes])])
666 if test "$ap_cv_void_ptr_lt_long" = "yes"; then
667 AC_MSG_ERROR([Size of "void *" is less than size of "long"])
672 dnl APACHE_CHECK_APR_HAS_LDAP
674 dnl Check if APR_HAS_LDAP is 1
675 dnl Unfortunately, we can't use APR_CHECK_APR_DEFINE (because it only includes apr.h)
676 dnl or APR_CHECK_DEFINE (because it only checks for defined'ness and not for 0/1).
678 AC_DEFUN([APACHE_CHECK_APR_HAS_LDAP], [
679 AC_CACHE_CHECK([for ldap support in apr/apr-util],ac_cv_APR_HAS_LDAP,[
680 apache_old_cppflags="$CPPFLAGS"
681 CPPFLAGS="$CPPFLAGS $INCLUDES"
682 AC_EGREP_CPP(YES_IS_DEFINED, [
683 #include <apr_ldap.h>
687 ], ac_cv_APR_HAS_LDAP=yes, ac_cv_APR_HAS_LDAP=no)
688 CPPFLAGS="$apache_old_cppflags"
693 dnl APACHE_ADD_GCC_CFLAGS
695 dnl Check if compiler is gcc and supports flag. If yes, add to CFLAGS.
697 AC_DEFUN([APACHE_ADD_GCC_CFLAG], [
698 define([ap_gcc_ckvar], [ac_cv_gcc_]translit($1, [-:.=], [____]))
699 if test "$GCC" = "yes"; then
700 AC_CACHE_CHECK([whether gcc accepts $1], ap_gcc_ckvar, [
701 save_CFLAGS="$CFLAGS"
703 AC_COMPILE_IFELSE([AC_LANG_SOURCE([int foo() { return 0; }])],
704 [ap_gcc_ckvar=yes], [ap_gcc_ckvar=no])
705 CFLAGS="$save_CFLAGS"
707 if test "$]ap_gcc_ckvar[" = "yes" ; then
708 APR_ADDTO(CFLAGS,[$1])
711 undefine([ap_gcc_ckvar])