1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-08 19:46:02 +01:00
nix/nix-meson-build-support/default-system-cpu/meson.build
Sergei Zimmerman ebd311b7b7
meson: Correctly handle endianness for PowerPC CPU families
I've missed this while reviewing 6db6190002.
I only built big endian ppc64, so that didn't occur to me.

From meson manual:

> Those porting from autotools should note that Meson does not add
> endianness to the name of the cpu_family. For example, autotools will
> call little endian PPC64 "ppc64le", Meson will not, you must also check
> the .endian() value of the machine for this information.

This code should handle that correctly.
2025-07-22 03:27:27 +03:00

10 lines
296 B
Meson

powerpc_system_cpus = [ 'ppc64', 'ppc' ]
nix_system_cpu = {'ppc64' : 'powerpc64', 'ppc' : 'powerpc'}.get(
host_machine.cpu_family(),
host_machine.cpu_family(),
)
if powerpc_system_cpus.contains(host_machine.cpu_family()) and host_machine.endian() == 'little'
nix_system_cpu += 'le'
endif