diff options
| author | Simon McVittie <smcv@debian.org> | 2024-10-02 18:55:23 +0100 |
|---|---|---|
| committer | Jussi Pakkanen <jpakkane@gmail.com> | 2024-10-02 22:58:50 +0300 |
| commit | 114a3e29144c99c6ff36c656ab3d72fd5aa36f6e (patch) | |
| tree | 6f6969263fd75d5359b850f01ef6cfbfca28b8ce /mesonbuild | |
| parent | 1909a8180b60cf9b8cc3663dff9fb486b13ab3b4 (diff) | |
| download | meson-114a3e29144c99c6ff36c656ab3d72fd5aa36f6e.tar.gz | |
env2mfile: Don't hard-code Debian as always being Linux
All official Debian release architectures use the Linux kernel, but
unofficial ports like hurd-i386 and kfreebsd-amd64 use the Hurd and
FreeBSD kernel, respectively.
Map Linux to 'linux' and kFreeBSD ports to 'freebsd' as per the
reference tables in Meson's documentation. For now, use the Debian
system name such as 'hurd' for anything else (see #13740 for the
question of whether Hurd should identify its kernel differently).
Signed-off-by: Simon McVittie <smcv@debian.org>
Diffstat (limited to 'mesonbuild')
| -rwxr-xr-x | mesonbuild/scripts/env2mfile.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/mesonbuild/scripts/env2mfile.py b/mesonbuild/scripts/env2mfile.py index 57a679c59..a59c1c40c 100755 --- a/mesonbuild/scripts/env2mfile.py +++ b/mesonbuild/scripts/env2mfile.py @@ -147,6 +147,11 @@ deb_os_map = { 'hurd': 'gnu', } +# map from DEB_HOST_ARCH_OS to Meson machine.kernel() +deb_kernel_map = { + 'kfreebsd': 'freebsd', +} + def replace_special_cases(special_cases: T.Mapping[str, str], name: str) -> str: ''' If name is a key in special_cases, replace it with the value, or otherwise @@ -195,7 +200,7 @@ def dpkg_architecture_to_machine_info(output: str, options: T.Any) -> MachineInf host_arch = data['DEB_HOST_GNU_TYPE'] host_os = replace_special_cases(deb_os_map, data['DEB_HOST_ARCH_OS']) host_subsystem = host_os - host_kernel = 'linux' + host_kernel = replace_special_cases(deb_kernel_map, data['DEB_HOST_ARCH_OS']) host_cpu_family = replace_special_cases(deb_cpu_family_map, data['DEB_HOST_GNU_CPU']) host_cpu = replace_special_cases(deb_cpu_map, data['DEB_HOST_ARCH']) host_endian = data['DEB_HOST_ARCH_ENDIAN'] |
