diff options
author | Rainer Orth <ro@gcc.gnu.org> | 2003-02-21 20:43:51 +0000 |
---|---|---|
committer | Rainer Orth <ro@gcc.gnu.org> | 2003-02-21 20:43:51 +0000 |
commit | 5d2ed73ec5fdc179870c31f8ad2cc59103a611ea (patch) | |
tree | 1c261c273b56400f92a87f62f8358ecb8768ecd1 /libiberty | |
parent | 5d27ea5f519cd7ab32691611ce3090cc903dc7ca (diff) |
physmem.c (physmem_total): Use getsysinfo on Tru64 UNIX.
* physmem.c (physmem_total) [HAVE_GETSYSINFO]: Use getsysinfo on
Tru64 UNIX.
(physmem_available) [HAVE_TABLE && HAVE_SYS_TABLE_H]: Use table on
Tru64 UNIX.
* configure.in (AC_CHECK_HEADERS): Check for sys/sysinfo.h,
machine/hal_sysinfo.h, sys/table.h.
(checkfuncs, AC_CHECKFUNCS): Check for getsysinfo, table.
* configure, config.in: Regenerate.
From-SVN: r63242
Diffstat (limited to 'libiberty')
-rw-r--r-- | libiberty/ChangeLog | 19 | ||||
-rw-r--r-- | libiberty/config.in | 15 | ||||
-rwxr-xr-x | libiberty/configure | 149 | ||||
-rw-r--r-- | libiberty/configure.in | 5 | ||||
-rw-r--r-- | libiberty/physmem.c | 39 |
5 files changed, 151 insertions, 76 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index ab962f4a3c3..08243db01b8 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,22 @@ +2003-02-21 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE> + + * physmem.c (physmem_total) [HAVE_GETSYSINFO]: Use getsysinfo on + Tru64 UNIX. + (physmem_available) [HAVE_TABLE && HAVE_SYS_TABLE_H]: Use table on + Tru64 UNIX. + + * configure.in (AC_CHECK_HEADERS): Check for sys/sysinfo.h, + machine/hal_sysinfo.h, sys/table.h. + (checkfuncs, AC_CHECKFUNCS): Check for getsysinfo, table. + * configure, config.in: Regenerate. + +2003-02-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * configure.in: Check for sys/sysmp.h and sysmp. + * physmem.c: Pull upstream copy, add support for irix6. + + * config.in, configure: Regenerated. + 2003-02-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> * physmem.c (physmem_total, physmem_available): De-ANSI-fy. diff --git a/libiberty/config.in b/libiberty/config.in index 65a336e1c6b..874c1a08bd4 100644 --- a/libiberty/config.in +++ b/libiberty/config.in @@ -78,6 +78,9 @@ /* Define if you have the getrusage function. */ #undef HAVE_GETRUSAGE +/* Define if you have the getsysinfo function. */ +#undef HAVE_GETSYSINFO + /* Define if you have the gettimeofday function. */ #undef HAVE_GETTIMEOFDAY @@ -177,6 +180,9 @@ /* Define if you have the sysmp function. */ #undef HAVE_SYSMP +/* Define if you have the table function. */ +#undef HAVE_TABLE + /* Define if you have the times function. */ #undef HAVE_TIMES @@ -207,6 +213,9 @@ /* Define if you have the <limits.h> header file. */ #undef HAVE_LIMITS_H +/* Define if you have the <machine/hal_sysinfo.h> header file. */ +#undef HAVE_MACHINE_HAL_SYSINFO_H + /* Define if you have the <stdlib.h> header file. */ #undef HAVE_STDLIB_H @@ -234,9 +243,15 @@ /* Define if you have the <sys/stat.h> header file. */ #undef HAVE_SYS_STAT_H +/* Define if you have the <sys/sysinfo.h> header file. */ +#undef HAVE_SYS_SYSINFO_H + /* Define if you have the <sys/sysmp.h> header file. */ #undef HAVE_SYS_SYSMP_H +/* Define if you have the <sys/table.h> header file. */ +#undef HAVE_SYS_TABLE_H + /* Define if you have the <sys/time.h> header file. */ #undef HAVE_SYS_TIME_H diff --git a/libiberty/configure b/libiberty/configure index 9049b9630fe..7bd633a516d 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 +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 do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 @@ -1738,6 +1738,7 @@ funcs="$funcs waitpid" vars="sys_errlist sys_nerr sys_siglist" checkfuncs="getrusage on_exit psignal strerror strsignal sysconf times sbrk gettimeofday pstat_getstatic pstat_getdynamic sysmp" +checkfuncs="$checkfuncs getsysinfo table" # These are neither executed nor required, but they help keep # autoheader happy without adding a bunch of text to acconfig.h. @@ -1745,12 +1746,12 @@ if test "x" = "y"; then for ac_func in asprintf atexit basename bcmp bcopy bsearch bzero calloc clock do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1749: checking for $ac_func" >&5 +echo "configure:1750: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1754 "configure" +#line 1755 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -1773,7 +1774,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:1777: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1778: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1800,12 +1801,12 @@ done for ac_func in getcwd getpagesize index insque mkstemps memchr memcmp memcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1804: checking for $ac_func" >&5 +echo "configure:1805: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1809 "configure" +#line 1810 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -1828,7 +1829,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:1832: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1833: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1855,12 +1856,12 @@ done for ac_func in memmove memset putenv random rename rindex sigsetmask do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1859: checking for $ac_func" >&5 +echo "configure:1860: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1864 "configure" +#line 1865 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -1883,7 +1884,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:1887: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1888: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1910,12 +1911,12 @@ done for ac_func in strcasecmp setenv strchr strdup strncasecmp strrchr strstr do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1914: checking for $ac_func" >&5 +echo "configure:1915: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1919 "configure" +#line 1920 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -1938,7 +1939,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:1942: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1943: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1965,12 +1966,12 @@ done for ac_func in strtod strtol strtoul tmpnam vasprintf vfprintf vprintf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1969: checking for $ac_func" >&5 +echo "configure:1970: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1974 "configure" +#line 1975 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -1993,7 +1994,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:1997: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1998: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2020,12 +2021,12 @@ done for ac_func in vsprintf waitpid getrusage on_exit psignal strerror strsignal do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2024: checking for $ac_func" >&5 +echo "configure:2025: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2029 "configure" +#line 2030 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2048,7 +2049,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2052: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2053: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2075,12 +2076,12 @@ done for ac_func in sysconf times sbrk gettimeofday ffs do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2079: checking for $ac_func" >&5 +echo "configure:2080: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2084 "configure" +#line 2085 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2103,7 +2104,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2107: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2108: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2127,15 +2128,15 @@ else fi done - for ac_func in pstat_getstatic pstat_getdynamic sysmp + for ac_func in pstat_getstatic pstat_getdynamic sysmp getsysinfo table do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2134: checking for $ac_func" >&5 +echo "configure:2135: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2139 "configure" +#line 2140 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2158,7 +2159,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2162: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2163: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2388,7 +2389,7 @@ if test -z "${setobjs}"; then # We haven't set the list of objects yet. Use the standard autoconf # tests. This will only work if the compiler works. echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:2392: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:2393: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -2399,12 +2400,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 2403 "configure" +#line 2404 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:2408: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2409: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -2430,19 +2431,19 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:2434: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:2435: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross for ac_func in $funcs do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2441: checking for $ac_func" >&5 +echo "configure:2442: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2446 "configure" +#line 2447 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2465,7 +2466,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2469: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2470: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2492,12 +2493,12 @@ done echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:2496: checking whether alloca needs Cray hooks" >&5 +echo "configure:2497: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2501 "configure" +#line 2502 "configure" #include "confdefs.h" #if defined(CRAY) && ! defined(CRAY2) webecray @@ -2522,12 +2523,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2526: checking for $ac_func" >&5 +echo "configure:2527: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2531 "configure" +#line 2532 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2550,7 +2551,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2554: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2555: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2576,7 +2577,7 @@ fi fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:2580: checking stack direction for C alloca" >&5 +echo "configure:2581: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2584,7 +2585,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <<EOF -#line 2588 "configure" +#line 2589 "configure" #include "confdefs.h" find_stack_direction () { @@ -2603,7 +2604,7 @@ main () exit (find_stack_direction() < 0); } EOF -if { (eval echo configure:2607: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2608: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -2625,17 +2626,17 @@ EOF ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for vfork.h""... $ac_c" 1>&6 -echo "configure:2629: checking for vfork.h" >&5 +echo "configure:2630: checking for vfork.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2634 "configure" +#line 2635 "configure" #include "confdefs.h" #include <vfork.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2639: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2640: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2660,18 +2661,18 @@ else fi echo $ac_n "checking for working vfork""... $ac_c" 1>&6 -echo "configure:2664: checking for working vfork" >&5 +echo "configure:2665: checking for working vfork" >&5 if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then echo $ac_n "checking for vfork""... $ac_c" 1>&6 -echo "configure:2670: checking for vfork" >&5 +echo "configure:2671: checking for vfork" >&5 if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2675 "configure" +#line 2676 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char vfork(); below. */ @@ -2694,7 +2695,7 @@ vfork(); ; return 0; } EOF -if { (eval echo configure:2698: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2699: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_vfork=yes" else @@ -2716,7 +2717,7 @@ fi ac_cv_func_vfork_works=$ac_cv_func_vfork else cat > conftest.$ac_ext <<EOF -#line 2720 "configure" +#line 2721 "configure" #include "confdefs.h" /* Thanks to Paul Eggert for this test. */ #include <stdio.h> @@ -2811,7 +2812,7 @@ main() { } } EOF -if { (eval echo configure:2815: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2816: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_vfork_works=yes else @@ -2843,12 +2844,12 @@ fi for ac_func in _doprnt do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2847: checking for $ac_func" >&5 +echo "configure:2848: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2852 "configure" +#line 2853 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2871,7 +2872,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2875: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2876: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2901,12 +2902,12 @@ done for ac_func in _doprnt do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2905: checking for $ac_func" >&5 +echo "configure:2906: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2910 "configure" +#line 2911 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2929,7 +2930,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2933: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2957,19 +2958,19 @@ done for v in $vars; do echo $ac_n "checking for $v""... $ac_c" 1>&6 -echo "configure:2961: checking for $v" >&5 +echo "configure:2962: checking for $v" >&5 if eval "test \"`echo '$''{'libiberty_cv_var_$v'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2966 "configure" +#line 2967 "configure" #include "confdefs.h" int *p; int main() { extern int $v []; p = $v; ; return 0; } EOF -if { (eval echo configure:2973: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2974: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "libiberty_cv_var_$v=yes" else @@ -2995,12 +2996,12 @@ EOF for ac_func in $checkfuncs do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2999: checking for $ac_func" >&5 +echo "configure:3000: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3004 "configure" +#line 3005 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -3023,7 +3024,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:3027: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3028: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3053,17 +3054,17 @@ for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3057: checking for $ac_hdr" >&5 +echo "configure:3058: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3062 "configure" +#line 3063 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3067: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3068: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3092,12 +3093,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3096: checking for $ac_func" >&5 +echo "configure:3097: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3101 "configure" +#line 3102 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -3120,7 +3121,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:3124: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3125: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3145,7 +3146,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:3149: checking for working mmap" >&5 +echo "configure:3150: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3153,7 +3154,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <<EOF -#line 3157 "configure" +#line 3158 "configure" #include "confdefs.h" /* Thanks to Mike Haertel and Jim Avera for this test. @@ -3293,7 +3294,7 @@ main() } EOF -if { (eval echo configure:3297: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3298: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -3317,7 +3318,7 @@ fi echo $ac_n "checking for working strncmp""... $ac_c" 1>&6 -echo "configure:3321: checking for working strncmp" >&5 +echo "configure:3322: checking for working strncmp" >&5 if eval "test \"`echo '$''{'ac_cv_func_strncmp_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3325,7 +3326,7 @@ else ac_cv_func_strncmp_works=no else cat > conftest.$ac_ext <<EOF -#line 3329 "configure" +#line 3330 "configure" #include "confdefs.h" /* Test by Jim Wilson and Kaveh Ghazi. @@ -3389,7 +3390,7 @@ main () } EOF -if { (eval echo configure:3393: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3394: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_strncmp_works=yes else diff --git a/libiberty/configure.in b/libiberty/configure.in index fb7fbffe8fd..3341a641958 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) +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) AC_HEADER_SYS_WAIT AC_HEADER_TIME @@ -207,6 +207,7 @@ funcs="$funcs waitpid" vars="sys_errlist sys_nerr sys_siglist" checkfuncs="getrusage on_exit psignal strerror strsignal sysconf times sbrk gettimeofday pstat_getstatic pstat_getdynamic sysmp" +checkfuncs="$checkfuncs getsysinfo table" # These are neither executed nor required, but they help keep # autoheader happy without adding a bunch of text to acconfig.h. @@ -218,7 +219,7 @@ if test "x" = "y"; then AC_CHECK_FUNCS(strtod strtol strtoul tmpnam vasprintf vfprintf vprintf) AC_CHECK_FUNCS(vsprintf waitpid getrusage on_exit psignal strerror strsignal) AC_CHECK_FUNCS(sysconf times sbrk gettimeofday ffs) - AC_CHECK_FUNCS(pstat_getstatic pstat_getdynamic sysmp) + AC_CHECK_FUNCS(pstat_getstatic pstat_getdynamic sysmp getsysinfo table) 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.]) diff --git a/libiberty/physmem.c b/libiberty/physmem.c index 52b9c8adfc2..2011f0251bd 100644 --- a/libiberty/physmem.c +++ b/libiberty/physmem.c @@ -33,6 +33,15 @@ #include <sys/sysmp.h> #endif +#if HAVE_SYS_SYSINFO_H && HAVE_MACHINE_HAL_SYSINFO_H +# include <sys/sysinfo.h> +# include <machine/hal_sysinfo.h> +#endif + +#if HAVE_SYS_TABLE_H +# include <sys/table.h> +#endif + #include "libiberty.h" /* Return the total amount of physical memory. */ @@ -74,6 +83,21 @@ physmem_total () } #endif +#if HAVE_GETSYSINFO + { /* This works on Tru64 UNIX V4/5. */ + int physmem; + + if (getsysinfo (GSI_PHYSMEM, (caddr_t) &physmem, sizeof (physmem), + NULL, NULL, NULL) == 1) + { + double kbytes = physmem; + + if (0 <= kbytes) + return kbytes * 1024.0; + } + } +#endif + /* Return 0 if we can't determine the value. */ return 0; } @@ -119,6 +143,21 @@ physmem_available () } #endif +#if HAVE_TABLE && HAVE_SYS_TABLE_H + { /* This works on Tru64 UNIX V4/5. */ + struct tbl_vmstats vmstats; + + if (table (TBL_VMSTATS, 0, &vmstats, 1, sizeof (vmstats)) == 1) + { + double pages = vmstats.free_count; + double pagesize = vmstats.pagesize; + + if (0 <= pages && 0 <= pagesize) + return pages * pagesize; + } + } +#endif + /* Guess 25% of physical memory. */ return physmem_total () / 4; } |