diff options
author | Kaveh R. Ghazi <ghazi@caip.rutgers.edu> | 2003-02-22 15:47:36 +0000 |
---|---|---|
committer | Kaveh Ghazi <ghazi@gcc.gnu.org> | 2003-02-22 15:47:36 +0000 |
commit | b9889dc82137185fe3178181e1a876828c1ded0d (patch) | |
tree | d4c88abd391b0ebb3dbd00ac8fda25058344ebe6 /libiberty | |
parent | 9fade48f58d0b8ece2eb9763c131463514c7c482 (diff) |
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: r63288
Diffstat (limited to 'libiberty')
-rw-r--r-- | libiberty/ChangeLog | 7 | ||||
-rw-r--r-- | libiberty/config.in | 6 | ||||
-rwxr-xr-x | libiberty/configure | 8 | ||||
-rw-r--r-- | libiberty/configure.in | 5 | ||||
-rw-r--r-- | libiberty/physmem.c | 27 |
5 files changed, 40 insertions, 13 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index 2a17683c98c..655399850b0 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,4 +1,11 @@ 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> diff --git a/libiberty/config.in b/libiberty/config.in index 22cee8ef222..dbcd7ded84c 100644 --- a/libiberty/config.in +++ b/libiberty/config.in @@ -255,6 +255,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 @@ -282,6 +285,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. */ diff --git a/libiberty/configure b/libiberty/configure index b47da6827fd..00c99f54d12 100755 --- a/libiberty/configure +++ b/libiberty/configure @@ -1356,7 +1356,7 @@ else fi echo "$ac_t""$CPP" 1>&6 -for ac_hdr in 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 +for ac_hdr in 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 do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 @@ -1735,7 +1735,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 pstat_getstatic pstat_getdynamic sysmp getsysinfo table sysctl" @@ -2195,6 +2195,10 @@ EOF #define HAVE_SYS_SIGLIST 1 EOF + cat >> confdefs.h <<\EOF +#define HAVE__SYSTEM_CONFIGURATION 1 +EOF + fi # For each of these functions, if the host does not provide the diff --git a/libiberty/configure.in b/libiberty/configure.in index 5b9ec104234..fe2284c350a 100644 --- a/libiberty/configure.in +++ b/libiberty/configure.in @@ -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 pstat_getstatic pstat_getdynamic sysmp getsysinfo table sysctl" @@ -223,6 +223,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 diff --git a/libiberty/physmem.c b/libiberty/physmem.c index c502a86c118..80fdd7975e9 100644 --- a/libiberty/physmem.c +++ b/libiberty/physmem.c @@ -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,26 +30,30 @@ #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 -# include <sys/sysinfo.h> -# include <machine/hal_sysinfo.h> +# include <sys/sysinfo.h> +# include <machine/hal_sysinfo.h> #endif #if HAVE_SYS_TABLE_H -# include <sys/table.h> +# include <sys/table.h> #endif #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; |