acinclude.m4 revision 93f46df41fc5a00f80884d0a35840dec1194449e
d6fa26d0adaec6c910115be34fe7a5a5f402c14fMark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsdnl APACHE_HELP_STRING(LHS, RHS)
f0aad5341752aefe5059832f6cf3abc3283c6e16Tinderbox Userdnl Autoconf 2.50 can not handle substr correctly. It does have
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsdnl AC_HELP_STRING, so let's try to call it if we can.
5347c0fcb04eaea19d9f39795646239f487c6207Tinderbox Userdnl Note: this define must be on one line so that it can be properly returned
5347c0fcb04eaea19d9f39795646239f487c6207Tinderbox Userdnl as the help string.
5347c0fcb04eaea19d9f39795646239f487c6207Tinderbox UserAC_DEFUN(APACHE_HELP_STRING,[ifelse(regexp(AC_ACVERSION, 2\.1), -1, AC_HELP_STRING($1,$2),[ ]$1 substr([ ],len($1))$2)])dnl
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
d6fa26d0adaec6c910115be34fe7a5a5f402c14fMark Andrewsdnl APACHE_SUBST(VARIABLE)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsdnl Makes VARIABLE available in generated files
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsdnl (do not use @variable@ in Makefiles, but $(variable))
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsAC_DEFUN(APACHE_SUBST,[
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User APACHE_VAR_SUBST="$APACHE_VAR_SUBST $1"
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt AC_SUBST($1)
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User])
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
9b469e3c59015b1a4899c9d8395168126fe094fdAutomatic Updaterdnl APACHE_FAST_OUTPUT(FILENAME)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsdnl Perform substitutions on FILENAME (Makefiles only)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsAC_DEFUN(APACHE_FAST_OUTPUT,[
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews APACHE_FAST_OUTPUT_FILES="$APACHE_FAST_OUTPUT_FILES $1"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews])
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsdnl APACHE_GEN_CONFIG_VARS
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsdnl Creates config_vars.mk
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsAC_DEFUN(APACHE_GEN_CONFIG_VARS,[
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews APACHE_SUBST(abs_srcdir)
9b469e3c59015b1a4899c9d8395168126fe094fdAutomatic Updater APACHE_SUBST(bindir)
9b469e3c59015b1a4899c9d8395168126fe094fdAutomatic Updater APACHE_SUBST(sbindir)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews APACHE_SUBST(cgidir)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews APACHE_SUBST(logfiledir)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews APACHE_SUBST(exec_prefix)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews APACHE_SUBST(datadir)
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User APACHE_SUBST(localstatedir)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews APACHE_SUBST(mandir)
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User APACHE_SUBST(libdir)
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User APACHE_SUBST(libexecdir)
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User APACHE_SUBST(htdocsdir)
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User APACHE_SUBST(manualdir)
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User APACHE_SUBST(includedir)
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User APACHE_SUBST(errordir)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews APACHE_SUBST(iconsdir)
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User APACHE_SUBST(sysconfdir)
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User APACHE_SUBST(installbuilddir)
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User APACHE_SUBST(runtimedir)
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User APACHE_SUBST(proxycachedir)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews APACHE_SUBST(other_targets)
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User APACHE_SUBST(progname)
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User APACHE_SUBST(prefix)
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User APACHE_SUBST(AWK)
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User APACHE_SUBST(CC)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews APACHE_SUBST(CPP)
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User APACHE_SUBST(CXX)
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User APACHE_SUBST(CPPFLAGS)
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User APACHE_SUBST(CFLAGS)
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User APACHE_SUBST(CXXFLAGS)
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User APACHE_SUBST(LTFLAGS)
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User APACHE_SUBST(LDFLAGS)
7e71f05d8643aca84914437c900cb716444507e4Tinderbox User APACHE_SUBST(LT_LDFLAGS)
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User APACHE_SUBST(SH_LDFLAGS)
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User APACHE_SUBST(HTTPD_LDFLAGS)
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt APACHE_SUBST(UTIL_LDFLAGS)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews APACHE_SUBST(LIBS)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews APACHE_SUBST(DEFS)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews APACHE_SUBST(INCLUDES)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews APACHE_SUBST(NOTEST_CPPFLAGS)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews APACHE_SUBST(NOTEST_CFLAGS)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews APACHE_SUBST(NOTEST_CXXFLAGS)
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User APACHE_SUBST(NOTEST_LDFLAGS)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews APACHE_SUBST(NOTEST_LIBS)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews APACHE_SUBST(EXTRA_CPPFLAGS)
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User APACHE_SUBST(EXTRA_CFLAGS)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews APACHE_SUBST(EXTRA_CXXFLAGS)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews APACHE_SUBST(EXTRA_LDFLAGS)
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User APACHE_SUBST(EXTRA_LIBS)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews APACHE_SUBST(EXTRA_INCLUDES)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews APACHE_SUBST(LIBTOOL)
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User APACHE_SUBST(SHELL)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews APACHE_SUBST(MODULE_DIRS)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews APACHE_SUBST(MODULE_CLEANDIRS)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews APACHE_SUBST(PORT)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews APACHE_SUBST(nonssl_listen_stmt_1)
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User APACHE_SUBST(nonssl_listen_stmt_2)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews APACHE_SUBST(CORE_IMPLIB_FILE)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews APACHE_SUBST(CORE_IMPLIB)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews APACHE_SUBST(SH_LIBS)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews APACHE_SUBST(SH_LIBTOOL)
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt APACHE_SUBST(MK_IMPLIB)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews APACHE_SUBST(MKDEP)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews APACHE_SUBST(INSTALL_PROG_FLAGS)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews APACHE_SUBST(DSO_MODULES)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews APACHE_SUBST(APR_BINDIR)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews APACHE_SUBST(APR_INCLUDEDIR)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews APACHE_SUBST(APU_BINDIR)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews APACHE_SUBST(APU_INCLUDEDIR)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews abs_srcdir="`(cd $srcdir && pwd)`"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews echo creating config_vars.mk
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews test -d build || $mkdir_p build
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews > build/config_vars.mk
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews for i in $APACHE_VAR_SUBST; do
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews eval echo "$i = \$$i" >> build/config_vars.mk
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews done
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews])
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsdnl APACHE_GEN_MAKEFILES
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsdnl Creates Makefiles
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsAC_DEFUN(APACHE_GEN_MAKEFILES,[
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $SHELL $srcdir/build/fastgen.sh $srcdir $ac_cv_mkdir_p $BSD_MAKEFILE $APACHE_FAST_OUTPUT_FILES
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews])
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsdnl ## APACHE_OUTPUT(file)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsdnl ## adds "file" to the list of files generated by AC_OUTPUT
f6da30bb5447c23d880b09f601441e70c5313557Mark Andrewsdnl ## This macro can be used several times.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsAC_DEFUN(APACHE_OUTPUT, [
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews APACHE_OUTPUT_FILES="$APACHE_OUTPUT_FILES $1"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews])
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox Userdnl
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsdnl APACHE_TYPE_RLIM_T
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsdnl
b2f07642fd712c8fda81a116bcdde229ab291f33Tinderbox Userdnl If rlim_t is not defined, define it to int
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntdnl
b2f07642fd712c8fda81a116bcdde229ab291f33Tinderbox UserAC_DEFUN(APACHE_TYPE_RLIM_T, [
b2f07642fd712c8fda81a116bcdde229ab291f33Tinderbox User AC_CACHE_CHECK([for rlim_t], ac_cv_type_rlim_t, [
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews AC_TRY_COMPILE([
b2f07642fd712c8fda81a116bcdde229ab291f33Tinderbox User#include <sys/types.h>
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#include <sys/time.h>
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#include <sys/resource.h>
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User], [rlim_t spoon;], [
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews ac_cv_type_rlim_t=yes
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt ],[ac_cv_type_rlim_t=no
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews ])
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews ])
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt if test "$ac_cv_type_rlim_t" = "no" ; then
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt AC_DEFINE(rlim_t, int,
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews [Define to 'int' if <sys/resource.h> doesn't define it for us])
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt fi
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews])
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsdnl APACHE_MODPATH_INIT(modpath)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsAC_DEFUN(APACHE_MODPATH_INIT,[
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User current_dir=$1
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User modpath_current=modules/$1
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User modpath_static=
7e71f05d8643aca84914437c900cb716444507e4Tinderbox User modpath_shared=
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User test -d $1 || $srcdir/build/mkdir.sh $modpath_current
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User > $modpath_current/modules.mk
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User])dnl
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsdnl
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsAC_DEFUN(APACHE_MODPATH_FINISH,[
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews echo "DISTCLEAN_TARGETS = modules.mk" >> $modpath_current/modules.mk
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews echo "static = $modpath_static" >> $modpath_current/modules.mk
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews echo "shared = $modpath_shared" >> $modpath_current/modules.mk
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews if test ! -z "$modpath_static" -o ! -z "$modpath_shared"; then
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews MODULE_DIRS="$MODULE_DIRS $current_dir"
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User else
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews MODULE_CLEANDIRS="$MODULE_CLEANDIRS $current_dir"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews fi
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews APACHE_FAST_OUTPUT($modpath_current/Makefile)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews])dnl
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsdnl
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsdnl APACHE_MODPATH_ADD(name[, shared[, objects [, ldflags[, libs]]]])
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox UserAC_DEFUN(APACHE_MODPATH_ADD,[
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews if test -z "$3"; then
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews objects="mod_$1.lo"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews else
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews objects="$3"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews fi
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews if test -z "$module_standalone"; then
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User if test -z "$2"; then
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews libname="mod_$1.la"
b2f07642fd712c8fda81a116bcdde229ab291f33Tinderbox User BUILTIN_LIBS="$BUILTIN_LIBS $modpath_current/$libname"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews modpath_static="$modpath_static $libname"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews cat >>$modpath_current/modules.mk<<EOF
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews$libname: $objects
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews \$(MOD_LINK) $objects
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsEOF
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User else
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews apache_need_shared=yes
b2f07642fd712c8fda81a116bcdde229ab291f33Tinderbox User libname="mod_$1.la"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews shobjects=`echo $objects | sed 's/\.lo/.slo/g'`
d71e2e0c61df16ff37c9934c371a4a60c08974f7Mark Andrews modpath_shared="$modpath_shared $libname"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews cat >>$modpath_current/modules.mk<<EOF
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews$libname: $shobjects
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews \$(SH_LINK) -rpath \$(libexecdir) -module -avoid-version $4 $objects $5
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox UserEOF
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User fi
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt fi
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews])dnl
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsdnl
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsdnl APACHE_MODULE(name, helptext[, objects[, structname[, default[, config]]]])
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsdnl
b2f07642fd712c8fda81a116bcdde229ab291f33Tinderbox Userdnl default is one of:
b2f07642fd712c8fda81a116bcdde229ab291f33Tinderbox Userdnl yes -- enabled by default. user must explicitly disable.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsdnl no -- disabled under default, most, all. user must explicitly enable.
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox Userdnl most -- disabled by default. enabled explicitly or with most or all.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntdnl static -- enabled as static by default, must be explicitly changed.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsdnl "" -- disabled under default, most. enabled explicitly or with all.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsdnl
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox Userdnl basically: yes/no is a hard setting. "most" means follow the "most"
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntdnl setting. otherwise, fall under the "all" setting.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsdnl explicit yes/no always overrides.
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox Userdnl
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsAC_DEFUN(APACHE_MODULE,[
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User AC_MSG_CHECKING(whether to enable mod_$1)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews define([optname],[--]ifelse($5,yes,disable,enable)[-]translit($1,_,-))dnl
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews AC_ARG_ENABLE(translit($1,_,-),APACHE_HELP_STRING(optname(),$2),,enable_$1=ifelse($5,,maybe-all,$5))
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews undefine([optname])dnl
d71e2e0c61df16ff37c9934c371a4a60c08974f7Mark Andrews _apmod_extra_msg=""
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews dnl When --enable-modules=most is set and the module was not explicitly
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews dnl requested, allow a module to disable itself if its pre-reqs fail.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews if test "$module_selection" = "most" -a "$enable_$1" = "most"; then
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User _apmod_error_fatal="no"
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt else
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews _apmod_error_fatal="yes"
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User fi
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews if test "$enable_$1" = "static"; then
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User enable_$1=yes
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User elif test "$enable_$1" = "yes"; then
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User enable_$1=$module_default
7e71f05d8643aca84914437c900cb716444507e4Tinderbox User _apmod_extra_msg=" ($module_selection)"
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User elif test "$enable_$1" = "most"; then
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User if test "$module_selection" = "most" -o "$module_selection" = "all"; then
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews enable_$1=$module_default
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews _apmod_extra_msg=" ($module_selection)"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews elif test "$enable_$1" != "yes"; then
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews enable_$1=no
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews fi
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews elif test "$enable_$1" = "maybe-all"; then
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User if test "$module_selection" = "all"; then
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User enable_$1=$module_default
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User _apmod_extra_msg=" (all)"
7e71f05d8643aca84914437c900cb716444507e4Tinderbox User else
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User enable_$1=no
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User fi
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User fi
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User if test "$enable_$1" != "no"; then
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User dnl If we plan to enable it, allow the module to run some autoconf magic
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User dnl that may disable it because of missing dependencies.
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User ifelse([$6],,:,[AC_MSG_RESULT([checking dependencies])
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User $6
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User AC_MSG_CHECKING(whether to enable mod_$1)
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User if test "$enable_$1" = "no"; then
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews if test "$_apmod_error_fatal" = "no"; then
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews _apmod_extra_msg=" (disabled)"
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User else
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User AC_MSG_ERROR([mod_$1 has been requested but can not be built due to prerequisite failures])
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews fi
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews fi])
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews fi
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews AC_MSG_RESULT($enable_$1$_apmod_extra_msg)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews if test "$enable_$1" != "no"; then
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews case "$enable_$1" in
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews shared*)
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User enable_$1=`echo $ac_n $enable_$1$ac_c|sed 's/shared,*//'`
9b469e3c59015b1a4899c9d8395168126fe094fdAutomatic Updater sharedobjs=yes
9b469e3c59015b1a4899c9d8395168126fe094fdAutomatic Updater shared=yes
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews DSO_MODULES="$DSO_MODULES $1"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews ;;
4abdfc917e6635a7c81d1f931a0c79227e72d025Mark Andrews *)
4abdfc917e6635a7c81d1f931a0c79227e72d025Mark Andrews MODLIST="$MODLIST ifelse($4,,$1,$4)"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews if test "$1" = "so"; then
9b469e3c59015b1a4899c9d8395168126fe094fdAutomatic Updater sharedobjs=yes
9b469e3c59015b1a4899c9d8395168126fe094fdAutomatic Updater fi
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews shared="";;
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews esac
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews APACHE_MODPATH_ADD($1, $shared, $3)
1ca759b3f5c0672b2a66bc02288fe010cabbfe37Tinderbox User fi
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews])dnl
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
dnl
dnl APACHE_ENABLE_MODULES
dnl
AC_DEFUN(APACHE_ENABLE_MODULES,[
module_selection=default
module_default=yes
AC_ARG_ENABLE(modules,
APACHE_HELP_STRING(--enable-modules=MODULE-LIST,Modules to enable),[
for i in $enableval; do
if test "$i" = "all" -o "$i" = "most"; then
module_selection=$i
else
eval "enable_$i=yes"
fi
done
])
AC_ARG_ENABLE(mods-shared,
APACHE_HELP_STRING(--enable-mods-shared=MODULE-LIST,Shared modules to enable),[
for i in $enableval; do
if test "$i" = "all" -o "$i" = "most"; then
module_selection=$i
module_default=shared
else
i=`echo $i | sed 's/-/_/g'`
eval "enable_$i=shared"
fi
done
])
])
AC_DEFUN(APACHE_REQUIRE_CXX,[
if test -z "$apache_cxx_done"; then
AC_PROG_CXX
AC_PROG_CXXCPP
apache_cxx_done=yes
fi
])
dnl
dnl APACHE_CHECK_SSL_TOOLKIT
dnl
dnl Configure for the detected openssl/ssl-c toolkit installation, giving
dnl preference to "--with-ssl=<path>" if it was specified.
dnl
AC_DEFUN(APACHE_CHECK_SSL_TOOLKIT,[
if test "x$ap_ssltk_configured" = "x"; then
dnl initialise the variables we use
ap_ssltk_base=""
ap_ssltk_inc=""
ap_ssltk_lib=""
ap_ssltk_type=""
dnl Determine the SSL/TLS toolkit's base directory, if any
AC_MSG_CHECKING(for SSL/TLS toolkit base)
AC_ARG_WITH(sslc, APACHE_HELP_STRING(--with-sslc=DIR,RSA SSL-C SSL/TLS toolkit), [
dnl If --with-sslc specifies a directory, we use that directory or fail
if test "x$withval" != "xyes" -a "x$withval" != "x"; then
dnl This ensures $withval is actually a directory and that it is absolute
ap_ssltk_base="`cd $withval ; pwd`"
fi
ap_ssltk_type="sslc"
])
AC_ARG_WITH(ssl, APACHE_HELP_STRING(--with-ssl=DIR,OpenSSL SSL/TLS toolkit), [
dnl If --with-ssl specifies a directory, we use that directory or fail
if test "x$withval" != "xyes" -a "x$withval" != "x"; then
dnl This ensures $withval is actually a directory and that it is absolute
ap_ssltk_base="`cd $withval ; pwd`"
fi
])
if test "x$ap_ssltk_base" = "x"; then
AC_MSG_RESULT(none)
else
AC_MSG_RESULT($ap_ssltk_base)
fi
dnl Run header and version checks
saved_CPPFLAGS=$CPPFLAGS
if test "x$ap_ssltk_base" != "x"; then
ap_ssltk_inc="-I$ap_ssltk_base/include"
CPPFLAGS="$CPPFLAGS $ap_ssltk_inc"
fi
if test "x$ap_ssltk_type" = "x"; then
AC_MSG_CHECKING(for OpenSSL version)
dnl First check for manditory headers
AC_CHECK_HEADERS([openssl/opensslv.h openssl/ssl.h], [ap_ssltk_type="openssl"], [])
if test "$ap_ssltk_type" = "openssl"; then
dnl so it's OpenSSL - test for a good version
AC_TRY_COMPILE([#include <openssl/opensslv.h>],[
#if !defined(OPENSSL_VERSION_NUMBER)
#error "Missing openssl version"
#endif
#if (OPENSSL_VERSION_NUMBER < 0x009060af) \
|| ((OPENSSL_VERSION_NUMBER > 0x00907000) && (OPENSSL_VERSION_NUMBER < 0x0090702f))
#error "Insecure openssl version " OPENSSL_VERSION_TEXT
#endif],
[AC_MSG_RESULT(OK)],
[dnl Replace this with OPENSSL_VERSION_TEXT from opensslv.h?
AC_MSG_RESULT([not encouraging])
echo "WARNING: OpenSSL version may contain security vulnerabilities!"
echo " Ensure the latest security patches have been applied!"
])
dnl Look for additional, possibly missing headers
AC_CHECK_HEADERS(openssl/engine.h)
else
AC_MSG_RESULT([no OpenSSL headers found])
fi
fi
if test "$ap_ssltk_type" != "openssl"; then
dnl Might be SSL-C - report, then test anything relevant
AC_MSG_CHECKING(for SSL-C version)
AC_CHECK_HEADERS([sslc.h], [ap_ssltk_type="sslc"], [ap_ssltk_type=""])
if test "$ap_ssltk_type" = "sslc"; then
AC_MSG_CHECKING(for SSL-C version)
AC_TRY_COMPILE([#include <sslc.h>],[
#if !defined(SSLC_VERSION_NUMBER)
#error "Missing SSL-C version"
#endif
#if SSLC_VERSION_NUMBER < 0x2310
#define stringize_ver(x) #x
#error "Insecure SSL-C version " stringize_ver(SSLC_VERSION_NUMBER)
#endif],
[AC_MSG_RESULT(OK)],
[dnl Replace this with SSLC_VERSION_NUMBER?
AC_MSG_RESULT([not encouraging])
echo "WARNING: SSL-C version may contain security vulnerabilities!"
echo " Ensure the latest security patches have been applied!"
])
else
AC_MSG_RESULT([no SSL-C headers found])
fi
fi
dnl restore
CPPFLAGS=$saved_CPPFLAGS
if test "x$ap_ssltk_type" = "x"; then
AC_MSG_ERROR([...No recognized SSL/TLS toolkit detected])
fi
dnl Run library and function checks
saved_LDFLAGS=$LDFLAGS
saved_LIBS=$LIBS
if test "x$ap_ssltk_base" != "x"; then
if test -d "$ap_ssltk_base/lib"; then
ap_ssltk_lib="$ap_ssltk_base/lib"
else
ap_ssltk_lib="$ap_ssltk_base"
fi
LDFLAGS="$LDFLAGS -L$ap_ssltk_lib"
fi
dnl make sure "other" flags are available so libcrypto and libssl can link
LIBS="$LIBS `$apr_config --libs`"
liberrors=""
if test "$ap_ssltk_type" = "openssl"; then
AC_CHECK_LIB(crypto, SSLeay_version, [], [liberrors="yes"])
AC_CHECK_LIB(ssl, SSL_CTX_new, [], [liberrors="yes"])
AC_CHECK_FUNCS(ENGINE_init)
AC_CHECK_FUNCS(ENGINE_load_builtin_engines)
else
AC_CHECK_LIB(sslc, SSLC_library_version, [], [liberrors="yes"])
AC_CHECK_LIB(sslc, SSL_CTX_new, [], [liberrors="yes"])
AC_CHECK_FUNCS(SSL_set_state)
fi
AC_CHECK_FUNCS(SSL_set_cert_store)
dnl restore
LDFLAGS=$saved_LDFLAGS
LIBS=$saved_LIBS
if test "x$liberrors" != "x"; then
AC_MSG_ERROR([... Error, SSL/TLS libraries were missing or unusable])
fi
dnl Adjust apache's configuration based on what we found above.
dnl (a) define preprocessor symbols
if test "$ap_ssltk_type" = "openssl"; then
AC_DEFINE(HAVE_OPENSSL)
else
AC_DEFINE(HAVE_SSLC)
fi
dnl (b) hook up include paths
if test "x$ap_ssltk_inc" != "x"; then
APR_ADDTO(INCLUDES, [$ap_ssltk_inc])
fi
dnl (c) hook up linker paths
if test "x$ap_ssltk_lib" != "x"; then
APR_ADDTO(LDFLAGS, ["-L$ap_ssltk_lib"])
if test "x$ap_platform_runtime_link_flag" != "x"; then
APR_ADDTO(LDFLAGS, ["$ap_platform_runtime_link_flag$ap_ssltk_lib"])
fi
fi
dnl (d) add "-lssl -lcrypto" OR "-lsslc" to LIBS because restoring LIBS
dnl after AC_CHECK_LIB() obliterates any flags AC_CHECK_LIB() added.
if test "$ap_ssltk_type" = "openssl"; then
APR_ADDTO(LIBS, [-lssl -lcrypto])
else
APR_ADDTO(LIBS, [-lsslc])
fi
fi
])
dnl
dnl APACHE_EXPORT_ARGUMENTS
dnl Export (via APACHE_SUBST) the various path-related variables that
dnl apache will use while generating scripts like autoconf and apxs and
dnl the default config file.
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)
])