aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/environment.py
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild/environment.py')
-rw-r--r--mesonbuild/environment.py19
1 files changed, 17 insertions, 2 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py
index ccd31eb..91f58ef 100644
--- a/mesonbuild/environment.py
+++ b/mesonbuild/environment.py
@@ -387,6 +387,18 @@ def detect_cpu(compilers: CompilersDict) -> str:
# detect_cpu_family() above.
return trial
+def detect_kernel(system: str) -> str:
+ if system == 'android':
+ return 'linux'
+ return system
+
+def detect_userland(system: str) -> str:
+ if system == 'linux':
+ return 'gnu' # Fixme, check whether we are on a glibc system.
+ if system == 'darwin':
+ return 'macos'
+ return system
+
def detect_system() -> str:
if sys.platform == 'cygwin':
return 'cygwin'
@@ -403,11 +415,14 @@ def detect_machine_info(compilers: T.Optional[CompilersDict] = None) -> MachineI
underlying ''detect_*'' method can be called to explicitly use the
partial information.
"""
+ system = detect_system()
return MachineInfo(
- detect_system(),
+ system,
detect_cpu_family(compilers) if compilers is not None else None,
detect_cpu(compilers) if compilers is not None else None,
- sys.byteorder)
+ sys.byteorder,
+ detect_kernel(system),
+ detect_userland(system))
# TODO make this compare two `MachineInfo`s purely. How important is the
# `detect_cpu_family({})` distinction? It is the one impediment to that.