From f214e955b853d87aa1a34dfbb44b5d8edff3962c Mon Sep 17 00:00:00 2001 From: Clayton Craft Date: Tue, 7 Jan 2025 20:19:51 -0800 Subject: [PATCH 1/2] meson: minimal configure for building systemd-boot Notes: - toggling all ENABLED_* things off saves a ton of configure time - Removing capability.h, so that cross compiling doesn't fail because that header isn't installed - Set libcap and libmount to required=false, they aren't needed for building the bootloader, and they complicate cross compilation IMPORTANT: some of these dependencies don't exist for the target arch (x86) and since they aren't actually required by sd-boot it's easier to just disable/remove them from meson.build!!! --- meson.build | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/meson.build b/meson.build index bffda86845..b5a27de305 100644 --- a/meson.build +++ b/meson.build @@ -766,9 +766,6 @@ conf.set('GPERF_LEN_TYPE', gperf_len_type, ##################################################################### -if not cc.has_header('sys/capability.h') - error('POSIX caps headers not found') -endif foreach header : ['crypt.h', 'linux/ioprio.h', 'linux/memfd.h', @@ -1052,7 +1049,7 @@ if not libcrypt.found() # fallback to use find_library() if libcrypt is provided by glibc, e.g. for LibreELEC. libcrypt = cc.find_library('crypt') endif -libcap = dependency('libcap') +libcap = dependency('libcap', required : false) # On some architectures, libatomic is required. But on some installations, # it is found, but actual linking fails. So let's try to use it opportunistically. @@ -1164,7 +1161,7 @@ else endif libmount = dependency('mount', - version : fuzzer_build ? '>= 0' : '>= 2.30') + version : fuzzer_build ? '>= 0' : '>= 2.30', required : false) libfdisk = dependency('fdisk', version : '>= 2.32', @@ -1931,6 +1928,15 @@ pefile = pymod.find_installation('python3', required: false, modules : ['pefile' want_ukify = get_option('ukify').require(python_39 and (want_tests != 'true' or pefile.found()), error_message : 'Python >= 3.9 and pefile required').allowed() conf.set10('ENABLE_UKIFY', want_ukify) +foreach key : conf.keys() + if key.startswith('ENABLE_') + conf.set10(key, false) + endif +endforeach + +conf.set10('ENABLE_EFI', true) +conf.set10('ENABLE_BOOTLOADER', true) + ##################################################################### check_efi_alignment_py = find_program('tools/check-efi-alignment.py') -- 2.47.1