build-modules-c.awk revision 240b85022b73af58a6d971cd3d05d54037d8f682
240b85022b73af58a6d971cd3d05d54037d8f682nd# Copyright 2000-2004 Apache Software Foundation
240b85022b73af58a6d971cd3d05d54037d8f682nd#
240b85022b73af58a6d971cd3d05d54037d8f682nd# Licensed under the Apache License, Version 2.0 (the "License");
240b85022b73af58a6d971cd3d05d54037d8f682nd# you may not use this file except in compliance with the License.
240b85022b73af58a6d971cd3d05d54037d8f682nd# You may obtain a copy of the License at
240b85022b73af58a6d971cd3d05d54037d8f682nd#
240b85022b73af58a6d971cd3d05d54037d8f682nd# http://www.apache.org/licenses/LICENSE-2.0
240b85022b73af58a6d971cd3d05d54037d8f682nd#
240b85022b73af58a6d971cd3d05d54037d8f682nd# Unless required by applicable law or agreed to in writing, software
240b85022b73af58a6d971cd3d05d54037d8f682nd# distributed under the License is distributed on an "AS IS" BASIS,
240b85022b73af58a6d971cd3d05d54037d8f682nd# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
240b85022b73af58a6d971cd3d05d54037d8f682nd# See the License for the specific language governing permissions and
240b85022b73af58a6d971cd3d05d54037d8f682nd# limitations under the License.
06b6cb227bb560084b5f87b30fa0023440abf369manojBEGIN {
06b6cb227bb560084b5f87b30fa0023440abf369manoj RS = " "
141b1a93f508248cbc0e9a124cc38041eb3e2562rbb modules[n++] = "core"
141b1a93f508248cbc0e9a124cc38041eb3e2562rbb pmodules[pn++] = "core"
06b6cb227bb560084b5f87b30fa0023440abf369manoj}
d59bcf65a7217a26e765ab07cb6bbf5b427ad9e3ben{
d59bcf65a7217a26e765ab07cb6bbf5b427ad9e3ben modules[n] = $1;
d59bcf65a7217a26e765ab07cb6bbf5b427ad9e3ben pmodules[pn] = $1;
d59bcf65a7217a26e765ab07cb6bbf5b427ad9e3ben gsub("\n","",modules[n]);
d59bcf65a7217a26e765ab07cb6bbf5b427ad9e3ben gsub("\n","",pmodules[pn]);
d59bcf65a7217a26e765ab07cb6bbf5b427ad9e3ben ++n;
d59bcf65a7217a26e765ab07cb6bbf5b427ad9e3ben ++pn;
d59bcf65a7217a26e765ab07cb6bbf5b427ad9e3ben}
06b6cb227bb560084b5f87b30fa0023440abf369manojEND {
06b6cb227bb560084b5f87b30fa0023440abf369manoj print "/*"
06b6cb227bb560084b5f87b30fa0023440abf369manoj print " * modules.c --- automatically generated by Apache"
06b6cb227bb560084b5f87b30fa0023440abf369manoj print " * configuration script. DO NOT HAND EDIT!!!!!"
06b6cb227bb560084b5f87b30fa0023440abf369manoj print " */"
06b6cb227bb560084b5f87b30fa0023440abf369manoj print ""
2d71630471d1c23f0137309e3c3957c633ecbfd6rbb print "#include \"ap_config.h\""
06b6cb227bb560084b5f87b30fa0023440abf369manoj print "#include \"httpd.h\""
06b6cb227bb560084b5f87b30fa0023440abf369manoj print "#include \"http_config.h\""
06b6cb227bb560084b5f87b30fa0023440abf369manoj print ""
141b1a93f508248cbc0e9a124cc38041eb3e2562rbb for (i = 0; i < pn; ++i) {
06b6cb227bb560084b5f87b30fa0023440abf369manoj printf ("extern module %s_module;\n", pmodules[i])
06b6cb227bb560084b5f87b30fa0023440abf369manoj }
06b6cb227bb560084b5f87b30fa0023440abf369manoj print ""
06b6cb227bb560084b5f87b30fa0023440abf369manoj print "/*"
06b6cb227bb560084b5f87b30fa0023440abf369manoj print " * Modules which implicitly form the"
06b6cb227bb560084b5f87b30fa0023440abf369manoj print " * list of activated modules on startup,"
06b6cb227bb560084b5f87b30fa0023440abf369manoj print " * i.e. these are the modules which are"
06b6cb227bb560084b5f87b30fa0023440abf369manoj print " * initially linked into the Apache processing"
06b6cb227bb560084b5f87b30fa0023440abf369manoj print " * [extendable under run-time via AddModule]"
06b6cb227bb560084b5f87b30fa0023440abf369manoj print " */"
06b6cb227bb560084b5f87b30fa0023440abf369manoj print "module *ap_prelinked_modules[] = {"
141b1a93f508248cbc0e9a124cc38041eb3e2562rbb for (i = 0 ; i < n; ++i) {
06b6cb227bb560084b5f87b30fa0023440abf369manoj printf " &%s_module,\n", modules[i]
06b6cb227bb560084b5f87b30fa0023440abf369manoj }
06b6cb227bb560084b5f87b30fa0023440abf369manoj print " NULL"
06b6cb227bb560084b5f87b30fa0023440abf369manoj print "};"
06b6cb227bb560084b5f87b30fa0023440abf369manoj print ""
06b6cb227bb560084b5f87b30fa0023440abf369manoj print "/*"
06b6cb227bb560084b5f87b30fa0023440abf369manoj print " * Modules which initially form the"
06b6cb227bb560084b5f87b30fa0023440abf369manoj print " * list of available modules on startup,"
06b6cb227bb560084b5f87b30fa0023440abf369manoj print " * i.e. these are the modules which are"
06b6cb227bb560084b5f87b30fa0023440abf369manoj print " * initially loaded into the Apache process"
06b6cb227bb560084b5f87b30fa0023440abf369manoj print " * [extendable under run-time via LoadModule]"
06b6cb227bb560084b5f87b30fa0023440abf369manoj print " */"
06b6cb227bb560084b5f87b30fa0023440abf369manoj print "module *ap_preloaded_modules[] = {"
141b1a93f508248cbc0e9a124cc38041eb3e2562rbb for (i = 0; i < pn; ++i) {
06b6cb227bb560084b5f87b30fa0023440abf369manoj printf " &%s_module,\n", pmodules[i]
06b6cb227bb560084b5f87b30fa0023440abf369manoj }
06b6cb227bb560084b5f87b30fa0023440abf369manoj print " NULL"
06b6cb227bb560084b5f87b30fa0023440abf369manoj print "};"
06b6cb227bb560084b5f87b30fa0023440abf369manoj print ""
06b6cb227bb560084b5f87b30fa0023440abf369manoj}