]> granicus.if.org Git - apache/commitdiff
autoconf: Generate modules.c based on configuration. This is the first
authorManoj Kasichainula <manoj@apache.org>
Sun, 5 Dec 1999 08:54:39 +0000 (08:54 +0000)
committerManoj Kasichainula <manoj@apache.org>
Sun, 5 Dec 1999 08:54:39 +0000 (08:54 +0000)
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

build/build-modules-c.awk [new file with mode: 0644]
configure.in
modules/aaa/config.m4
server/mpm/config.m4

diff --git a/build/build-modules-c.awk b/build/build-modules-c.awk
new file mode 100644 (file)
index 0000000..0da8421
--- /dev/null
@@ -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 ""
+}
index 1534204c35969f130f9cdbca234fd5f4018c6168..a36d785e751c496b36dba5f1a30fd5b96d41200d 100644 (file)
@@ -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])
index afbeed66bd42eb8c4dce4c69db272cdeffad1002..15d5947eb074b05cde854efea4b52c2db925d233 100644 (file)
@@ -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)
index 3c30fd07c0cb05f5108adb220c113a845aff5160..2993250b86a49fb14d746e6eee2f0fa22efb31b5 100644 (file)
@@ -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, [