From d661332de946c356c10a75e29a48f2c2e3599fec Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Mon, 12 Aug 2013 14:38:22 +0200 Subject: Check for struct sysinfo as well as Non-linux glibc systems have the latter but not the former. Signed-off-by: Julien Cristau --- configure.ac | 2 +- src/sna/kgem.c | 4 ++-- 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 ]])) 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 #endif -#if HAVE_SYS_SYSINFO_H +#ifdef HAVE_STRUCT_SYSINFO_TOTALRAM #include #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; -- cgit v1.2.3