getloadavg: use libperfstat on AIX5
[pspp] / m4 / getloadavg.m4
index 8243729197ccd8d95b6433745a93629f2fe84b3f..c1547c745c3baf13d50dcfda6ccce15b8805f510 100644 (file)
@@ -31,6 +31,10 @@ AC_CHECK_FUNCS(pstat_getdynamic)
 AC_CHECK_LIB(kstat, kstat_open)
 test $ac_cv_lib_kstat_kstat_open = yes && gl_have_func=yes
 
+# AIX has libperfstat which does not require root
+AC_CHECK_LIB(perfstat, perfstat_cpu_total)
+test $ac_cv_lib_perfstat_perfstat_cpu_total = yes && gl_have_func=yes
+
 # Some systems with -lutil have (and need) -lkvm as well, some do not.
 # On Solaris, -lkvm requires nlist from -lelf, so check that first
 # to get the right answer into the cache.