meson: Rework gnu-efi detection

Moving all of the gnu-efi detection into src/boot/efi/meson.build makes
more sense than having it partially split.

And thanks to subdir_done() we can simplify the code a lot.

Fixes: #21258
This commit is contained in:
Jan Janssen
2021-11-08 13:04:45 +01:00
committed by Luca Boccassi
parent fe63d890fd
commit 9cf75222f2
2 changed files with 291 additions and 336 deletions

View File

@@ -1641,39 +1641,8 @@ conf.set10('SYSTEMD_SLOW_TESTS_DEFAULT', slow_tests)
#####################################################################
if get_option('efi')
efi_arch = host_machine.cpu_family()
if efi_arch == 'x86'
EFI_MACHINE_TYPE_NAME = 'ia32'
gnu_efi_arch = 'ia32'
elif efi_arch == 'x86_64'
EFI_MACHINE_TYPE_NAME = 'x64'
gnu_efi_arch = 'x86_64'
elif efi_arch == 'arm'
EFI_MACHINE_TYPE_NAME = 'arm'
gnu_efi_arch = 'arm'
elif efi_arch == 'aarch64'
EFI_MACHINE_TYPE_NAME = 'aa64'
gnu_efi_arch = 'aarch64'
elif efi_arch == 'riscv64'
EFI_MACHINE_TYPE_NAME = 'riscv64'
gnu_efi_arch = 'riscv64'
else
EFI_MACHINE_TYPE_NAME = ''
gnu_efi_arch = ''
endif
have = true
conf.set_quoted('EFI_MACHINE_TYPE_NAME', EFI_MACHINE_TYPE_NAME)
else
have = false
endif
conf.set10('ENABLE_EFI', have)
subdir('src/fundamental')
subdir('src/boot/efi')
conf.set10('HAVE_GNU_EFI', have_gnu_efi)
############################################################
@@ -3887,19 +3856,14 @@ summary({
# CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
# LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS}
if conf.get('ENABLE_EFI') == 1
summary({'EFI arch' : efi_arch},
if conf.get('ENABLE_EFI') == 1 and conf.get('HAVE_GNU_EFI') == 1
summary({
'EFI machine type' : efi_arch[0],
'EFI CC' : '@0@'.format(' '.join(efi_cc)),
'EFI lds' : efi_lds,
'EFI crt0' : efi_crt0,
'EFI include directory' : efi_incdir},
section : 'Extensible Firmware Interface')
if have_gnu_efi
summary({
'EFI machine type' : EFI_MACHINE_TYPE_NAME,
'EFI CC' : '@0@'.format(' '.join(efi_cc)),
'EFI lds' : efi_lds,
'EFI crt0' : efi_crt0,
'EFI include directory' : efi_incdir},
section : 'Extensible Firmware Interface')
endif
endif
found = []
@@ -3947,11 +3911,11 @@ foreach tuple : [
# components
['backlight'],
['binfmt'],
['bpf-framework', conf.get('BPF_FRAMEWORK') == 1],
['bpf-framework'],
['coredump'],
['environment.d'],
['efi'],
['gnu-efi', have_gnu_efi],
['gnu-efi'],
['firstboot'],
['hibernate'],
['homed'],
@@ -4008,7 +3972,7 @@ foreach tuple : [
['debug hashmap'],
['debug mmap cache'],
['debug siphash'],
['valgrind', conf.get('VALGRIND') == 1],
['valgrind'],
['trace logging', conf.get('LOG_TRACE') == 1],
['install tests', install_tests],
['link-udev-shared', get_option('link-udev-shared')],

File diff suppressed because it is too large Load Diff