From ce9e9e9464236ab8103f5700de640e894281b96f Mon Sep 17 00:00:00 2001 From: Callum Farmer Date: Fri, 22 Nov 2024 15:01:44 +0000 Subject: [PATCH] Use pkgconfig for gnu-efi paths * In use since 3.0.18 fixes bad detection on RISC-V Signed-off-by: Callum Farmer --- efi/meson.build | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/efi/meson.build b/efi/meson.build index 399aa65..cba61ad 100644 --- a/efi/meson.build +++ b/efi/meson.build @@ -24,7 +24,7 @@ efi_ldsdir = get_option('efi-ldsdir') efi_incdir = get_option('efi-includedir') if efi_incdir == '' - efi_incdir = join_paths(includedir, 'efi') + efi_incdir = join_paths(gnuefi.get_variable(pkgconfig: 'includedir'), 'efi') endif gnu_efi_path_arch = '' @@ -41,12 +41,7 @@ endif efi_libdir = get_option('efi-libdir') if efi_libdir == '' - fs = import('fs') - multi = run_command(cc.cmd_array(), '-print-multi-os-directory', check: true).stdout().strip() - efi_libdir = join_paths('/usr/lib/', multi) - if not fs.is_dir(join_paths(efi_libdir, 'gnuefi')) - efi_libdir = libdir - endif + efi_libdir = gnuefi.get_variable(pkgconfig: 'libdir') endif # The name we need to look for on this arch and OS: elf_x86_64_fbsd_efi.lds @@ -58,21 +53,11 @@ endif arch_lds = 'efi.lds' arch_crt = 'crt0.o' if efi_ldsdir == '' - efi_ldsdir = join_paths(efi_libdir, 'gnuefi', gnu_efi_path_arch) - cmd = run_command('test', '-f', join_paths(efi_ldsdir, arch_lds), check: false) - if cmd.returncode() != 0 - arch_lds = 'elf_@0@@1@_efi.lds'.format(gnu_efi_path_arch, lds_os) - arch_crt = 'crt0-efi-@0@.o'.format(gnu_efi_path_arch) - efi_ldsdir = join_paths(efi_libdir, 'gnuefi') - cmd = run_command('test', '-f', join_paths(efi_ldsdir, arch_lds), check: false) - endif - if cmd.returncode() != 0 efi_ldsdir = efi_libdir cmd = run_command('test', '-f', join_paths(efi_ldsdir, arch_lds), check: false) if cmd.returncode() != 0 error('Cannot find @0@'.format(arch_lds)) endif - endif else cmd = run_command('test', '-f', join_paths(efi_ldsdir, arch_lds), check: false) if cmd.returncode() != 0