From: Manoj Kasichainula Date: Sun, 5 Dec 1999 08:54:39 +0000 (+0000) Subject: autoconf: Generate modules.c based on configuration. This is the first X-Git-Tag: 1.3.10~124 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=869a58d8f701bbd9ef228b40186fa87f07763152;p=apache autoconf: Generate modules.c based on configuration. This is the first step to supporting selection of modules, and it seems to make --with-mpm actually work now. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@84223 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/build/build-modules-c.awk b/build/build-modules-c.awk new file mode 100644 index 0000000000..0da842152e --- /dev/null +++ b/build/build-modules-c.awk @@ -0,0 +1,48 @@ +BEGIN { + RS = " " + modules[n++] = "core" + pmodules[pn++] = "core" +} +{ modules[n++] = $1 ; pmodules[pn++] = $1 } +END { + print "/*" + print " * modules.c --- automatically generated by Apache" + print " * configuration script. DO NOT HAND EDIT!!!!!" + print " */" + print "" + print "#include \"httpd.h\"" + print "#include \"http_config.h\"" + print "" + for (i = 0; i < pn; ++i) { + printf ("extern module %s_module;\n", pmodules[i]) + } + print "" + print "/*" + print " * Modules which implicitly form the" + print " * list of activated modules on startup," + print " * i.e. these are the modules which are" + print " * initially linked into the Apache processing" + print " * [extendable under run-time via AddModule]" + print " */" + print "module *ap_prelinked_modules[] = {" + for (i = 0; i < n; ++i) { + printf " &%s_module,\n", modules[i] + } + print " NULL" + print "};" + print "" + print "/*" + print " * Modules which initially form the" + print " * list of available modules on startup," + print " * i.e. these are the modules which are" + print " * initially loaded into the Apache process" + print " * [extendable under run-time via LoadModule]" + print " */" + print "module *ap_preloaded_modules[] = {" + for (i = 0; i < pn; ++i) { + printf " &%s_module,\n", pmodules[i] + } + print " NULL" + print "};" + print "" +} diff --git a/configure.in b/configure.in index 1534204c35..a36d785e75 100644 --- a/configure.in +++ b/configure.in @@ -23,7 +23,7 @@ cwd=`pwd` dnl ## Check for programs -dnl AC_PROG_AWK +AC_PROG_AWK AC_PROG_CC AC_PROG_CPP AC_PROG_INSTALL @@ -120,5 +120,8 @@ AC_SUBST(MPM_LIB) AC_SUBST(OS) AC_SUBST(OS_DIR) -AC_OUTPUT([Makefile ap/Makefile main/Makefile os/Makefile +dnl ## Build modules.c +rm -f $srcdir/modules.c +echo $MODLIST | $AWK -f $srcdir/helpers/build-modules-c.awk > $srcdir/modules.c +AC_OUTPUT([Makefile ap/Makefile main/Makefile modules/Makefile os/Makefile $APACHE_OUTPUT_FILES]) diff --git a/modules/aaa/config.m4 b/modules/aaa/config.m4 index afbeed66bd..15d5947eb0 100644 --- a/modules/aaa/config.m4 +++ b/modules/aaa/config.m4 @@ -3,4 +3,5 @@ dnl ## mod_usertrack.c AC_CHECK_HEADERS(sys/times.h) AC_CHECK_FUNCS(times) +MODLIST="$MODLIST env config_log mime negotiation includes autoindex dir cgi asis imap action userdir alias access auth setenvif echo" APACHE_MODULE(standard) diff --git a/server/mpm/config.m4 b/server/mpm/config.m4 index 3c30fd07c0..2993250b86 100644 --- a/server/mpm/config.m4 +++ b/server/mpm/config.m4 @@ -18,6 +18,7 @@ MPM_DIR=modules/mpm/$MPM_NAME MPM_LIB=$MPM_DIR/lib${MPM_NAME}.la AC_SUBST(MPM_NAME) +MODLIST="$MODLIST mpm_${MPM_NAME}" dnl All the unix MPMs use shared memory; save a little duplication AC_DEFUN(APACHE_MPM_CHECK_SHMEM, [