aboutsummaryrefslogtreecommitdiff
path: root/m4/tuklib_physmem.m4
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2010-01-12 16:18:14 +0200
committerLasse Collin <lasse.collin@tukaani.org>2010-01-12 16:18:14 +0200
commit153c7740c54b3c90129dbd3d6153ac1303c4d605 (patch)
treedf4b8812a8b5c1cf71704134d87f667846b3a07c /m4/tuklib_physmem.m4
parentFix _memconfig() functions. (diff)
downloadxz-153c7740c54b3c90129dbd3d6153ac1303c4d605.tar.xz
Add IRIX-specific code to tuklib_physmem and tuklib_cpucores.
This is untested but it will get tested soon and, if needed, fixed before 5.0.0. Thanks to Stuart Shelton.
Diffstat (limited to '')
-rw-r--r--m4/tuklib_physmem.m422
1 files changed, 21 insertions, 1 deletions
diff --git a/m4/tuklib_physmem.m4 b/m4/tuklib_physmem.m4
index 59a645a4..a8c869f3 100644
--- a/m4/tuklib_physmem.m4
+++ b/m4/tuklib_physmem.m4
@@ -18,6 +18,8 @@
#
# - BSDs use sysctl().
#
+# - IRIX has setinvent_r(), getinvent_r(), and endinvent_r().
+#
# - sysinfo() works on Linux/dietlibc and probably on other Linux
# systems whose libc may lack sysconf().
#
@@ -78,6 +80,19 @@ main(void)
}
]])], [tuklib_cv_physmem_method=sysctl], [
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+#include <invent.h>
+int
+main(void)
+{
+ inv_state_t *st = NULL;
+ setinvent_r(&st);
+ getinvent_r(st);
+ endinvent_r(st);
+ return 0;
+}
+]])], [tuklib_cv_physmem_method=getinvent_r], [
+
# This version of sysinfo() is Linux-specific. Some non-Linux systems have
# different sysinfo() so we must check $host_os.
case $host_os in
@@ -101,7 +116,7 @@ main(void)
tuklib_cv_physmem_method=unknown
;;
esac
-])])])])
+])])])])])
case $tuklib_cv_physmem_method in
sysconf)
AC_DEFINE([TUKLIB_PHYSMEM_SYSCONF], [1],
@@ -114,6 +129,11 @@ case $tuklib_cv_physmem_method in
[Define to 1 if the amount of physical memory can
be detected with sysctl().])
;;
+ getinvent_r)
+ AC_DEFINE([TUKLIB_PHYSMEM_GETINVENT_R], [1],
+ [Define to 1 if the amount of physical memory
+ can be detected with getinvent_r().])
+ ;;
sysinfo)
AC_DEFINE([TUKLIB_PHYSMEM_SYSINFO], [1],
[Define to 1 if the amount of physical memory