From: Yu Watanabe Date: Sun, 25 Jun 2023 06:41:42 +0000 (+0900) Subject: meson: move declarations of bootctl and friends X-Git-Tag: v255-rc1~864^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bd31a348bf6d41921c62657c2a2de26970de79a1;p=thirdparty%2Fsystemd.git meson: move declarations of bootctl and friends This also drops unnecessary dependency on libblkid from systemd-boot-check-no-failures. --- diff --git a/meson.build b/meson.build index 2251a9b0958..066d05f1e4b 100644 --- a/meson.build +++ b/meson.build @@ -2560,88 +2560,15 @@ if want_tests != 'false' endif if conf.get('HAVE_BLKID') == 1 and conf.get('ENABLE_BOOTLOADER') == 1 - if get_option('link-boot-shared') - boot_link_with = [libshared] - else - boot_link_with = [libsystemd_static, libshared_static] - endif - - exe = executable( - 'bootctl', - bootctl_sources, - include_directories : includes, - link_with : [boot_link_with], - dependencies : [libblkid, - userspace], - install_rpath : pkglibdir, - install : true) - public_programs += exe - if want_tests != 'false' + exe = executables_by_name.get('bootctl') test('test-bootctl-json', test_bootctl_json_sh, args : exe.full_path(), depends : exe) endif - - public_programs += executable( - 'systemd-bless-boot', - 'src/boot/bless-boot.c', - include_directories : includes, - link_with : [boot_link_with], - dependencies : [libblkid, - userspace], - install_rpath : pkglibdir, - install : true, - install_dir : libexecdir) - - executable( - 'systemd-bless-boot-generator', - 'src/boot/bless-boot-generator.c', - include_directories : includes, - link_with : [boot_link_with], - dependencies : userspace, - install_rpath : pkglibdir, - install : true, - install_dir : systemgeneratordir) - - if conf.get('HAVE_OPENSSL') == 1 and conf.get('HAVE_TPM2') == 1 - executable( - 'systemd-measure', - 'src/boot/measure.c', - include_directories : includes, - link_with : [libshared], - dependencies : [libopenssl, - userspace], - install_rpath : pkglibdir, - install : true, - install_dir : libexecdir) - executable( - 'systemd-pcrphase', - 'src/boot/pcrphase.c', - include_directories : includes, - link_with : [libshared], - dependencies : [libblkid, - libopenssl, - tpm2, - userspace], - install_rpath : pkglibdir, - install : true, - install_dir : libexecdir) - endif endif -executable( - 'systemd-boot-check-no-failures', - 'src/boot/boot-check-no-failures.c', - include_directories : includes, - link_with : [libshared], - dependencies : [libblkid, - userspace], - install_rpath : pkglibdir, - install : true, - install_dir : libexecdir) - public_programs += executable( 'systemd-socket-activate', 'src/socket-activate/socket-activate.c', diff --git a/src/boot/meson.build b/src/boot/meson.build index eb621c88d77..fdccb2a428a 100644 --- a/src/boot/meson.build +++ b/src/boot/meson.build @@ -11,3 +11,76 @@ bootctl_sources = files( 'bootctl-util.c', 'bootctl.c', ) + +if get_option('link-boot-shared') + boot_link_with = [libshared] +else + boot_link_with = [ + libshared_static, + libsystemd_static, + ] +endif + +executables += [ + executable_template + { + 'name' : 'bootctl', + 'public' : true, + 'conditions' : [ + 'HAVE_BLKID', + 'ENABLE_BOOTLOADER', + ], + 'sources' : bootctl_sources, + 'link_with' : boot_link_with, + 'dependencies' : libblkid, + }, + libexec_template + { + 'name' : 'systemd-bless-boot', + 'public' : true, + 'conditions' : [ + 'HAVE_BLKID', + 'ENABLE_BOOTLOADER', + ], + 'sources' : files('bless-boot.c'), + 'link_with' : boot_link_with, + 'dependencies' : libblkid, + }, + generator_template + { + 'name' : 'systemd-bless-boot-generator', + 'conditions' : [ + 'HAVE_BLKID', + 'ENABLE_BOOTLOADER', + ], + 'sources' : files('bless-boot-generator.c'), + 'link_with' : boot_link_with, + }, + libexec_template + { + 'name' : 'systemd-measure', + 'conditions' : [ + 'HAVE_BLKID', + 'ENABLE_BOOTLOADER', + 'HAVE_OPENSSL', + 'HAVE_TPM2', + ], + 'sources' : files('measure.c'), + 'dependencies' : libopenssl, + }, + libexec_template + { + 'name' : 'systemd-pcrphase', + 'conditions' : [ + 'HAVE_BLKID', + 'ENABLE_BOOTLOADER', + 'HAVE_OPENSSL', + 'HAVE_TPM2', + ], + 'sources' : files('pcrphase.c'), + 'dependencies' : [ + libblkid, + libopenssl, + tpm2, + ], + }, + libexec_template + { + 'name' : 'systemd-boot-check-no-failures', + 'sources' : files('boot-check-no-failures.c'), + }, +]