From bd17f236231a58c44f1f5f09ff925aa666d672b7 Mon Sep 17 00:00:00 2001 From: ThePrez Date: Fri, 9 Aug 2019 11:05:12 -0500 Subject: Enable build on IBM i platform (#1630) * No perfstat for IBM i (OS400) AIX variant * Allow for future IBM i to identify as 'os400' --- configure.py | 7 ++++++- src/util.cc | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/configure.py b/configure.py index 0393cdd..529c0e9 100755 --- a/configure.py +++ b/configure.py @@ -60,6 +60,8 @@ class Platform(object): self._platform = 'netbsd' elif self._platform.startswith('aix'): self._platform = 'aix' + elif self._platform.startswith('os400'): + self._platform = 'os400' elif self._platform.startswith('dragonfly'): self._platform = 'dragonfly' @@ -97,6 +99,9 @@ class Platform(object): def is_aix(self): return self._platform == 'aix' + def is_os400_pase(self): + return self._platform == 'os400' or os.uname().sysname.startswith('OS400') + def uses_usr_local(self): return self._platform in ('freebsd', 'openbsd', 'bitrig', 'dragonfly', 'netbsd') @@ -536,7 +541,7 @@ if platform.is_msvc(): else: libs.append('-lninja') -if platform.is_aix(): +if platform.is_aix() and not platform.is_os400_pase(): libs.append('-lperfstat') all_targets = [] diff --git a/src/util.cc b/src/util.cc index f80616b..666cf9d 100644 --- a/src/util.cc +++ b/src/util.cc @@ -45,7 +45,7 @@ #elif defined(__SVR4) && defined(__sun) #include #include -#elif defined(_AIX) +#elif defined(_AIX) && !defined(__PASE__) #include #elif defined(linux) || defined(__GLIBC__) #include @@ -562,6 +562,10 @@ double GetLoadAverage() { return posix_compatible_load; } +#elif defined(__PASE__) +double GetLoadAverage() { + return -0.0f; +} #elif defined(_AIX) double GetLoadAverage() { perfstat_cpu_total_t cpu_stats; -- cgit v0.12