]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
timesync, meson: allow statically linked build
authorRobert Scheck <robert@fedoraproject.org>
Sat, 8 Feb 2020 13:02:09 +0000 (14:02 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 4 Mar 2020 09:46:10 +0000 (10:46 +0100)
Build option "link-timesyncd-shared" to build a statically linked
systemd-timesyncd by using

  -Dlink-udev-shared=false -Dlink-timesyncd-shared=false

on systems with full systemd stack except systemd-timesyncd, such
as RHEL/CentOS 8.

meson.build
meson_options.txt

index c8f6482e4aef0c7baac9dcee92523b4f55435918..fc216d22da24a9d88f6cb92e2305c6c3de6c3899 100644 (file)
@@ -2292,10 +2292,19 @@ if conf.get('ENABLE_TIMEDATECTL') == 1
 endif
 
 if conf.get('ENABLE_TIMESYNCD') == 1
+        if get_option('link-timesyncd-shared')
+                timesyncd_link_with = [libshared]
+        else
+                timesyncd_link_with = [libsystemd_static,
+                                       libshared_static,
+                                       libjournal_client,
+                                       libbasic_gcrypt]
+        endif
+
         executable('systemd-timesyncd',
                    systemd_timesyncd_sources,
                    include_directories : includes,
-                   link_with : [libshared],
+                   link_with : [timesyncd_link_with],
                    dependencies : [threads,
                                    libm],
                    install_rpath : rootlibexecdir,
@@ -2305,7 +2314,7 @@ if conf.get('ENABLE_TIMESYNCD') == 1
         executable('systemd-time-wait-sync',
                    'src/time-wait-sync/time-wait-sync.c',
                    include_directories : includes,
-                   link_with : [libshared],
+                   link_with : [timesyncd_link_with],
                    install_rpath : rootlibexecdir,
                    install : true,
                    install_dir : rootlibexecdir)
@@ -3469,6 +3478,7 @@ foreach tuple : [
         ['link-udev-shared',      get_option('link-udev-shared')],
         ['link-systemctl-shared', get_option('link-systemctl-shared')],
         ['link-networkd-shared',  get_option('link-networkd-shared')],
+        ['link-timesyncd-shared', get_option('link-timesyncd-shared')],
 ]
 
         if tuple.length() >= 2
index 4f82479a9ba038f0d2450ff427a1dccf12bef0a5..4988d41ff3b2ff2ee74b82878fd7407f87ca4882 100644 (file)
@@ -18,6 +18,8 @@ option('link-systemctl-shared', type: 'boolean',
        description : 'link systemctl against libsystemd-shared.so')
 option('link-networkd-shared', type: 'boolean',
        description : 'link systemd-networkd and its helpers to libsystemd-shared.so')
+option('link-timesyncd-shared', type: 'boolean',
+       description : 'link systemd-timesyncd and its helpers to libsystemd-shared.so')
 option('static-libsystemd', type : 'combo',
        choices : ['false', 'true', 'pic', 'no-pic'],
        description : '''install a static library for libsystemd''')