summaryrefslogtreecommitdiff
path: root/src/boot/efi/meson.build
diff options
context:
space:
mode:
Diffstat (limited to 'src/boot/efi/meson.build')
-rw-r--r--src/boot/efi/meson.build35
1 files changed, 21 insertions, 14 deletions
diff --git a/src/boot/efi/meson.build b/src/boot/efi/meson.build
index 8ec1fa7be4..aa897c62a1 100644
--- a/src/boot/efi/meson.build
+++ b/src/boot/efi/meson.build
@@ -34,7 +34,13 @@ stub_sources = '''
if conf.get('ENABLE_EFI') == 1 and get_option('gnu-efi') != 'false'
efi_cc = get_option('efi-cc')
+ if efi_cc.length() == 0
+ efi_cc = cc.cmd_array()
+ endif
efi_ld = get_option('efi-ld')
+ if efi_ld == ''
+ efi_ld = find_program('ld', required: true)
+ endif
efi_incdir = get_option('efi-includedir')
gnu_efi_path_arch = ''
@@ -51,10 +57,13 @@ if conf.get('ENABLE_EFI') == 1 and get_option('gnu-efi') != 'false'
efi_libdir = get_option('efi-libdir')
if efi_libdir == ''
- cmd = 'cd /usr/lib/$(@0@ -print-multi-os-directory) && pwd'.format(efi_cc)
- ret = run_command('sh', '-c', cmd)
+ ret = run_command(efi_cc + ['-print-multi-os-directory'])
if ret.returncode() == 0
- efi_libdir = ret.stdout().strip()
+ path = join_paths('/usr/lib', ret.stdout().strip())
+ ret = run_command('realpath', '-e', path)
+ if ret.returncode() == 0
+ efi_libdir = ret.stdout().strip()
+ endif
endif
endif
@@ -94,10 +103,6 @@ if have_gnu_efi
endif
endif
- message('efi-libdir: "@0@"'.format(efi_libdir))
- message('efi-ldsdir: "@0@"'.format(efi_ldsdir))
- message('efi-includedir: "@0@"'.format(efi_incdir))
-
compile_args = ['-Wall',
'-Wextra',
'-std=gnu90',
@@ -147,18 +152,18 @@ if have_gnu_efi
o_file = custom_target(file + '.o',
input : file,
output : file + '.o',
- command : [efi_cc, '-c', '@INPUT@', '-o', '@OUTPUT@']
+ command : efi_cc + ['-c', '@INPUT@', '-o', '@OUTPUT@']
+ compile_args,
depend_files : efi_headers)
if (common_sources + systemd_boot_sources).contains(file)
- systemd_boot_objects += [o_file]
+ systemd_boot_objects += o_file
endif
if (common_sources + stub_sources).contains(file)
- stub_objects += [o_file]
+ stub_objects += o_file
endif
endforeach
- libgcc_file_name = run_command(efi_cc, '-print-libgcc-file-name').stdout().strip()
+ libgcc_file_name = run_command(efi_cc + ['-print-libgcc-file-name']).stdout().strip()
systemd_boot_efi_name = 'systemd-boot@0@.efi'.format(EFI_MACHINE_TYPE_NAME)
stub_efi_name = 'linux@0@.efi.stub'.format(EFI_MACHINE_TYPE_NAME)
no_undefined_symbols = find_program('no-undefined-symbols.sh')
@@ -173,9 +178,11 @@ if have_gnu_efi
efi_ldflags + tuple[2] +
['-lefi', '-lgnuefi', libgcc_file_name])
- test('no-undefined-symbols-' + tuple[0],
- no_undefined_symbols,
- args : [so])
+ if want_tests != 'false'
+ test('no-undefined-symbols-' + tuple[0],
+ no_undefined_symbols,
+ args : [so])
+ endif
stub = custom_target(
tuple[1],