function(generate_builtin_modules_c output_filename module_list)
list(PREPEND module_list "core")
- set(content "")
-
- string(APPEND content "/*\n")
- string(APPEND content " * modules.c --- automatically generated by Apache\n")
- string(APPEND content " * configuration script. DO NOT HAND EDIT!!!!!\n")
- string(APPEND content " */\n")
- string(APPEND content "\n")
- string(APPEND content "#include \"ap_config.h\"\n")
- string(APPEND content "#include \"httpd.h\"\n")
- string(APPEND content "#include \"http_config.h\"\n")
- string(APPEND content "\n")
-
- foreach(module ${module_list})
- string(APPEND content "extern module ${module}_module\;\n")
- endforeach()
-
- string(APPEND content "\n")
- string(APPEND content "/*\n")
- string(APPEND content " * Modules which implicitly form the\n")
- string(APPEND content " * list of activated modules on startup,\n")
- string(APPEND content " * i.e. these are the modules which are\n")
- string(APPEND content " * initially linked into the Apache processing\n")
- string(APPEND content " * [extendable under run-time via AddModule]\n")
- string(APPEND content " */\n")
-
- string(APPEND content "AP_DECLARE_DATA module *ap_prelinked_modules[] = {\n")
foreach(module ${module_list})
- string(APPEND content " &${module}_module,\n")
+ string(APPEND MODULES_EXTERN "extern module ${module}_module;\n")
+ string(APPEND MODULES_PRELINK " &${module}_module,\n")
+ string(APPEND MODULES_SYNMBOLS " {\"${module}_module\", &${module}_module},\n")
+ string(APPEND MODULES_PRELOAD " &${module}_module,\n")
endforeach()
- string(APPEND content " NULL\n")
- string(APPEND content "}\;\n")
-
- string(APPEND content "\n")
- string(APPEND content "/*\n")
- string(APPEND content " * We need the symbols as strings for <IfModule> containers\n")
- string(APPEND content " */\n")
- string(APPEND content "\n")
- string(APPEND content "ap_module_symbol_t ap_prelinked_module_symbols[] = {\n")
-
- foreach(module ${module_list})
- string(APPEND content " {\"${module}_module\", &${module}_module},\n")
- endforeach()
-
- string(APPEND content " {NULL, NULL}\n")
- string(APPEND content "}\;\n")
- string(APPEND content "\n")
- string(APPEND content "/*\n")
- string(APPEND content " * Modules which initially form the\n")
- string(APPEND content " * list of available modules on startup,\n")
- string(APPEND content " * i.e. these are the modules which are\n")
- string(APPEND content " * initially loaded into the Apache process\n")
- string(APPEND content " * [extendable under run-time via LoadModule]\n")
- string(APPEND content " */\n")
- string(APPEND content "module *ap_preloaded_modules[] = {\n")
-
- foreach(module ${module_list})
- string(APPEND content " &${module}_module,\n")
- endforeach()
-
- string(APPEND content " NULL\n")
- string(APPEND content "}\;\n")
- string(APPEND content "\n")
- file(WRITE ${output_filename} ${content})
+ configure_file("build/modules.c.in" ${output_filename})
endfunction()
--- /dev/null
+/*\r
+ * modules.c --- automatically generated by Apache\r
+ * configuration script. DO NOT HAND EDIT!!!!!\r
+ */\r
+\r
+#include "ap_config.h"\r
+#include "httpd.h"\r
+#include "http_config.h"\r
+\r
+@MODULES_EXTERN@\r
+/*\r
+ * Modules which implicitly form the\r
+ * list of activated modules on startup,\r
+ * i.e. these are the modules which are\r
+ * initially linked into the Apache processing\r
+ * [extendable under run-time via AddModule]\r
+ */\r
+AP_DECLARE_DATA module *ap_prelinked_modules[] = {\r
+@MODULES_PRELINK@\r
+ NULL\r
+};\r
+\r
+/*\r
+ * We need the symbols as strings for <IfModule> containers\r
+ */\r
+ap_module_symbol_t ap_prelinked_module_symbols[] = {\r
+@MODULES_SYNMBOLS@\r
+ {NULL, NULL}\r
+};\r
+\r
+/*\r
+ * Modules which initially form the\r
+ * list of available modules on startup,\r
+ * i.e. these are the modules which are\r
+ * initially loaded into the Apache process\r
+ * [extendable under run-time via LoadModule]\r
+ */\r
+module *ap_preloaded_modules[] = {\r
+@MODULES_PRELOAD@\r
+ NULL\r
+};\r