Commit d47f75c4 by Kaveh R. Ghazi Committed by Kaveh Ghazi

configure.in: Check for sys/systemcfg.h and _system_configuration.

	* configure.in: Check for sys/systemcfg.h and
	_system_configuration.
	* physmem.c: Add support for AIX.  Tweek formatting as per
	upstream coreutils beta.

From-SVN: r63287
parent 170230b7
2003-02-22 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* configure.in: Check for sys/systemcfg.h and
_system_configuration.
* physmem.c: Add support for AIX. Tweek formatting as per
upstream coreutils beta.
2003-02-22 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
Richard Earnshaw <rearnsha@arm.com>
Geoffrey Keating <geoffk@apple.com>
......
......@@ -261,6 +261,9 @@
/* Define if you have the <sys/sysmp.h> header file. */
#undef HAVE_SYS_SYSMP_H
/* Define if you have the <sys/systemcfg.h> header file. */
#undef HAVE_SYS_SYSTEMCFG_H
/* Define if you have the <sys/table.h> header file. */
#undef HAVE_SYS_TABLE_H
......@@ -288,6 +291,9 @@
/* Define if you have the sys_siglist variable. */
#undef HAVE_SYS_SIGLIST
/* Define if you have the _system_configuration variable. */
#undef HAVE__SYSTEM_CONFIGURATION
/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP
systems. This function is required for alloca.c support on those
systems. */
......
......@@ -142,7 +142,7 @@ AC_SUBST_FILE(host_makefile_frag)
# It's OK to check for header files. Although the compiler may not be
# able to link anything, it had better be able to at least compile
# something.
AC_CHECK_HEADERS(sys/file.h sys/param.h limits.h stdlib.h string.h unistd.h strings.h sys/time.h time.h sys/resource.h sys/stat.h sys/mman.h fcntl.h alloca.h sys/pstat.h sys/sysmp.h sys/sysinfo.h machine/hal_sysinfo.h sys/table.h sys/sysctl.h)
AC_CHECK_HEADERS(sys/file.h sys/param.h limits.h stdlib.h string.h unistd.h strings.h sys/time.h time.h sys/resource.h sys/stat.h sys/mman.h fcntl.h alloca.h sys/pstat.h sys/sysmp.h sys/sysinfo.h machine/hal_sysinfo.h sys/table.h sys/sysctl.h sys/systemcfg.h)
AC_HEADER_SYS_WAIT
AC_HEADER_TIME
......@@ -204,7 +204,7 @@ funcs="$funcs waitpid"
# Also in the old function.def file: alloca, vfork, getopt.
vars="sys_errlist sys_nerr sys_siglist"
vars="sys_errlist sys_nerr sys_siglist _system_configuration"
checkfuncs="getrusage on_exit psignal strerror strsignal sysconf times sbrk gettimeofday"
checkfuncs="$checkfuncs realpath canonicalize_file_name pstat_getstatic pstat_getdynamic sysmp"
......@@ -225,6 +225,7 @@ if test "x" = "y"; then
AC_DEFINE(HAVE_SYS_ERRLIST, 1, [Define if you have the sys_errlist variable.])
AC_DEFINE(HAVE_SYS_NERR, 1, [Define if you have the sys_nerr variable.])
AC_DEFINE(HAVE_SYS_SIGLIST, 1, [Define if you have the sys_siglist variable.])
AC_DEFINE(HAVE__SYSTEM_CONFIGURATION, 1, [Define if you have the _system_configuration variable.])
fi
# For each of these functions, if the host does not provide the
......
......@@ -15,7 +15,7 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Written by Paul Eggert and Jim Meyering. */
/* Written by Paul Eggert. */
#if HAVE_CONFIG_H
# include <config.h>
......@@ -30,7 +30,7 @@
#endif
#if HAVE_SYS_SYSMP_H
#include <sys/sysmp.h>
# include <sys/sysmp.h>
#endif
#if HAVE_SYS_SYSINFO_H && HAVE_MACHINE_HAL_SYSINFO_H
......@@ -45,11 +45,15 @@
#include <sys/types.h>
#if HAVE_SYS_PARAM_H
#include <sys/param.h>
# include <sys/param.h>
#endif
#if HAVE_SYS_SYSCTL_H
#include <sys/sysctl.h>
# include <sys/sysctl.h>
#endif
#if HAVE_SYS_SYSTEMCFG_H
# include <sys/systemcfg.h>
#endif
#include "libiberty.h"
......@@ -83,7 +87,7 @@ physmem_total ()
#if HAVE_SYSMP && defined MP_SAGET && defined MPSA_RMINFO && defined _SC_PAGESIZE
{ /* This works on irix6. */
struct rminfo realmem;
if (sysmp(MP_SAGET, MPSA_RMINFO, &realmem, sizeof(realmem)) == 0)
if (sysmp (MP_SAGET, MPSA_RMINFO, &realmem, sizeof realmem) == 0)
{
double pagesize = sysconf (_SC_PAGESIZE);
double pages = realmem.physmem;
......@@ -120,6 +124,11 @@ physmem_total ()
}
#endif
#if HAVE__SYSTEM_CONFIGURATION
/* This works on AIX. */
return _system_configuration.physmem;
#endif
/* Return 0 if we can't determine the value. */
return 0;
}
......@@ -155,7 +164,7 @@ physmem_available ()
#if HAVE_SYSMP && defined MP_SAGET && defined MPSA_RMINFO && defined _SC_PAGESIZE
{ /* This works on irix6. */
struct rminfo realmem;
if (sysmp(MP_SAGET, MPSA_RMINFO, &realmem, sizeof(realmem)) == 0)
if (sysmp (MP_SAGET, MPSA_RMINFO, &realmem, sizeof realmem) == 0)
{
double pagesize = sysconf (_SC_PAGESIZE);
double pages = realmem.availrmem;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment