aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Harris <pharris@opentext.com>2020-08-10 19:03:09 -0400
committerPeter Harris <pharris@opentext.com>2020-08-12 19:56:01 -0400
commit45a12d28b9e6c9df454611e7286e06d91ec7617f (patch)
tree76922387932a677359844ed5389a407dad9d4dda
parent435db359622ca6507a087b6bdcb2a977b3d3b8a4 (diff)
downloadmeson-45a12d28b9e6c9df454611e7286e06d91ec7617f.zip
meson-45a12d28b9e6c9df454611e7286e06d91ec7617f.tar.gz
meson-45a12d28b9e6c9df454611e7286e06d91ec7617f.tar.bz2
aix: fix cpu family detection
Like the BSDs, AIX does not return anything useful in platform.machine().
-rw-r--r--mesonbuild/environment.py8
-rw-r--r--mesonbuild/mesonlib.py3
2 files changed, 9 insertions, 2 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py
index da2d513..315f6c5 100644
--- a/mesonbuild/environment.py
+++ b/mesonbuild/environment.py
@@ -337,7 +337,7 @@ def detect_cpu_family(compilers: CompilersDict) -> str:
"""
if mesonlib.is_windows():
trial = detect_windows_arch(compilers)
- elif mesonlib.is_freebsd() or mesonlib.is_netbsd() or mesonlib.is_openbsd() or mesonlib.is_qnx():
+ elif mesonlib.is_freebsd() or mesonlib.is_netbsd() or mesonlib.is_openbsd() or mesonlib.is_qnx() or mesonlib.is_aix():
trial = platform.processor().lower()
else:
trial = platform.machine().lower()
@@ -377,6 +377,10 @@ def detect_cpu_family(compilers: CompilersDict) -> str:
# ATM there is no 64 bit userland for PA-RISC. Thus always
# report it as 32 bit for simplicity.
trial = 'parisc'
+ elif trial == 'ppc':
+ # AIX always returns powerpc, check here for 64-bit
+ if any_compiler_has_define(compilers, '__64BIT__'):
+ trial = 'ppc64'
if trial not in known_cpu_families:
mlog.warning('Unknown CPU family {!r}, please report this at '
@@ -388,7 +392,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_netbsd() or mesonlib.is_openbsd():
+ elif mesonlib.is_freebsd() or mesonlib.is_netbsd() or mesonlib.is_openbsd() or mesonlib.is_aix():
trial = platform.processor().lower()
else:
trial = platform.machine().lower()
diff --git a/mesonbuild/mesonlib.py b/mesonbuild/mesonlib.py
index 4b8cce8..5a3862c 100644
--- a/mesonbuild/mesonlib.py
+++ b/mesonbuild/mesonlib.py
@@ -530,6 +530,9 @@ def is_hurd() -> bool:
def is_qnx() -> bool:
return platform.system().lower() == 'qnx'
+def is_aix() -> bool:
+ return platform.system().lower() == 'aix'
+
def exe_exists(arglist: T.List[str]) -> bool:
try:
if subprocess.run(arglist, timeout=10).returncode == 0: