diff options
author | Ivan Zhakov <ivan@apache.org> | 2024-07-30 02:15:32 +0200 |
---|---|---|
committer | Ivan Zhakov <ivan@apache.org> | 2024-07-30 02:15:32 +0200 |
commit | 0fd65dba2f2960bffcaaef788ceab762cfea6d89 (patch) | |
tree | 898f7b99e6e759dae60778321c59dd13b6b4591c /build | |
parent | * modules/dav/fs/repos.c (dav_fs_get_resource): Return a 404 rather (diff) | |
download | apache2-0fd65dba2f2960bffcaaef788ceab762cfea6d89.tar.xz apache2-0fd65dba2f2960bffcaaef788ceab762cfea6d89.zip |
Follow-up to r1919413: CMake: Use configure_file() instead of file(write)
to generate modules.c file because configure_file() doesn't change
timestamp of file if contents is the the same.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1919587 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'build')
-rw-r--r-- | build/build-modules-c.cmake | 66 | ||||
-rw-r--r-- | build/modules.c.in | 41 |
2 files changed, 46 insertions, 61 deletions
diff --git a/build/build-modules-c.cmake b/build/build-modules-c.cmake index 9d4ac6cc2d..1d005bd9b1 100644 --- a/build/build-modules-c.cmake +++ b/build/build-modules-c.cmake @@ -16,68 +16,12 @@ 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() diff --git a/build/modules.c.in b/build/modules.c.in new file mode 100644 index 0000000000..c811d0d444 --- /dev/null +++ b/build/modules.c.in @@ -0,0 +1,41 @@ +/*
+ * modules.c --- automatically generated by Apache
+ * configuration script. DO NOT HAND EDIT!!!!!
+ */
+
+#include "ap_config.h"
+#include "httpd.h"
+#include "http_config.h"
+
+@MODULES_EXTERN@
+/*
+ * Modules which implicitly form the
+ * list of activated modules on startup,
+ * i.e. these are the modules which are
+ * initially linked into the Apache processing
+ * [extendable under run-time via AddModule]
+ */
+AP_DECLARE_DATA module *ap_prelinked_modules[] = {
+@MODULES_PRELINK@
+ NULL
+};
+
+/*
+ * We need the symbols as strings for <IfModule> containers
+ */
+ap_module_symbol_t ap_prelinked_module_symbols[] = {
+@MODULES_SYNMBOLS@
+ {NULL, NULL}
+};
+
+/*
+ * Modules which initially form the
+ * list of available modules on startup,
+ * i.e. these are the modules which are
+ * initially loaded into the Apache process
+ * [extendable under run-time via LoadModule]
+ */
+module *ap_preloaded_modules[] = {
+@MODULES_PRELOAD@
+ NULL
+};
|