summaryrefslogtreecommitdiff
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2022-12-05 21:42:42 -0500
committerGlenn Strauss <gstrauss@gluelogic.com>2022-12-05 23:10:55 -0500
commit01ffe16e4da2f204b58993a92f8623ad64f985ef (patch)
tree7f625e5a456c74909e1061f5c81f7eec1de14cb5 /src/CMakeLists.txt
parent3bc7866f34ba9b16c8c15484c9e0ba53080124c0 (diff)
downloadlighttpd-git-01ffe16e4da2f204b58993a92f8623ad64f985ef.tar.gz
[core] build core modules into lighttpd executable
In dynamic build of lighttpd, at runtime each loaded lighttpd module .so takes at least (5) 4k memory pages on x86_64. That is at least 20k per module. Building 10 small core modules into lighttpd adds less than 16k .text total, and adding mod_fastcgi and mod_scgi totals less than 20k .text (plus an extra 4k .rodata page). The end result is that memory usage is almost the same if only mod_staticfile is used, and 20k or so is saved for each additional module used if among those built into lighttpd executable. For now, the standalone .so modules continue to be built, even though not used by the lighttpd executable. This is done in order to give distros time to update packaging scripts and transition to not expecting the builtin module artifacts to be produced or installed as part of the distro lighttpd package.
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 1d249ae1..b4270341 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -842,6 +842,25 @@ set(COMMON_SRC
ck.c
)
+if(LIGHTTPD_STATIC)
+ unset(BUILTIN_MODS)
+else()
+ set(BUILTIN_MODS
+ mod_rewrite.c
+ mod_redirect.c
+ mod_access.c
+ mod_alias.c
+ mod_indexfile.c
+ mod_staticfile.c
+ mod_setenv.c
+ mod_expire.c
+ mod_simple_vhost.c
+ mod_evhost.c
+ mod_fastcgi.c
+ mod_scgi.c
+ )
+endif()
+
if(CMAKE_CROSSCOMPILING)
# custom compile lemon using native compiler
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lemon
@@ -882,6 +901,7 @@ add_executable(lighttpd
configfile.c
configparser.c
${COMMON_SRC}
+ ${BUILTIN_MODS}
)
set(L_INSTALL_TARGETS ${L_INSTALL_TARGETS} lighttpd)