]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: rework test-efi-disk.img creation to not require variables
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 10 May 2021 18:28:14 +0000 (20:28 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 10 May 2021 18:28:24 +0000 (20:28 +0200)
The primary goal is to make the name of the custom_target() rule match
the output file again. Having them different is confusing.

src/boot/efi/meson.build

index ecb67eb689af7e4bb5f42c75fe59b3a0c8984f03..26e6dc79fc223600ea67edf4fda0359cf61998f5 100644 (file)
@@ -259,24 +259,19 @@ if have_gnu_efi
         stub_efi_name = 'linux@0@.efi.stub'.format(EFI_MACHINE_TYPE_NAME)
         no_undefined_symbols = find_program('no-undefined-symbols.sh')
 
-        foreach tuple : [['systemd_boot.so', systemd_boot_efi_name, systemd_boot_objects, 'systemd_boot.so', false],
-                         ['stub.so', stub_efi_name, stub_objects, stub_elf_name, true]]
+        efi_stubs = []
+        foreach tuple : [['systemd_boot.so', systemd_boot_efi_name, systemd_boot_objects, false],
+                         [stub_elf_name, stub_efi_name, stub_objects, true]]
                 so = custom_target(
                         tuple[0],
                         input : tuple[2],
-                        output : tuple[3],
-                        command : [efi_ld, '-o', '@OUTPUT@'] +
-                                  efi_ldflags + tuple[2] +
-                                  ['-lefi', '-lgnuefi', libgcc_file_name],
-                        install : tuple[4],
+                        output : tuple[0],
+                        command : [efi_ld, '-o', '@OUTPUT@',
+                                   efi_ldflags, tuple[2],
+                                   '-lefi', '-lgnuefi', libgcc_file_name],
+                        install : tuple[3],
                         install_dir : bootlibdir)
 
-                if want_tests != 'false'
-                        test('no-undefined-symbols-' + tuple[0],
-                             no_undefined_symbols,
-                             args : [so])
-                endif
-
                 stub = custom_target(
                         tuple[1],
                         input : so,
@@ -288,22 +283,26 @@ if have_gnu_efi
                                    '-j', '.data',
                                    '-j', '.dynamic',
                                    '-j', '.dynsym',
-                                   '-j', '.rel*']
-                                  + efi_format +
-                                  ['@INPUT@', '@OUTPUT@'],
+                                   '-j', '.rel*',
+                                   efi_format,
+                                   '@INPUT@', '@OUTPUT@'],
                         install : true,
                         install_dir : bootlibdir)
 
-                set_variable(tuple[0].underscorify(), so)
-                set_variable(tuple[0].underscorify() + '_stub', stub)
+                efi_stubs += [[so, stub]]
+
+                if want_tests != 'false'
+                        test('no-undefined-symbols-' + tuple[0],
+                             no_undefined_symbols,
+                             args : so)
+                endif
         endforeach
 
         ############################################################
 
         test_efi_disk_img = custom_target(
                 'test-efi-disk.img',
-                input : [systemd_boot_so, stub_so_stub],
+                input : [efi_stubs[0][0], efi_stubs[1][1]],
                 output : 'test-efi-disk.img',
-                command : [test_efi_create_disk_sh, '@OUTPUT@',
-                           '@INPUT0@', '@INPUT1@', splash_bmp])
+                command : [test_efi_create_disk_sh, '@OUTPUT@','@INPUT@', splash_bmp])
 endif