From: Zbigniew Jędrzejewski-Szmek Date: Fri, 3 Jul 2026 11:28:36 +0000 (+0200) Subject: meson: build .standalone versions of the report binaries X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9155c0a5b9e65153b86b738682d2827f1c8761a6;p=thirdparty%2Fsystemd.git meson: build .standalone versions of the report binaries The goal is to be allow the use of those binaries on systemd with older systemd. The report stuff is generally independent of the running systemd version. When built with -Dinstall-tests=true -Dstandalone-binaries=true -Dbuildtype=release -Db_lto=true, gcc-16.1.1-2.fc44.x86_64, the sizes are quite reasonable: $ ls -lG build-lto/*.standalone -rwxr-xr-x 1 zbyszek 713200 Jul 3 13:16 build-lto/systemd-report.standalone -rwxr-xr-x 1 zbyszek 662936 Jul 3 13:16 build-lto/systemd-report-basic.standalone -rwxr-xr-x 1 zbyszek 567424 Jul 3 13:16 build-lto/systemd-report-cgroup.standalone -rwxr-xr-x 1 zbyszek 592856 Jul 3 13:16 build-lto/systemd-report-files.standalone -rwxr-xr-x 1 zbyszek 589864 Jul 3 13:16 build-lto/systemd-report-sign-plain.standalone -rwxr-xr-x 1 zbyszek 548624 Jul 3 13:16 build-lto/systemd-report-sign-tsm.standalone --- diff --git a/src/report/meson.build b/src/report/meson.build index cc2cea521e4..2c49a97fbf6 100644 --- a/src/report/meson.build +++ b/src/report/meson.build @@ -1,10 +1,10 @@ # SPDX-License-Identifier: LGPL-2.1-or-later -executables += [ - libexec_template + { +report_executables = [ + { 'name' : 'systemd-report', 'public' : true, - 'sources' : files( + 'export' : files( 'report.c', 'report-generate.c', 'report-sign.c', @@ -14,43 +14,63 @@ executables += [ libcurl_cflags, ], }, - - libexec_template + { + { 'name' : 'systemd-report-basic', 'public' : true, - 'sources' : files( - 'report-basic-server.c', + 'export' : files( 'report-basic.c', + 'report-basic-server.c', ), }, - libexec_template + { + { 'name' : 'systemd-report-cgroup', - 'sources' : files( + 'export' : files( 'report-cgroup.c', 'report-cgroup-server.c', ), }, - libexec_template + { + { 'name' : 'systemd-report-files', - 'sources' : files( + 'export' : files( 'report-files.c', 'report-files-server.c', ), }, - libexec_template + { + { 'name' : 'systemd-report-sign-plain', - 'sources' : files( + 'export' : files( 'report-sign-plain.c', ), 'dependencies' : libopenssl_cflags, - 'conditions' : [ - 'HAVE_OPENSSL', - ], + 'conditions' : ['HAVE_OPENSSL'], }, - libexec_template + { + { 'name' : 'systemd-report-sign-tsm', - 'sources' : files( + 'export' : files( 'report-sign-tsm.c', ), }, ] + +foreach exe : report_executables + exe2 = { + 'name' : exe['name'] + '.standalone', + 'import' : [exe['name']], + 'link_with' : [ + libc_wrapper_static, + libbasic_static, + libshared_static, + libsystemd_static, + ] + } + foreach optional : ['public', 'dependencies', 'conditions'] + if optional in exe + exe2 += { optional : exe[optional] } + endif + endforeach + + executables += [ + libexec_template + exe, + libexec_template + exe2, + ] +endforeach