-
Notifications
You must be signed in to change notification settings - Fork 20
/
meson.build
79 lines (67 loc) · 2.2 KB
/
meson.build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
project('fwupd-efi', 'c',
version : '1.8',
license : 'LGPL-2.1+',
meson_version : '>=0.62.0',
default_options : ['warning_level=2', 'c_std=c99'],
)
conf = configuration_data()
conf.set_quoted('PACKAGE_VERSION', meson.project_version())
cc = meson.get_compiler('c')
objcopy = find_program('objcopy')
objcopy_version = run_command(objcopy, '--version', check: true).stdout().split('\n')[0].split(' ')[-1]
gnuefi = dependency('gnu-efi', version: '>= 3.0.18')
prefix = get_option('prefix')
libdir = join_paths(prefix, get_option('libdir'))
libexecdir = join_paths(prefix, get_option('libexecdir'))
genpeimg = find_program ('genpeimg', required: get_option('genpeimg'))
python3path = get_option('python')
if python3path == ''
python3 = import('python').find_installation('python3')
else
python3 = find_program(python3path)
endif
efi_app_location = join_paths(libexecdir, 'fwupd', 'efi')
host_cpu = host_machine.cpu_family()
if host_cpu == 'x86'
EFI_MACHINE_TYPE_NAME = 'ia32'
gnu_efi_arch = 'ia32'
elif host_cpu == 'x86_64'
EFI_MACHINE_TYPE_NAME = 'x64'
gnu_efi_arch = 'x86_64'
elif host_cpu == 'arm'
EFI_MACHINE_TYPE_NAME = 'arm'
gnu_efi_arch = 'arm'
elif host_cpu == 'aarch64'
EFI_MACHINE_TYPE_NAME = 'aa64'
gnu_efi_arch = 'aarch64'
elif host_cpu == 'loongarch64'
EFI_MACHINE_TYPE_NAME = 'loongarch64'
gnu_efi_arch = 'loongarch64'
elif host_cpu == 'riscv64'
EFI_MACHINE_TYPE_NAME = 'riscv64'
gnu_efi_arch = 'riscv64'
else
error('Unknown host_cpu ' + host_cpu)
endif
# sanity check the packager set this to *SOMETHING*
if get_option('efi_sbat_distro_id') == ''
warning('-Defi_sbat_distro_id is unset, see README.md')
endif
configure_file(
output : 'config.h',
configuration : conf
)
pkgg = import('pkgconfig')
pkgg.generate(
version : meson.project_version(),
name : meson.project_name(),
filebase : 'fwupd-efi',
description : 'fwupd-efi is the UEFI binary used with fwupd for installing UEFI firmware updates',
)
fwupd_efi_dep = declare_dependency()
# SBOM support
uswid = find_program('uswid', required: false)
if not uswid.found()
warning('uswid is unfound, so not embedding uSWID metadata')
endif
subdir('efi')