]> granicus.if.org Git - apache/blob - build/build-modules-c.awk
Deal with newline at the end of the module list.
[apache] / build / build-modules-c.awk
1 BEGIN {
2     RS = " "
3     modules[n++] = "core"
4     pmodules[pn++] = "core"
5
6 {
7     modules[n] = $1;
8     pmodules[pn] = $1;
9     gsub("\n","",modules[n]);
10     gsub("\n","",pmodules[pn]);
11     ++n;
12     ++pn;
13
14 END {
15     print "/*"
16     print " * modules.c --- automatically generated by Apache"
17     print " * configuration script.  DO NOT HAND EDIT!!!!!"
18     print " */"
19     print ""
20     print "#include \"httpd.h\""
21     print "#include \"http_config.h\""
22     print ""
23     for (i = 0; i < pn; ++i) {
24         printf ("extern module %s_module;\n", pmodules[i])
25     }
26     print ""
27     print "/*"
28     print " *  Modules which implicitly form the"
29     print " *  list of activated modules on startup,"
30     print " *  i.e. these are the modules which are"
31     print " *  initially linked into the Apache processing"
32     print " *  [extendable under run-time via AddModule]"
33     print " */"
34     print "module *ap_prelinked_modules[] = {"
35     for (i = 0; i < n; ++i) {
36         printf "  &%s_module,\n", modules[i]
37     }
38     print "  NULL"
39     print "};"
40     print ""
41     print "/*"
42     print " *  Modules which initially form the"
43     print " *  list of available modules on startup,"
44     print " *  i.e. these are the modules which are"
45     print " *  initially loaded into the Apache process"
46     print " *  [extendable under run-time via LoadModule]"
47     print " */"
48     print "module *ap_preloaded_modules[] = {"
49     for (i = 0; i < pn; ++i) {
50         printf "  &%s_module,\n", pmodules[i]
51     }
52     print "  NULL"
53     print "};"
54     print ""
55 }