From: Zbigniew Jędrzejewski-Szmek Date: Mon, 10 May 2021 18:28:14 +0000 (+0200) Subject: meson: rework test-efi-disk.img creation to not require variables X-Git-Tag: v249-rc1~242^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4f3dca78bb4f5d5bd6e8b1748601b123cdb9e367;p=thirdparty%2Fsystemd.git meson: rework test-efi-disk.img creation to not require variables The primary goal is to make the name of the custom_target() rule match the output file again. Having them different is confusing. --- diff --git a/src/boot/efi/meson.build b/src/boot/efi/meson.build index ecb67eb689a..26e6dc79fc2 100644 --- a/src/boot/efi/meson.build +++ b/src/boot/efi/meson.build @@ -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