2 dnl Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
7 # Check for the external symbol, _system_configuration,
8 # a struct with member `physmem'.
9 AC_DEFUN([gl_SYS__SYSTEM_CONFIGURATION],
10 [AC_CACHE_CHECK(for external symbol _system_configuration,
11 gl_cv_var__system_configuration,
12 [AC_LINK_IFELSE([AC_LANG_PROGRAM(
13 [[#include <sys/systemcfg.h>
15 [double x = _system_configuration.physmem;])],
16 [gl_cv_var__system_configuration=yes],
17 [gl_cv_var__system_configuration=no])])
19 if test $gl_cv_var__system_configuration = yes; then
20 AC_DEFINE(HAVE__SYSTEM_CONFIGURATION, 1,
21 [Define to 1 if you have the external variable,
22 _system_configuration with a member named physmem.])
27 AC_DEFUN([gl_PHYSMEM],
31 # Prerequisites of lib/physmem.c.
32 AC_CHECK_HEADERS([sys/pstat.h sys/sysmp.h sys/sysinfo.h \
33 machine/hal_sysinfo.h sys/table.h sys/param.h sys/sysctl.h \
34 sys/systemcfg.h],,, [AC_INCLUDES_DEFAULT])
36 AC_CHECK_FUNCS(pstat_getstatic pstat_getdynamic sysmp getsysinfo sysctl table)
37 AC_REQUIRE([gl_SYS__SYSTEM_CONFIGURATION])