From 62df20656565cd422330ae2b2aebf61c67cbaf22 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Sun, 23 Jul 2000 19:20:18 +0000 Subject: [PATCH] * configure.in (AC_CHECK_HEADERS): Add time.h. (AC_HEADER_TIME): Add check. * configure, config.in: Regenerate. * getruntime.c: Portably #include and/or . --- libiberty/ChangeLog | 13 +++ libiberty/Makefile.in | 2 + libiberty/config.in | 9 ++ libiberty/configure | 199 ++++++++++++++++++++++++----------------- libiberty/configure.in | 3 +- libiberty/getruntime.c | 14 ++- libiberty/sort.c | 5 ++ libiberty/strtol.c | 8 ++ libiberty/strtoul.c | 8 ++ 9 files changed, 176 insertions(+), 85 deletions(-) diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index 20e010475fa..7b07e6445cd 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,4 +1,17 @@ 2000-07-23 Michael Sokolov + Jeff Law + + * configure.in (AC_CHECK_HEADERS): Add time.h. + (AC_HEADER_TIME): Add check. + * configure, config.in: Regenerate. + * getruntime.c: Portably #include and/or . + + * configure.in (AC_CHECK_HEADERS): Add limits.h. + * configure, config.in: Regenerate. + * sort.c: Portably #include and/or . + * strtol.c, strtoul.c: #include "config.h". Portably #include + and/or . + * Makefile.in (strtol.o, strtoul.o): Update dependencies. * aclocal.m4 (libiberty_AC_DECLARE_ERRNO): New macro. * configure.in (libiberty_AC_DECLARE_ERRNO): Add check. diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in index a95adcdccc0..0463dff4d8b 100644 --- a/libiberty/Makefile.in +++ b/libiberty/Makefile.in @@ -286,6 +286,8 @@ spaces.o: $(INCDIR)/libiberty.h splay-tree.o: config.h $(INCDIR)/libiberty.h $(INCDIR)/splay-tree.h $(INCDIR)/ansidecl.h strerror.o: config.h $(INCDIR)/libiberty.h strsignal.o: config.h $(INCDIR)/libiberty.h +strtol.o: config.h +strtoul.o: config.h xatexit.o: $(INCDIR)/libiberty.h xexit.o: $(INCDIR)/libiberty.h xmalloc.o: config.h $(INCDIR)/libiberty.h diff --git a/libiberty/config.in b/libiberty/config.in index f9895c7c57a..797e2a74bd6 100644 --- a/libiberty/config.in +++ b/libiberty/config.in @@ -40,6 +40,9 @@ /* Define if you have the ANSI C header files. */ #undef STDC_HEADERS +/* Define if you can safely include both and . */ +#undef TIME_WITH_SYS_TIME + /* Define vfork as fork if vfork does not work. */ #undef vfork @@ -202,6 +205,9 @@ /* Define if you have the header file. */ #undef HAVE_FCNTL_H +/* Define if you have the header file. */ +#undef HAVE_LIMITS_H + /* Define if you have the header file. */ #undef HAVE_STDLIB_H @@ -229,6 +235,9 @@ /* Define if you have the header file. */ #undef HAVE_SYS_TIME_H +/* Define if you have the header file. */ +#undef HAVE_TIME_H + /* Define if you have the header file. */ #undef HAVE_UNISTD_H diff --git a/libiberty/configure b/libiberty/configure index 168bd8fc7a5..1054b3bd041 100755 --- a/libiberty/configure +++ b/libiberty/configure @@ -1058,7 +1058,7 @@ else fi echo "$ac_t""$CPP" 1>&6 -for ac_hdr in sys/file.h sys/param.h stdlib.h string.h unistd.h strings.h sys/time.h sys/resource.h sys/stat.h sys/mman.h fcntl.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 do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 @@ -1140,21 +1140,56 @@ EOF fi +echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 +echo "configure:1145: checking whether time.h and sys/time.h may both be included" >&5 +if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +#include +int main() { +struct tm *tp; +; return 0; } +EOF +if { (eval echo configure:1159: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_header_time=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_header_time=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_header_time" 1>&6 +if test $ac_cv_header_time = yes; then + cat >> confdefs.h <<\EOF +#define TIME_WITH_SYS_TIME 1 +EOF + +fi + echo $ac_n "checking whether errno must be declared""... $ac_c" 1>&6 -echo "configure:1146: checking whether errno must be declared" >&5 +echo "configure:1181: checking whether errno must be declared" >&5 if eval "test \"`echo '$''{'libiberty_cv_declare_errno'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { int x = errno; ; return 0; } EOF -if { (eval echo configure:1158: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1193: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* libiberty_cv_declare_errno=no else @@ -1230,12 +1265,12 @@ if test "x" = "y"; then for ac_func in asprintf atexit basename bcmp bcopy bzero calloc clock getcwd do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1234: checking for $ac_func" >&5 +echo "configure:1269: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1297: \"$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 @@ -1285,12 +1320,12 @@ done for ac_func in getpagesize index insque mkstemps memchr memcmp memcpy memmove do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1289: checking for $ac_func" >&5 +echo "configure:1324: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1352: \"$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 @@ -1340,12 +1375,12 @@ done for ac_func in memset putenv random rename rindex sigsetmask strcasecmp do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1344: checking for $ac_func" >&5 +echo "configure:1379: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1407: \"$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 @@ -1395,12 +1430,12 @@ done for ac_func in setenv strchr strdup strncasecmp strrchr strstr strtod strtol do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1399: checking for $ac_func" >&5 +echo "configure:1434: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1462: \"$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 @@ -1450,12 +1485,12 @@ done for ac_func in strtoul tmpnam vasprintf vfprintf vprintf vsprintf waitpid do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1454: checking for $ac_func" >&5 +echo "configure:1489: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1517: \"$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 @@ -1517,12 +1552,12 @@ EOF for ac_func in getrusage on_exit psignal strerror strsignal sysconf times do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1521: checking for $ac_func" >&5 +echo "configure:1556: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1584: \"$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 @@ -1572,12 +1607,12 @@ done for ac_func in sbrk gettimeofday do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1576: checking for $ac_func" >&5 +echo "configure:1611: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1639: \"$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 @@ -1782,7 +1817,7 @@ EOF # 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:1786: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1821: 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. @@ -1793,12 +1828,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 1797 "configure" +#line 1832 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1802: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1837: \"$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 @@ -1824,19 +1859,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:1828: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1863: 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:1835: checking for $ac_func" >&5 +echo "configure:1870: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1898: \"$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 @@ -1906,19 +1941,19 @@ EOF # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:1910: checking for working alloca.h" >&5 +echo "configure:1945: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:1922: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1957: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -1939,12 +1974,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:1943: checking for alloca" >&5 +echo "configure:1978: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2011: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -2004,12 +2039,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:2008: checking whether alloca needs Cray hooks" >&5 +echo "configure:2043: 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 <&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:2038: checking for $ac_func" >&5 +echo "configure:2073: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2101: \"$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 @@ -2089,7 +2124,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:2093: checking stack direction for C alloca" >&5 +echo "configure:2128: 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 @@ -2097,7 +2132,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2155: \"$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 @@ -2141,12 +2176,12 @@ fi esac echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:2145: checking for ANSI C header files" >&5 +echo "configure:2180: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2154,7 +2189,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2158: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2193: \"$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* @@ -2171,7 +2206,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2189,7 +2224,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2210,7 +2245,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -2221,7 +2256,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:2225: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2260: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -2245,12 +2280,12 @@ EOF fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:2249: checking for pid_t" >&5 +echo "configure:2284: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2279,17 +2314,17 @@ fi ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for vfork.h""... $ac_c" 1>&6 -echo "configure:2283: checking for vfork.h" >&5 +echo "configure:2318: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2293: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2328: \"$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* @@ -2314,18 +2349,18 @@ else fi echo $ac_n "checking for working vfork""... $ac_c" 1>&6 -echo "configure:2318: checking for working vfork" >&5 +echo "configure:2353: 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:2324: checking for vfork" >&5 +echo "configure:2359: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2387: \"$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 @@ -2370,7 +2405,7 @@ fi ac_cv_func_vfork_works=$ac_cv_func_vfork else cat > conftest.$ac_ext < @@ -2465,7 +2500,7 @@ main() { } } EOF -if { (eval echo configure:2469: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2504: \"$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 @@ -2492,19 +2527,19 @@ fi fi for v in $vars; do echo $ac_n "checking for $v""... $ac_c" 1>&6 -echo "configure:2496: checking for $v" >&5 +echo "configure:2531: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2543: \"$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 @@ -2530,12 +2565,12 @@ EOF for ac_func in $checkfuncs do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2534: checking for $ac_func" >&5 +echo "configure:2569: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2597: \"$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 @@ -2588,17 +2623,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:2592: checking for $ac_hdr" >&5 +echo "configure:2627: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2602: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2637: \"$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* @@ -2627,12 +2662,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2631: checking for $ac_func" >&5 +echo "configure:2666: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2694: \"$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 @@ -2680,7 +2715,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:2684: checking for working mmap" >&5 +echo "configure:2719: 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 @@ -2688,7 +2723,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2867: \"$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 @@ -2852,7 +2887,7 @@ fi echo $ac_n "checking for working strncmp""... $ac_c" 1>&6 -echo "configure:2856: checking for working strncmp" >&5 +echo "configure:2891: 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 @@ -2860,7 +2895,7 @@ else ac_cv_func_strncmp_works=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2960: \"$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 ecae1b1b63b..041a43dc3c7 100644 --- a/libiberty/configure.in +++ b/libiberty/configure.in @@ -109,8 +109,9 @@ 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 stdlib.h string.h unistd.h strings.h sys/time.h sys/resource.h sys/stat.h sys/mman.h fcntl.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) AC_HEADER_SYS_WAIT +AC_HEADER_TIME libiberty_AC_DECLARE_ERRNO diff --git a/libiberty/getruntime.c b/libiberty/getruntime.c index b855ea6e82f..4abfa83bf33 100644 --- a/libiberty/getruntime.c +++ b/libiberty/getruntime.c @@ -26,10 +26,20 @@ Boston, MA 02111-1307, USA. */ single way is available for all host systems, nor are there reliable ways to find out which way is correct for a given host. */ -#include +#ifdef TIME_WITH_SYS_TIME +# include +# include +#else +# if HAVE_SYS_TIME_H +# include +# else +# ifdef HAVE_TIME_H +# include +# endif +# endif +#endif #if defined (HAVE_GETRUSAGE) && defined (HAVE_SYS_RESOURCE_H) -#include #include #endif diff --git a/libiberty/sort.c b/libiberty/sort.c index da2d660b6f5..90c97e04e07 100644 --- a/libiberty/sort.c +++ b/libiberty/sort.c @@ -24,7 +24,12 @@ Boston, MA 02111-1307, USA. */ #endif #include "libiberty.h" #include "sort.h" +#ifdef HAVE_LIMITS_H #include +#endif +#ifdef HAVE_SYS_PARAM_H +#include +#endif #ifdef HAVE_STDLIB_H #include #endif diff --git a/libiberty/strtol.c b/libiberty/strtol.c index b4c66c403f7..c05d0dd76a2 100644 --- a/libiberty/strtol.c +++ b/libiberty/strtol.c @@ -28,7 +28,15 @@ * SUCH DAMAGE. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#ifdef HAVE_LIMITS_H #include +#endif +#ifdef HAVE_SYS_PARAM_H +#include +#endif #include #include #ifdef NEED_DECLARATION_ERRNO diff --git a/libiberty/strtoul.c b/libiberty/strtoul.c index 59d428cd49e..87fa3ffdf93 100644 --- a/libiberty/strtoul.c +++ b/libiberty/strtoul.c @@ -28,7 +28,15 @@ * SUCH DAMAGE. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#ifdef HAVE_LIMITS_H #include +#endif +#ifdef HAVE_SYS_PARAM_H +#include +#endif #include #include #ifdef NEED_DECLARATION_ERRNO -- 2.30.2