Merge pull request #10220 from floppym/efi-cc
meson: use an array option for efi-cc
This commit is contained in:
commit
41ad5ea198
|
@ -278,7 +278,7 @@ option('dbus', type : 'combo', choices : ['auto', 'true', 'false'],
|
||||||
|
|
||||||
option('gnu-efi', type : 'combo', choices : ['auto', 'true', 'false'],
|
option('gnu-efi', type : 'combo', choices : ['auto', 'true', 'false'],
|
||||||
description : 'gnu-efi support for sd-boot')
|
description : 'gnu-efi support for sd-boot')
|
||||||
option('efi-cc', type : 'string',
|
option('efi-cc', type : 'array',
|
||||||
description : 'the compiler to use for EFI modules')
|
description : 'the compiler to use for EFI modules')
|
||||||
option('efi-ld', type : 'string',
|
option('efi-ld', type : 'string',
|
||||||
description : 'the linker to use for EFI modules')
|
description : 'the linker to use for EFI modules')
|
||||||
|
|
|
@ -34,8 +34,8 @@ stub_sources = '''
|
||||||
|
|
||||||
if conf.get('ENABLE_EFI') == 1 and get_option('gnu-efi') != 'false'
|
if conf.get('ENABLE_EFI') == 1 and get_option('gnu-efi') != 'false'
|
||||||
efi_cc = get_option('efi-cc')
|
efi_cc = get_option('efi-cc')
|
||||||
if efi_cc == ''
|
if efi_cc.length() == 0
|
||||||
efi_cc = ' '.join(cc.cmd_array())
|
efi_cc = cc.cmd_array()
|
||||||
endif
|
endif
|
||||||
efi_ld = get_option('efi-ld')
|
efi_ld = get_option('efi-ld')
|
||||||
if efi_ld == ''
|
if efi_ld == ''
|
||||||
|
@ -57,10 +57,13 @@ if conf.get('ENABLE_EFI') == 1 and get_option('gnu-efi') != 'false'
|
||||||
|
|
||||||
efi_libdir = get_option('efi-libdir')
|
efi_libdir = get_option('efi-libdir')
|
||||||
if efi_libdir == ''
|
if efi_libdir == ''
|
||||||
cmd = 'cd /usr/lib/$(@0@ -print-multi-os-directory) && pwd'.format(efi_cc)
|
ret = run_command(efi_cc + ['-print-multi-os-directory'])
|
||||||
ret = run_command('sh', '-c', cmd)
|
|
||||||
if ret.returncode() == 0
|
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
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -149,7 +152,7 @@ if have_gnu_efi
|
||||||
o_file = custom_target(file + '.o',
|
o_file = custom_target(file + '.o',
|
||||||
input : file,
|
input : file,
|
||||||
output : file + '.o',
|
output : file + '.o',
|
||||||
command : [efi_cc, '-c', '@INPUT@', '-o', '@OUTPUT@']
|
command : efi_cc + ['-c', '@INPUT@', '-o', '@OUTPUT@']
|
||||||
+ compile_args,
|
+ compile_args,
|
||||||
depend_files : efi_headers)
|
depend_files : efi_headers)
|
||||||
if (common_sources + systemd_boot_sources).contains(file)
|
if (common_sources + systemd_boot_sources).contains(file)
|
||||||
|
@ -160,7 +163,7 @@ if have_gnu_efi
|
||||||
endif
|
endif
|
||||||
endforeach
|
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)
|
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)
|
stub_efi_name = 'linux@0@.efi.stub'.format(EFI_MACHINE_TYPE_NAME)
|
||||||
no_undefined_symbols = find_program('no-undefined-symbols.sh')
|
no_undefined_symbols = find_program('no-undefined-symbols.sh')
|
||||||
|
|
Loading…
Reference in New Issue