summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorJan Janssen <medhefgo@web.de>2023-02-27 16:54:48 +0100
committerJan Janssen <medhefgo@web.de>2023-03-10 11:41:08 +0100
commit2afeaf1675a6a68636be493a9461e72ce067db19 (patch)
tree671ea8c8c90db518a516f00e19da08b4a43b046d /meson.build
parentdfca5587cf2032f9ad06041b93b0da5cb39b9989 (diff)
downloadsystemd-2afeaf1675a6a68636be493a9461e72ce067db19.tar.gz
boot: Bring back bootloader builds
This adds back sd-boot builds by using meson compile targets directly. We can do this now, because userspace binaries use the special dependency that allows us to easily separate flags, so that we don't pass anything to EFI builds that shouldn't be passed. Additionally, we pass a bunch of flags to hopefully disable/override any distro provided flags that should not be used for EFI binaries. Fixes: #12275
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build27
1 files changed, 23 insertions, 4 deletions
diff --git a/meson.build b/meson.build
index 8c4e50de73..cde0c88e48 100644
--- a/meson.build
+++ b/meson.build
@@ -1972,11 +1972,28 @@ if get_option('bootloader') != 'false' and efi_arch != ''
elif get_option('bootloader') == 'true' and efi_arch == ''
error('EFI not supported for this arch.')
endif
+
+efi_arch_alt = ''
+if efi_arch == 'x64' and cc.links('''
+ #include <limits.h>
+ int main(int argc, char *argv[]) {
+ return __builtin_popcount(argc - CHAR_MAX);
+ }''', args : ['-m32', '-march=i686'], name : '32bit build possible')
+ efi_arch_alt = 'ia32'
+endif
+
+have_pyelftools = pymod.find_installation('python3', required : false, modules : ['elftools']).found()
+if get_option('bootloader') == 'true' and (not python_39 or not have_pyelftools)
+ error('EFI bootloader support requires Python >= 3.9 and pyelftools.')
+endif
+
conf.set10(
'ENABLE_BOOTLOADER',
get_option('efi') and
get_option('bootloader') in ['auto', 'true'] and
- efi_arch != '',
+ efi_arch != '' and
+ python_39 and
+ have_pyelftools,
)
if get_option('ukify') == 'auto'
@@ -1990,18 +2007,20 @@ conf.set10('ENABLE_UKIFY', want_ukify)
############################################################
#
+elf2efi_lds = project_source_root / 'tools/elf2efi.lds'
+elf2efi_py = find_program('tools/elf2efi.py')
+export_dbus_interfaces_py = find_program('tools/dbus_exporter.py')
generate_gperfs = find_program('tools/generate-gperfs.py')
make_autosuspend_rules_py = find_program('tools/make-autosuspend-rules.py')
make_directive_index_py = find_program('tools/make-directive-index.py')
make_man_index_py = find_program('tools/make-man-index.py')
meson_render_jinja2 = find_program('tools/meson-render-jinja2.py')
update_dbus_docs_py = find_program('tools/update-dbus-docs.py')
-update_man_rules_py = find_program('tools/update-man-rules.py')
-update_hwdb_sh = find_program('tools/update-hwdb.sh')
update_hwdb_autosuspend_sh = find_program('tools/update-hwdb-autosuspend.sh')
+update_hwdb_sh = find_program('tools/update-hwdb.sh')
+update_man_rules_py = find_program('tools/update-man-rules.py')
update_syscall_tables_sh = find_program('tools/update-syscall-tables.sh')
xml_helper_py = find_program('tools/xml_helper.py')
-export_dbus_interfaces_py = find_program('tools/dbus_exporter.py')
############################################################