Support NetBSD aarch64 and earm.

pull/5756/head
nia 5 years ago committed by Dylan Baker
parent 315ab997b4
commit 246b49fe75
  1. 8
      mesonbuild/environment.py
  2. 3
      mesonbuild/mesonlib.py

@ -235,7 +235,7 @@ def detect_cpu_family(compilers: CompilersDict) -> str:
"""
if mesonlib.is_windows():
trial = detect_windows_arch(compilers)
elif mesonlib.is_freebsd() or mesonlib.is_openbsd():
elif mesonlib.is_freebsd() or mesonlib.is_netbsd() or mesonlib.is_openbsd():
trial = platform.processor().lower()
else:
trial = platform.machine().lower()
@ -243,7 +243,7 @@ def detect_cpu_family(compilers: CompilersDict) -> str:
trial = 'x86'
elif trial == 'bepc':
trial = 'x86'
elif trial.startswith('arm'):
elif trial.startswith('arm') or trial.startswith('earm'):
trial = 'arm'
elif trial.startswith(('powerpc64', 'ppc64')):
trial = 'ppc64'
@ -280,7 +280,7 @@ def detect_cpu_family(compilers: CompilersDict) -> str:
def detect_cpu(compilers: CompilersDict):
if mesonlib.is_windows():
trial = detect_windows_arch(compilers)
elif mesonlib.is_freebsd() or mesonlib.is_openbsd():
elif mesonlib.is_freebsd() or mesonlib.is_netbsd() or mesonlib.is_openbsd():
trial = platform.processor().lower()
else:
trial = platform.machine().lower()
@ -294,6 +294,8 @@ def detect_cpu(compilers: CompilersDict):
# Same check as above for cpu_family
if any_compiler_has_define(compilers, '__arm__'):
trial = 'arm'
elif trial.startswith('earm'):
trial = 'arm'
elif trial == 'e2k':
# Make more precise CPU detection for Elbrus platform.
trial = platform.processor().lower()

@ -459,6 +459,9 @@ def is_debianlike() -> bool:
def is_dragonflybsd() -> bool:
return platform.system().lower() == 'dragonfly'
def is_netbsd() -> bool:
return platform.system().lower() == 'netbsd'
def is_freebsd() -> bool:
return platform.system().lower() == 'freebsd'

Loading…
Cancel
Save