diff options
author | ThePrez <jgorzinski@gmail.com> | 2019-08-09 16:05:12 (GMT) |
---|---|---|
committer | Jan Niklas Hasse <jhasse@bixense.com> | 2019-08-09 16:05:12 (GMT) |
commit | bd17f236231a58c44f1f5f09ff925aa666d672b7 (patch) | |
tree | 815c964013336e3cf4543e5a0bfe49981f5f96ba | |
parent | 6d8c19a13f40c05696d6dea3e28f6b99d55f6eaf (diff) | |
download | Ninja-bd17f236231a58c44f1f5f09ff925aa666d672b7.zip Ninja-bd17f236231a58c44f1f5f09ff925aa666d672b7.tar.gz Ninja-bd17f236231a58c44f1f5f09ff925aa666d672b7.tar.bz2 |
Enable build on IBM i platform (#1630)
* No perfstat for IBM i (OS400) AIX variant
* Allow for future IBM i to identify as 'os400'
-rwxr-xr-x | configure.py | 7 | ||||
-rw-r--r-- | 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 <unistd.h> #include <sys/loadavg.h> -#elif defined(_AIX) +#elif defined(_AIX) && !defined(__PASE__) #include <libperfstat.h> #elif defined(linux) || defined(__GLIBC__) #include <sys/sysinfo.h> @@ -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; |