]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
portable, meson: allow statically linked build
authorRobert Scheck <robert@fedoraproject.org>
Sun, 14 May 2023 01:17:47 +0000 (03:17 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 15 May 2023 11:30:04 +0000 (13:30 +0200)
Build option "link-portabled-shared" to build a statically linked
systemd-portabled by using

  -Dlink-portabled-shared=false

on systems with full systemd stack except systemd-portabled, such
as CentOS/RHEL 9.

meson.build
meson_options.txt

index 92ad879f64a3f4c6f055ac71dc47884c810f1fb0..91523e81ee9418abb6edcea329d7634c76fdcb30 100644 (file)
@@ -2942,11 +2942,18 @@ systemctl = executable(
 public_programs += systemctl
 
 if conf.get('ENABLE_PORTABLED') == 1
+        if get_option('link-portabled-shared')
+                portabled_link_with = [libshared]
+        else
+                portabled_link_with = [libsystemd_static,
+                                       libshared_static]
+        endif
+
         dbus_programs += executable(
                 'systemd-portabled',
                 systemd_portabled_sources,
                 include_directories : includes,
-                link_with : [libshared],
+                link_with : [portabled_link_with],
                 dependencies : [libselinux,
                                 threads,
                                 userspace,
@@ -2959,7 +2966,7 @@ if conf.get('ENABLE_PORTABLED') == 1
                 'portablectl',
                 'src/portable/portablectl.c',
                 include_directories : includes,
-                link_with : [libshared],
+                link_with : [portabled_link_with],
                 dependencies : [threads,
                                 userspace,
                                 versiondep],
@@ -4996,6 +5003,7 @@ foreach tuple : [
         ['link-timesyncd-shared',  get_option('link-timesyncd-shared')],
         ['link-journalctl-shared', get_option('link-journalctl-shared')],
         ['link-boot-shared',       get_option('link-boot-shared')],
+        ['link-portabled-shared',  get_option('link-portabled-shared')],
         ['first-boot-full-preset'],
         ['fexecve'],
         ['standalone-binaries',    get_option('standalone-binaries')],
index d3af35e7ef752ca517350244b3342075f39c15f8..46f508bd76665f60dc9d1cf047fca0d807f2c331 100644 (file)
@@ -29,6 +29,8 @@ option('link-journalctl-shared', type: 'boolean',
        description : 'link journalctl against libsystemd-shared.so')
 option('link-boot-shared', type: 'boolean',
        description : 'link bootctl and systemd-bless-boot against libsystemd-shared.so')
+option('link-portabled-shared', type: 'boolean',
+       description : 'link systemd-portabled and its helpers to libsystemd-shared.so')
 option('first-boot-full-preset', type: 'boolean', value: false,
        description : 'during first boot, do full preset-all (default will be changed to true later)')