aboutsummaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2009-03-01 09:03:08 +0200
committerLasse Collin <lasse.collin@tukaani.org>2009-03-01 09:03:08 +0200
commit0df9299e2478c2a0c62c05b1ae14a85a353e20d6 (patch)
tree62a1288f62f78ac5160bbf5ab75305aa2f57e6c2 /m4
parentAdded AC_CONFIG_MACRO_DIR to configure.ac. (diff)
downloadxz-0df9299e2478c2a0c62c05b1ae14a85a353e20d6.tar.xz
Test for Linux-specific sysinfo() only on Linux systems.
Some other systems have sysinfo() with different semantics.
Diffstat (limited to 'm4')
-rw-r--r--m4/lc_physmem.m428
1 files changed, 19 insertions, 9 deletions
diff --git a/m4/lc_physmem.m4 b/m4/lc_physmem.m4
index 8633f4a1..78be1362 100644
--- a/m4/lc_physmem.m4
+++ b/m4/lc_physmem.m4
@@ -54,7 +54,11 @@ main(void)
with sysctl().])
AC_MSG_RESULT([sysctl])
], [
-AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+dnl sysinfo() is Linux-specific. Some non-Linux systems have
+dnl incompatible sysinfo() so we must check $host_os.
+case $host_os in
+ linux*)
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#include <sys/sysinfo.h>
int
main(void)
@@ -63,12 +67,18 @@ main(void)
sysinfo(&si);
return 0;
}
-]])], [
- AC_DEFINE([HAVE_PHYSMEM_SYSINFO], [1],
- [Define to 1 if the amount of physical memory can be detected
- with sysinfo().])
- AC_MSG_RESULT([sysinfo])
-], [
- AC_MSG_RESULT([unknown])
-])])])
+ ]])], [
+ AC_DEFINE([HAVE_PHYSMEM_SYSINFO], [1],
+ [Define to 1 if the amount of physical memory
+ can be detected with Linux sysinfo().])
+ AC_MSG_RESULT([sysinfo])
+ ], [
+ AC_MSG_RESULT([unknown])
+ ])
+ ;;
+ *)
+ AC_MSG_RESULT([unknown])
+ ;;
+esac
+])])
])dnl lc_PHYSMEM