acinclude.m4 revision 46e7cd430e8f455e19d712c4720f676bbe7b66ff
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl APACHE_HELP_STRING(LHS, RHS)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl Autoconf 2.50 can not handle substr correctly. It does have
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl AC_HELP_STRING, so let's try to call it if we can.
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl Note: this define must be on one line so that it can be properly returned
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl as the help string.
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrinAC_DEFUN(APACHE_HELP_STRING,[ifelse(regexp(AC_ACVERSION, 2\.1), -1, AC_HELP_STRING($1,$2),[ ]$1 substr([ ],len($1))$2)])dnl
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl APACHE_SUBST(VARIABLE)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl Makes VARIABLE available in generated files
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl (do not use @variable@ in Makefiles, but $(variable))
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrinAC_DEFUN(APACHE_SUBST,[
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_VAR_SUBST="$APACHE_VAR_SUBST $1"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin AC_SUBST($1)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl APACHE_FAST_OUTPUT(FILENAME)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl Perform substitutions on FILENAME (Makefiles only)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrinAC_DEFUN(APACHE_FAST_OUTPUT,[
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_FAST_OUTPUT_FILES="$APACHE_FAST_OUTPUT_FILES $1"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl APACHE_GEN_CONFIG_VARS
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl Creates config_vars.mk
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrinAC_DEFUN(APACHE_GEN_CONFIG_VARS,[
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(abs_srcdir)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(bindir)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(sbindir)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(cgidir)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(logfiledir)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(exec_prefix)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(datadir)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(localstatedir)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(mandir)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(libdir)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(libexecdir)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(htdocsdir)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(manualdir)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(includedir)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(errordir)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(iconsdir)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(sysconfdir)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(installbuilddir)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(runtimedir)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(proxycachedir)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(other_targets)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(progname)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(prefix)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(AWK)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(CC)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(CPP)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(CXX)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(CPPFLAGS)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(CFLAGS)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(CXXFLAGS)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(LTFLAGS)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(LDFLAGS)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(LT_LDFLAGS)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(SH_LDFLAGS)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(HTTPD_LDFLAGS)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(UTIL_LDFLAGS)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(LIBS)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(DEFS)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(INCLUDES)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(NOTEST_CPPFLAGS)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(NOTEST_CFLAGS)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(NOTEST_CXXFLAGS)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(NOTEST_LDFLAGS)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(NOTEST_LIBS)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(EXTRA_CPPFLAGS)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(EXTRA_CFLAGS)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(EXTRA_CXXFLAGS)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(EXTRA_LDFLAGS)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(EXTRA_LIBS)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(EXTRA_INCLUDES)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(LIBTOOL)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(SHELL)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(RSYNC)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(MODULE_DIRS)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(MODULE_CLEANDIRS)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(PORT)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(SSLPORT)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(CORE_IMPLIB_FILE)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(CORE_IMPLIB)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(SH_LIBS)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(SH_LIBTOOL)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(MK_IMPLIB)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(MKDEP)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(INSTALL_PROG_FLAGS)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(DSO_MODULES)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(APR_BINDIR)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(APR_INCLUDEDIR)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(APR_VERSION)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(APR_CONFIG)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(APU_BINDIR)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(APU_INCLUDEDIR)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(APU_VERSION)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(APU_CONFIG)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin abs_srcdir="`(cd $srcdir && pwd)`"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin echo creating config_vars.mk
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin test -d build || $mkdir_p build
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin > build/config_vars.mk
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin for i in $APACHE_VAR_SUBST; do
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin eval echo "$i = \$$i" >> build/config_vars.mk
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin done
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl APACHE_GEN_MAKEFILES
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl Creates Makefiles
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrinAC_DEFUN(APACHE_GEN_MAKEFILES,[
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin $SHELL $srcdir/build/fastgen.sh $srcdir $ac_cv_mkdir_p $BSD_MAKEFILE $APACHE_FAST_OUTPUT_FILES
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl ## APACHE_OUTPUT(file)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl ## adds "file" to the list of files generated by AC_OUTPUT
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl ## This macro can be used several times.
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrinAC_DEFUN(APACHE_OUTPUT, [
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_OUTPUT_FILES="$APACHE_OUTPUT_FILES $1"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl APACHE_TYPE_RLIM_T
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl If rlim_t is not defined, define it to int
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrinAC_DEFUN(APACHE_TYPE_RLIM_T, [
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin AC_CACHE_CHECK([for rlim_t], ac_cv_type_rlim_t, [
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin AC_TRY_COMPILE([
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin#include <sys/types.h>
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin#include <sys/time.h>
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin#include <sys/resource.h>
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin], [rlim_t spoon;], [
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin ac_cv_type_rlim_t=yes
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin ],[ac_cv_type_rlim_t=no
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin ])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin ])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin if test "$ac_cv_type_rlim_t" = "no" ; then
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin AC_DEFINE(rlim_t, int,
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin [Define to 'int' if <sys/resource.h> doesn't define it for us])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin fi
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl APACHE_MODPATH_INIT(modpath)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrinAC_DEFUN(APACHE_MODPATH_INIT,[
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin current_dir=$1
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin modpath_current=modules/$1
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin modpath_static=
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin modpath_shared=
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin test -d $1 || $srcdir/build/mkdir.sh $modpath_current
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin > $modpath_current/modules.mk
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin])dnl
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrinAC_DEFUN(APACHE_MODPATH_FINISH,[
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin echo "DISTCLEAN_TARGETS = modules.mk" >> $modpath_current/modules.mk
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin echo "static = $modpath_static" >> $modpath_current/modules.mk
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin echo "shared = $modpath_shared" >> $modpath_current/modules.mk
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin if test ! -z "$modpath_static" -o ! -z "$modpath_shared"; then
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin MODULE_DIRS="$MODULE_DIRS $current_dir"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin else
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin MODULE_CLEANDIRS="$MODULE_CLEANDIRS $current_dir"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin fi
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_FAST_OUTPUT($modpath_current/Makefile)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin])dnl
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl APACHE_MODPATH_ADD(name[, shared[, objects [, ldflags[, libs]]]])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrinAC_DEFUN(APACHE_MODPATH_ADD,[
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin if test -z "$3"; then
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin objects="mod_$1.lo"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin else
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin objects="$3"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin fi
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin if test -z "$module_standalone"; then
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin if test -z "$2"; then
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin # The filename of a convenience library must have a "lib" prefix:
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin libname="libmod_$1.la"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin BUILTIN_LIBS="$BUILTIN_LIBS $modpath_current/$libname"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin modpath_static="$modpath_static $libname"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin cat >>$modpath_current/modules.mk<<EOF
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin$libname: $objects
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin \$(MOD_LINK) $objects $5
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrinEOF
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin if test ! -z "$5"; then
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APR_ADDTO(AP_LIBS, [$5])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin fi
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin else
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin apache_need_shared=yes
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin libname="mod_$1.la"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin shobjects=`echo $objects | sed 's/\.lo/.slo/g'`
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin modpath_shared="$modpath_shared $libname"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin cat >>$modpath_current/modules.mk<<EOF
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin$libname: $shobjects
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin \$(SH_LINK) -rpath \$(libexecdir) -module -avoid-version $4 $objects $5
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrinEOF
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin fi
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin fi
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin])dnl
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl APACHE_MPM_MODULE(name[, shared[, objects[, config[, path[, libs]]]]])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl Provide information for building the MPM. (Enablement is handled using
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl --with-mpm/--enable-mpms-shared.)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl name -- name of MPM, same as MPM directory name
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl shared -- "shared" to indicate shared module build, empty string otherwise
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl objects -- one or more .lo files to link into the MPM module (default: mpmname.lo)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl config -- configuration logic to run if the MPM is enabled
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl path -- relative path to MPM (default: server/mpm/mpmname)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl libs -- libs needed by this MPM
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrinAC_DEFUN(APACHE_MPM_MODULE,[
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin if ap_mpm_is_enabled $1; then
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin if test -z "$3"; then
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin objects="$1.lo"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin else
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin objects="$3"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin fi
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin if test -z "$5"; then
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin mpmpath="server/mpm/$1"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin else
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin mpmpath=$5
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin fi
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin dnl VPATH support
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin test -d $mpmpath || $srcdir/build/mkdir.sh $mpmpath
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_FAST_OUTPUT($mpmpath/Makefile)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin if test -z "$2"; then
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APR_ADDTO(AP_LIBS, [$6])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin libname="lib$1.la"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin cat >$mpmpath/modules.mk<<EOF
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin$libname: $objects
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin \$(MOD_LINK) $objects
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrinDISTCLEAN_TARGETS = modules.mk
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrinstatic = $libname
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrinshared =
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrinEOF
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin else
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin apache_need_shared=yes
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin libname="mod_mpm_$1.la"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin shobjects=`echo $objects | sed 's/\.lo/.slo/g'`
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin cat >$mpmpath/modules.mk<<EOF
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin$libname: $shobjects
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin \$(SH_LINK) -rpath \$(libexecdir) -module -avoid-version $objects $6
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrinDISTCLEAN_TARGETS = modules.mk
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrinstatic =
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrinshared = $libname
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrinEOF
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin # add default MPM to LoadModule list
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin if test $1 = $default_mpm; then
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin DSO_MODULES="$DSO_MODULES mpm_$1"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin fi
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin fi
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin $4
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin fi
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin])dnl
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl APACHE_MODULE(name, helptext[, objects[, structname[, default[, config]]]])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl default is one of:
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl yes -- enabled by default. user must explicitly disable.
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl no -- disabled under default, most, all. user must explicitly enable.
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl most -- disabled by default. enabled explicitly or with most or all.
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl static -- enabled as static by default, must be explicitly changed.
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl "" -- disabled under default, most. enabled explicitly or with all.
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl basically: yes/no is a hard setting. "most" means follow the "most"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl setting. otherwise, fall under the "all" setting.
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl explicit yes/no always overrides, except if the user selects
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl "reallyall".
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrinAC_DEFUN(APACHE_MODULE,[
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin AC_MSG_CHECKING(whether to enable mod_$1)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin define([optname],[--]ifelse($5,yes,disable,enable)[-]translit($1,_,-))dnl
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin AC_ARG_ENABLE(translit($1,_,-),APACHE_HELP_STRING(optname(),$2),,enable_$1=ifelse($5,,maybe-all,$5))
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin undefine([optname])dnl
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin _apmod_extra_msg=""
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin dnl When --enable-modules=most or --enable-modules=reallyall is set and the
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin dnl module was not explicitly requested, allow a module to disable itself if
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin dnl its pre-reqs fail.
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin dnl XXX: Todo: Allow to disable specific modules even with "reallyall".
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin if test "$module_selection" = "most" -a "$enable_$1" = "most" ||
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin test "$module_selection" = "reallyall" -a "$enable_$1" != "yes" -a \
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin "$enable_$1" != "static"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin then
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin _apmod_error_fatal="no"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin else
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin _apmod_error_fatal="yes"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin fi
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin if test "$enable_$1" = "static"; then
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin enable_$1=static
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin elif test "$enable_$1" = "yes"; then
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin enable_$1=$module_default
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin elif test "$enable_$1" = "most"; then
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin if test "$module_selection" = "most" -o "$module_selection" = "all" -o \
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin "$module_selection" = "reallyall"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin then
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin enable_$1=$module_default
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin elif test "$module_selection" = "few" -o "$module_selection" = "none"; then
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin enable_$1=no
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin fi
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin _apmod_extra_msg=" ($module_selection)"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin elif test "$enable_$1" = "maybe-all"; then
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin if test "$module_selection" = "all" -o "$module_selection" = "reallyall"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin then
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin enable_$1=$module_default
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin _apmod_extra_msg=" ($module_selection)"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin else
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin enable_$1=no
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin fi
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin elif test "$enable_$1" = "no" -a "$module_selection" = "reallyall"; then
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin enable_$1=$module_default
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin _apmod_extra_msg=" ($module_selection)"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin fi
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin if test "$enable_$1" != "no"; then
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin dnl If we plan to enable it, allow the module to run some autoconf magic
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin dnl that may disable it because of missing dependencies.
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin ifelse([$6],,:,[AC_MSG_RESULT([checking dependencies])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin $6
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin AC_MSG_CHECKING(whether to enable mod_$1)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin if test "$enable_$1" = "no"; then
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin if test "$_apmod_error_fatal" = "no"; then
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin _apmod_extra_msg=" (disabled)"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin else
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin AC_MSG_ERROR([mod_$1 has been requested but can not be built due to prerequisite failures])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin fi
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin fi])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin fi
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin AC_MSG_RESULT($enable_$1$_apmod_extra_msg)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin if test "$enable_$1" != "no"; then
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin case "$enable_$1" in
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin static*)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin MODLIST="$MODLIST ifelse($4,,$1,$4)"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin if test "$1" = "so"; then
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin sharedobjs=yes
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin fi
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin shared="";;
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin *)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin enable_$1=`echo $enable_$1|sed 's/shared,*//'`
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin sharedobjs=yes
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin shared=yes
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin DSO_MODULES="$DSO_MODULES $1"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin ;;
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin esac
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin define([modprefix], [MOD_]translit($1, [a-z-], [A-Z_]))
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_MODPATH_ADD($1, $shared, $3,, [\$(]modprefix[_LDADD)])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(modprefix[_LDADD])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin undefine([modprefix])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin fi
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin])dnl
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl APACHE_ENABLE_MODULES
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrinAC_DEFUN(APACHE_ENABLE_MODULES,[
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin module_selection=most
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin module_default=shared
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin dnl Check whether we have DSO support.
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin dnl If "yes", we build shared modules by default.
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APR_CHECK_APR_DEFINE(APR_HAS_DSO)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin if test $ac_cv_define_APR_HAS_DSO = "no"; then
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin AC_MSG_WARN([Missing DSO support - building static modules by default.])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin module_default=static
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin fi
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin AC_ARG_ENABLE(modules,
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_HELP_STRING(--enable-modules=MODULE-LIST,Space-separated list of modules to enable | "all" | "most" | "few" | "none"| "reallyall"),[
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin if test "$enableval" = "none"; then
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin module_default=no
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin module_selection=none
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin else
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin for i in $enableval; do
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin if test "$i" = "all" -o "$i" = "most" -o "$i" = "few" -o "$i" = "reallyall"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin then
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin module_selection=$i
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin else
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin i=`echo $i | sed 's/-/_/g'`
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin eval "enable_$i=shared"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin fi
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin done
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin fi
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin ])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin AC_ARG_ENABLE(mods-shared,
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_HELP_STRING(--enable-mods-shared=MODULE-LIST,Space-separated list of shared modules to enable | "all" | "most" | "few"| "reallyall"),[
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin for i in $enableval; do
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin if test "$i" = "all" -o "$i" = "most" -o "$i" = "few" -o "$i" = "reallyall"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin then
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin module_selection=$i
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin module_default=shared
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin else
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin i=`echo $i | sed 's/-/_/g'`
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin eval "enable_$i=shared"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin fi
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin done
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin ])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin AC_ARG_ENABLE(mods-static,
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_HELP_STRING(--enable-mods-static=MODULE-LIST,Space-separated list of static modules to enable | "all" | "most" | "few"),[
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin for i in $enableval; do
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin if test "$i" = "all" -o "$i" = "most" -o "$i" = "few"; then
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin module_selection=$i
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin module_default=static
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin else
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin i=`echo $i | sed 's/-/_/g'`
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin eval "enable_$i=static"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin fi
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin done
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin ])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrinAC_DEFUN(APACHE_REQUIRE_CXX,[
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin if test -z "$apache_cxx_done"; then
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin AC_PROG_CXX
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin AC_PROG_CXXCPP
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin apache_cxx_done=yes
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin fi
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl APACHE_CHECK_SSL_TOOLKIT
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl Configure for the detected openssl/ssl-c toolkit installation, giving
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl preference to "--with-ssl=<path>" if it was specified.
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrinAC_DEFUN(APACHE_CHECK_SSL_TOOLKIT,[
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrinif test "x$ap_ssltk_configured" = "x"; then
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin dnl initialise the variables we use
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin ap_ssltk_found=""
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin ap_ssltk_base=""
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin ap_ssltk_libs=""
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin ap_ssltk_type=""
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin dnl Determine the SSL/TLS toolkit's base directory, if any
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin AC_MSG_CHECKING([for user-provided SSL/TLS toolkit base])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin AC_ARG_WITH(sslc, APACHE_HELP_STRING(--with-sslc=DIR,RSA SSL-C SSL/TLS toolkit), [
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin dnl If --with-sslc specifies a directory, we use that directory or fail
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin if test "x$withval" != "xyes" -a "x$withval" != "x"; then
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin dnl This ensures $withval is actually a directory and that it is absolute
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin ap_ssltk_base="`cd $withval ; pwd`"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin fi
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin ap_ssltk_type="sslc"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin ])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin AC_ARG_WITH(ssl, APACHE_HELP_STRING(--with-ssl=DIR,OpenSSL SSL/TLS toolkit), [
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin dnl If --with-ssl specifies a directory, we use that directory or fail
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin if test "x$withval" != "xyes" -a "x$withval" != "x"; then
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin dnl This ensures $withval is actually a directory and that it is absolute
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin ap_ssltk_base="`cd $withval ; pwd`"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin fi
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin ])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin if test "x$ap_ssltk_base" = "x"; then
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin AC_MSG_RESULT(none)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin else
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin AC_MSG_RESULT($ap_ssltk_base)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin fi
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin dnl Run header and version checks
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin saved_CPPFLAGS="$CPPFLAGS"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin saved_LIBS="$LIBS"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin saved_LDFLAGS="$LDFLAGS"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin SSL_LIBS=""
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin dnl Before doing anything else, load in pkg-config variables (if not sslc).
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin if test "x$ap_ssltk_type" = "x" -a -n "$PKGCONFIG"; then
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin saved_PKG_CONFIG_PATH="$PKG_CONFIG_PATH"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin if test "x$ap_ssltk_base" != "x" -a \
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin -f "${ap_ssltk_base}/lib/pkgconfig/openssl.pc"; then
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin dnl Ensure that the given path is used by pkg-config too, otherwise
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin dnl the system openssl.pc might be picked up instead.
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin PKG_CONFIG_PATH="${ap_ssltk_base}/lib/pkgconfig${PKG_CONFIG_PATH+:}${PKG_CONFIG_PATH}"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin export PKG_CONFIG_PATH
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin fi
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin ap_ssltk_libs="`$PKGCONFIG --libs-only-l openssl 2>&1`"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin if test $? -eq 0; then
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin ap_ssltk_found="yes"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin pkglookup="`$PKGCONFIG --cflags-only-I openssl`"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APR_ADDTO(CPPFLAGS, [$pkglookup])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APR_ADDTO(INCLUDES, [$pkglookup])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin pkglookup="`$PKGCONFIG --libs-only-L --libs-only-other openssl`"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APR_ADDTO(LDFLAGS, [$pkglookup])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APR_ADDTO(SSL_LIBS, [$pkglookup])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin fi
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin PKG_CONFIG_PATH="$saved_PKG_CONFIG_PATH"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin fi
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin if test "x$ap_ssltk_base" != "x" -a "x$ap_ssltk_found" = "x"; then
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APR_ADDTO(CPPFLAGS, [-I$ap_ssltk_base/include])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APR_ADDTO(INCLUDES, [-I$ap_ssltk_base/include])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APR_ADDTO(LDFLAGS, [-L$ap_ssltk_base/lib])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APR_ADDTO(SSL_LIBS, [-L$ap_ssltk_base/lib])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin if test "x$ap_platform_runtime_link_flag" != "x"; then
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APR_ADDTO(LDFLAGS, [$ap_platform_runtime_link_flag$ap_ssltk_base/lib])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APR_ADDTO(SSL_LIBS, [$ap_platform_runtime_link_flag$ap_ssltk_base/lib])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin fi
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin fi
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin if test "x$ap_ssltk_type" = "x"; then
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin dnl First check for manditory headers
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin AC_CHECK_HEADERS([openssl/opensslv.h openssl/ssl.h], [ap_ssltk_type="openssl"], [])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin if test "$ap_ssltk_type" = "openssl"; then
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin dnl so it's OpenSSL - test for a good version
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin AC_MSG_CHECKING([for OpenSSL version])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin AC_TRY_COMPILE([#include <openssl/opensslv.h>],[
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin#if !defined(OPENSSL_VERSION_NUMBER)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin#error "Missing openssl version"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin#endif
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin#if (OPENSSL_VERSION_NUMBER < 0x009060af) \
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin || ((OPENSSL_VERSION_NUMBER > 0x00907000) && (OPENSSL_VERSION_NUMBER < 0x0090702f))
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin#error "Insecure openssl version " OPENSSL_VERSION_TEXT
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin#endif],
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin [AC_MSG_RESULT(OK)],
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin [dnl Replace this with OPENSSL_VERSION_TEXT from opensslv.h?
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin AC_MSG_RESULT([not encouraging])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin AC_MSG_WARN([OpenSSL version may contain security vulnerabilities!]
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin [ Ensure the latest security patches have been applied!])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin ])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin else
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin AC_MSG_RESULT([no OpenSSL headers found])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin fi
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin fi
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin if test "$ap_ssltk_type" != "openssl"; then
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin dnl Might be SSL-C - report, then test anything relevant
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin AC_CHECK_HEADERS([sslc.h], [ap_ssltk_type="sslc"], [ap_ssltk_type=""])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin if test "$ap_ssltk_type" = "sslc"; then
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin ap_ssltk_libs="-lsslc"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin AC_MSG_CHECKING([for SSL-C version])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin AC_TRY_COMPILE([#include <sslc.h>],[
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin#if !defined(SSLC_VERSION_NUMBER)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin#error "Missing SSL-C version"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin#endif
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin#if SSLC_VERSION_NUMBER < 0x2310
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin#define stringize_ver(x) #x
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin#error "Insecure SSL-C version " stringize_ver(SSLC_VERSION_NUMBER)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin#endif],
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin [AC_MSG_RESULT(OK)],
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin [dnl Replace this with SSLC_VERSION_NUMBER?
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin AC_MSG_RESULT([not encouraging])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin echo "WARNING: SSL-C version may contain security vulnerabilities!"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin echo " Ensure the latest security patches have been applied!"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin ])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin else
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin AC_MSG_RESULT([no SSL-C headers found])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin fi
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin fi
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin if test "x$ap_ssltk_type" = "x"; then
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin AC_MSG_ERROR([...No recognized SSL/TLS toolkit detected])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin fi
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin if test "$ap_ssltk_type" = "openssl" -a "x$ap_ssltk_found" = "x"; then
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin ap_ssltk_found="yes"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin ap_ssltk_libs="-lssl -lcrypto `$apr_config --libs`"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin fi
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APR_ADDTO(SSL_LIBS, [$ap_ssltk_libs])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APR_ADDTO(LIBS, [$ap_ssltk_libs])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(SSL_LIBS)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin dnl Run library and function checks
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin liberrors=""
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin if test "$ap_ssltk_type" = "openssl"; then
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin AC_CHECK_HEADERS([openssl/engine.h])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin AC_CHECK_FUNCS([SSLeay_version SSL_CTX_new], [], [liberrors="yes"])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin AC_CHECK_FUNCS([ENGINE_init ENGINE_load_builtin_engines])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin else
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin AC_CHECK_FUNCS([SSLC_library_version SSL_CTX_new], [], [liberrors="yes"])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin AC_CHECK_FUNCS(SSL_set_state)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin fi
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin dnl restore
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin CPPFLAGS="$saved_CPPFLAGS"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin LIBS="$saved_LIBS"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin LDFLAGS="$saved_LDFLAGS"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin if test "x$liberrors" != "x"; then
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin AC_MSG_ERROR([... Error, SSL/TLS libraries were missing or unusable])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin fi
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin dnl Adjust apache's configuration based on what we found above.
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin dnl (a) define preprocessor symbols
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin if test "$ap_ssltk_type" = "openssl"; then
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin AC_DEFINE(HAVE_OPENSSL, 1, [Define if SSL is supported using OpenSSL])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin else
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin AC_DEFINE(HAVE_SSLC, 1, [Define if SSL is supported using SSL-C])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin fi
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrinfi
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl APACHE_CHECK_SERF
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl Configure for the detected libserf, giving preference to
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl "--with-serf=<path>" if it was specified.
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrinAC_DEFUN([APACHE_CHECK_SERF], [
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin AC_CACHE_CHECK([for libserf], [ac_cv_serf], [
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin ac_cv_serf=no
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin serf_prefix=/usr
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin SERF_LIBS=""
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin AC_ARG_WITH(serf, APACHE_HELP_STRING([--with-serf=PREFIX],
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin [Serf client library]),
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin [
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin if test "$withval" = "yes" ; then
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin serf_prefix=/usr
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin else
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin serf_prefix=$withval
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin fi
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin ])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin if test "$serf_prefix" != "no" ; then
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin save_cppflags="$CPPFLAGS"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin CPPFLAGS="$CPPFLAGS $APR_INCLUDES $APU_INCLUDES -I$serf_prefix/include/serf-0"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin AC_CHECK_HEADERS(serf.h,[
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin save_ldflags="$LDFLAGS"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin LDFLAGS="$LDFLAGS -L$serf_prefix/lib"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin AC_CHECK_LIB(serf-0, serf_context_create,[ac_cv_serf="yes"])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin LDFLAGS="$save_ldflags"])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin CPPFLAGS="$save_cppflags"
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin fi
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin ])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APACHE_SUBST(SERF_LIBS)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin if test "$ac_cv_serf" = "yes"; then
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin AC_DEFINE(HAVE_SERF, 1, [Define if libserf is available])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APR_SETVAR(SERF_LIBS, [-L$serf_prefix/lib -lserf-0])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin APR_ADDTO(INCLUDES, [-I$serf_prefix/include/serf-0])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin fi
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin])
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl APACHE_EXPORT_ARGUMENTS
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl Export (via APACHE_SUBST) the various path-related variables that
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl apache will use while generating scripts like autoconf and apxs and
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrindnl the default config file.
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin
AC_DEFUN(APACHE_SUBST_EXPANDED_ARG,[
APR_EXPAND_VAR(exp_$1, [$]$1)
APACHE_SUBST(exp_$1)
APR_PATH_RELATIVE(rel_$1, [$]exp_$1, ${prefix})
APACHE_SUBST(rel_$1)
])
AC_DEFUN(APACHE_EXPORT_ARGUMENTS,[
APACHE_SUBST_EXPANDED_ARG(exec_prefix)
APACHE_SUBST_EXPANDED_ARG(bindir)
APACHE_SUBST_EXPANDED_ARG(sbindir)
APACHE_SUBST_EXPANDED_ARG(libdir)
APACHE_SUBST_EXPANDED_ARG(libexecdir)
APACHE_SUBST_EXPANDED_ARG(mandir)
APACHE_SUBST_EXPANDED_ARG(sysconfdir)
APACHE_SUBST_EXPANDED_ARG(datadir)
APACHE_SUBST_EXPANDED_ARG(installbuilddir)
APACHE_SUBST_EXPANDED_ARG(errordir)
APACHE_SUBST_EXPANDED_ARG(iconsdir)
APACHE_SUBST_EXPANDED_ARG(htdocsdir)
APACHE_SUBST_EXPANDED_ARG(manualdir)
APACHE_SUBST_EXPANDED_ARG(cgidir)
APACHE_SUBST_EXPANDED_ARG(includedir)
APACHE_SUBST_EXPANDED_ARG(localstatedir)
APACHE_SUBST_EXPANDED_ARG(runtimedir)
APACHE_SUBST_EXPANDED_ARG(logfiledir)
APACHE_SUBST_EXPANDED_ARG(proxycachedir)
])
dnl
dnl APACHE_CHECK_APxVER({apr|apu}, major, minor,
dnl [actions-if-ok], [actions-if-not-ok])
dnl
dnl Checks for APR or APR-util of given major/minor version or later;
dnl if so, runs actions-if-ok; otherwise runs actions-if-not-ok if given.
dnl If the version is not satisfactory and actions-if-not-ok is not
dnl given, then an error is printed and the configure script is aborted.
dnl
dnl The first argument must be [apr] or [apu].
dnl
AC_DEFUN([APACHE_CHECK_APxVER], [
define(ap_ckver_major, translit($1, [apru], [APRU])[_MAJOR_VERSION])
define(ap_ckver_minor, translit($1, [apru], [APRU])[_MINOR_VERSION])
define(ap_ckver_cvar, [ap_cv_$1ver$2$3])
define(ap_ckver_name, ifelse([$1],[apr],[APR],[APR-util]))
ap_ckver_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS `$[$1]_config --includes`"
AC_CACHE_CHECK([for ap_ckver_name version $2.$3.0 or later], ap_ckver_cvar, [
AC_EGREP_CPP([good], [
#include <$1_version.h>
#if ]ap_ckver_major[ > $2 || (]ap_ckver_major[ == $2 && ]ap_ckver_minor[ >= $3)
good
#endif
], [ap_ckver_cvar=yes], [ap_ckver_cvar=no])])
if test "$ap_ckver_cvar" = "yes"; then
ifelse([$4],[],[:],[$4])
else
ifelse([$5],[],[AC_MSG_ERROR([ap_ckver_name version $2.$3.0 or later is required])], [$5])
fi
CPPFLAGS="$ap_ckver_CPPFLAGS"
undefine([ap_ckver_major])
undefine([ap_ckver_minor])
undefine([ap_ckver_cvar])
undefine([ap_ckver_name])
])
dnl
dnl APACHE_CHECK_VOID_PTR_LEN
dnl
dnl Checks if the size of a void pointer is at least as big as a "long"
dnl integer type.
dnl
AC_DEFUN([APACHE_CHECK_VOID_PTR_LEN], [
AC_CACHE_CHECK([for void pointer length], [ap_cv_void_ptr_lt_long],
[AC_TRY_RUN([
int main(void)
{
return sizeof(void *) < sizeof(long);
}], [ap_cv_void_ptr_lt_long=no], [ap_cv_void_ptr_lt_long=yes],
[ap_cv_void_ptr_lt_long=yes])])
if test "$ap_cv_void_ptr_lt_long" = "yes"; then
AC_MSG_ERROR([Size of "void *" is less than size of "long"])
fi
])