diff options
author | Felipe Sateler <fsateler@debian.org> | 2018-05-22 15:08:57 -0400 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-05-31 16:05:00 +0200 |
commit | f3794366b07262ca213c63b61361e15647cfafda (patch) | |
tree | 30456beb19633423ac409a15f27ec7ac6e11e679 /meson.build | |
parent | 89544ae65827c6fc19579861961d26157b572bbb (diff) | |
download | systemd-f3794366b07262ca213c63b61361e15647cfafda.tar.gz |
build-sys: Add option to link systemctl statically
Systemctl is special because it is required for many tasks that may need to
be performed when the system is not fully configured and/or partially
broken:
1. Installing/Uninstalling services during OS installs and upgrades
2. Shutting down the system
Therefore reduce the number of dependencies that systemctl pulls in, by
not linking to systemd-shared. This brings a bit of resilience to
systemctl (and its aliases shutdown, reboot, etc), by linking against
less external libraries.
Because this extra resilience comes at a cost of approximately 580 KB
extra space, this is done behind a meson build option.
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/meson.build b/meson.build index 484271ff1c..18b4ace5b9 100644 --- a/meson.build +++ b/meson.build @@ -1708,9 +1708,19 @@ exe = executable('systemd-socket-activate', 'src/activate/activate.c', install : true) public_programs += [exe] + +if get_option('link-systemctl-shared') + systemctl_link_with = [libshared] +else + systemctl_link_with = [libsystemd_static, + libshared_static, + libjournal_client, + libbasic_gcrypt] +endif + exe = executable('systemctl', 'src/systemctl/systemctl.c', include_directories : includes, - link_with : [libshared], + link_with : systemctl_link_with, dependencies : [threads, libcap, libselinux, |