]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: move declarations of bootctl and friends
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 25 Jun 2023 06:41:42 +0000 (15:41 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 31 Jul 2023 17:31:36 +0000 (02:31 +0900)
This also drops unnecessary dependency on libblkid from
systemd-boot-check-no-failures.

meson.build
src/boot/meson.build

index 2251a9b09585703ed1ccf4ce2dcd0173b65783fb..066d05f1e4bd11cf8697eac581254c017839733d 100644 (file)
@@ -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',
index eb621c88d7783710380f88e115deaddf1dc5a500..fdccb2a428abb36826a44ffa087be13ab485420b 100644 (file)
@@ -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'),
+        },
+]