Enable build on IBM i platform (#1630)
* No perfstat for IBM i (OS400) AIX variant
* Allow for future IBM i to identify as 'os400'
diff --git a/configure.py b/configure.py
index 0393cdd..529c0e9 100755
--- a/configure.py
+++ b/configure.py
@@ -60,6 +60,8 @@
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 @@
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 @@
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 @@
return posix_compatible_load;
}
+#elif defined(__PASE__)
+double GetLoadAverage() {
+ return -0.0f;
+}
#elif defined(_AIX)
double GetLoadAverage() {
perfstat_cpu_total_t cpu_stats;