summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Cristau <jcristau@debian.org>2013-08-12 14:38:22 +0200
committerChris Wilson <chris@chris-wilson.co.uk>2013-08-12 22:42:12 +0100
commitd661332de946c356c10a75e29a48f2c2e3599fec (patch)
tree9959ab12d43f7689797355d5fd00c80b90affa50
parent5775731b6489c63212914163f51b7a576df70658 (diff)
Check for struct sysinfo as well as <sys/sysinfo.h>
Non-linux glibc systems have the latter but not the former. Signed-off-by: Julien Cristau <jcristau@debian.org>
-rw-r--r--configure.ac2
-rw-r--r--src/sna/kgem.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 25592540..318863e9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -211,7 +211,7 @@ AC_ARG_ENABLE(sna,
if test "x$SNA" != "xno"; then
AC_DEFINE(USE_SNA, 1, [Enable SNA support])
- AC_CHECK_HEADERS([sys/sysinfo.h])
+ AC_CHECK_HEADERS([sys/sysinfo.h], AC_CHECK_MEMBERS([struct sysinfo.totalram], [], [], [[#include <sys/sysinfo.h>]]))
fi
AC_MSG_CHECKING([whether to include SNA support])
AM_CONDITIONAL(SNA, test x$SNA != xno)
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 5afe05f3..98e801a2 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -46,7 +46,7 @@
#include <memcheck.h>
#endif
-#if HAVE_SYS_SYSINFO_H
+#ifdef HAVE_STRUCT_SYSINFO_TOTALRAM
#include <sys/sysinfo.h>
#endif
@@ -694,7 +694,7 @@ agp_aperture_size(struct pci_device *dev, unsigned gen)
static size_t
total_ram_size(void)
{
-#if HAVE_SYS_SYSINFO_H
+#ifdef HAVE_STRUCT_SYSINFO_TOTALRAM
struct sysinfo info;
if (sysinfo(&info) == 0)
return info.totalram * info.mem_unit;