From 208a4923edd990535a9bbf73bf39a8609771aec3 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Fri, 11 May 2012 14:25:30 +0000 Subject: [PATCH] PR binutils/14028 * configure.in: Invoke ACX_HEADER_STRING. * configure: Regenerate. * config.in: Regenerate. * sysdep.h: If STRINGS_WITH_STRING is defined then include both string.h and strings.h. --- binutils/ChangeLog | 13 +++++++++++-- binutils/configure | 1 + binutils/configure.in | 1 + binutils/sysdep.h | 5 +++++ gas/ChangeLog | 9 +++++++++ gas/as.h | 9 ++++++++- gas/configure | 1 + gas/configure.in | 1 + ld/ChangeLog | 9 +++++++++ ld/config.in | 3 +++ ld/configure | 32 ++++++++++++++++++++++++++++++++ ld/configure.in | 1 + ld/sysdep.h | 7 ++++++- opcodes/ChangeLog | 9 +++++++++ opcodes/config.in | 3 +++ opcodes/configure | 32 ++++++++++++++++++++++++++++++++ opcodes/configure.in | 1 + opcodes/sysdep.h | 7 ++++++- 18 files changed, 139 insertions(+), 5 deletions(-) diff --git a/binutils/ChangeLog b/binutils/ChangeLog index c5b85c065c..f620fe02a6 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,12 +1,21 @@ +2012-05-11 Daniel Richard G. + + PR binutils/14028 + * configure.in: Invoke ACX_HEADER_STRING. + * configure: Regenerate. + * config.in: Regenerate. + * sysdep.h: If STRINGS_WITH_STRING is defined then include both + string.h and strings.h. + 2012-05-10 Jakub Jelinek * dwarf.c (read_and_display_attr_value): Don't look up tag from abbrev for DW_FORM_ref_addr. 2012-05-08 Sean Keys - + * binutils/MAINTAINERS: Added my entry to the maintainers secion. - + 2012-05-08 Cary Coutant * doc/binutils.texi (objcopy): Add --strip-dwo, --extract-dwo options. diff --git a/binutils/configure b/binutils/configure index 656918125f..e7f03c5f13 100755 --- a/binutils/configure +++ b/binutils/configure @@ -12491,6 +12491,7 @@ $as_echo "#define HAVE_SYS_WAIT_H 1" >>confdefs.h fi +ACX_HEADER_STRING # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 diff --git a/binutils/configure.in b/binutils/configure.in index 9ba8c77723..0d037428c9 100644 --- a/binutils/configure.in +++ b/binutils/configure.in @@ -91,6 +91,7 @@ AC_SUBST(DEMANGLER_NAME) AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h limits.h locale.h sys/param.h) AC_HEADER_SYS_WAIT +ACX_HEADER_STRING AC_FUNC_ALLOCA AC_CHECK_FUNCS(sbrk utimes setmode getc_unlocked strcoll setlocale) AC_CHECK_FUNC([mkstemp], diff --git a/binutils/sysdep.h b/binutils/sysdep.h index 0e1d502fcd..5164e791c5 100644 --- a/binutils/sysdep.h +++ b/binutils/sysdep.h @@ -46,6 +46,10 @@ extern int errno; #include #endif +#ifdef STRING_WITH_STRINGS +#include +#include +#else #ifdef HAVE_STRING_H #include #else @@ -56,6 +60,7 @@ extern char *strchr (); extern char *strrchr (); #endif #endif +#endif #ifdef HAVE_STDLIB_H #include diff --git a/gas/ChangeLog b/gas/ChangeLog index 82ef7b7dee..5eb6d0ae6a 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,12 @@ +2012-05-11 Daniel Richard G. + + PR binutils/14028 + * configure.in: Invoke ACX_HEADER_STRING. + * configure: Regenerate. + * config.in: Regenerate. + * as.h: If STRINGS_WITH_STRING is defined then include both + string.h and strings.h. + 2012-05-11 Georg-Johann Lay + +#ifdef STRING_WITH_STRINGS +#include +#include +#else #ifdef HAVE_STRING_H #include #else @@ -49,6 +54,8 @@ #include #endif #endif +#endif + #ifdef HAVE_STDLIB_H #include #endif diff --git a/gas/configure b/gas/configure index 9f81627c12..c20a890ea3 100755 --- a/gas/configure +++ b/gas/configure @@ -13180,6 +13180,7 @@ fi done +ACX_HEADER_STRING # Put this here so that autoconf's "cross-compiling" message doesn't confuse # people who are not cross-compiling but are compiling cross-assemblers. diff --git a/gas/configure.in b/gas/configure.in index 618095cce2..280fc701fe 100644 --- a/gas/configure.in +++ b/gas/configure.in @@ -634,6 +634,7 @@ AM_CONDITIONAL(GENINSRC_NEVER, false) AC_EXEEXT AC_CHECK_HEADERS(string.h stdlib.h memory.h strings.h unistd.h errno.h sys/types.h limits.h locale.h time.h sys/stat.h) +ACX_HEADER_STRING # Put this here so that autoconf's "cross-compiling" message doesn't confuse # people who are not cross-compiling but are compiling cross-assemblers. diff --git a/ld/ChangeLog b/ld/ChangeLog index fb6392cc8b..7c1aef6754 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,12 @@ +2012-05-11 Daniel Richard G. + + PR binutils/14028 + * configure.in: Invoke ACX_HEADER_STRING. + * configure: Regenerate. + * config.in: Regenerate. + * sysdep.h: If STRINGS_WITH_STRING is defined then include both + string.h and strings.h. + 2012-05-08 Alan Modra * Makefile.am (check_DEJAGNU): Export LC_ALL=C in place of other diff --git a/ld/config.in b/ld/config.in index 0a3219e4c0..bb4f5fa516 100644 --- a/ld/config.in +++ b/ld/config.in @@ -178,6 +178,9 @@ /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS +/* Define if you can safely include both and . */ +#undef STRING_WITH_STRINGS + /* Use b modifier when opening binary files? */ #undef USE_BINARY_FOPEN diff --git a/ld/configure b/ld/configure index d0876051d0..85e78ef5aa 100755 --- a/ld/configure +++ b/ld/configure @@ -16216,6 +16216,38 @@ fi done +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether string.h and strings.h may both be included" >&5 +$as_echo_n "checking whether string.h and strings.h may both be included... " >&6; } +if test "${gcc_cv_header_string+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gcc_cv_header_string=yes +else + gcc_cv_header_string=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_header_string" >&5 +$as_echo "$gcc_cv_header_string" >&6; } +if test $gcc_cv_header_string = yes; then + +$as_echo "#define STRING_WITH_STRINGS 1" >>confdefs.h + +fi + for ac_func in glob mkstemp realpath sbrk setlocale waitpid do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` diff --git a/ld/configure.in b/ld/configure.in index b29923ccc8..160a060e6d 100644 --- a/ld/configure.in +++ b/ld/configure.in @@ -164,6 +164,7 @@ AC_SUBST(NATIVE_LIB_DIRS) AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h elf-hints.h limits.h locale.h sys/param.h) AC_CHECK_HEADERS(fcntl.h sys/file.h sys/time.h sys/stat.h) +ACX_HEADER_STRING AC_CHECK_FUNCS(glob mkstemp realpath sbrk setlocale waitpid) AC_CHECK_FUNCS(open lseek close) AC_HEADER_DIRENT diff --git a/ld/sysdep.h b/ld/sysdep.h index b7d5b88a85..eadee88217 100644 --- a/ld/sysdep.h +++ b/ld/sysdep.h @@ -1,5 +1,5 @@ /* sysdep.h -- handle host dependencies for the GNU linker - Copyright 1995, 1996, 1997, 1999, 2002, 2003, 2005, 2007 + Copyright 1995, 1996, 1997, 1999, 2002, 2003, 2005, 2007, 2012 Free Software Foundation, Inc. This file is part of the GNU Binutils. @@ -29,6 +29,10 @@ #include #include +#ifdef STRING_WITH_STRINGS +#include +#include +#else #ifdef HAVE_STRING_H #include #else @@ -39,6 +43,7 @@ extern char *strchr (); extern char *strrchr (); #endif #endif +#endif #ifdef HAVE_STDLIB_H #include diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index c1cc70b6c3..37f67a3f41 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,12 @@ +2012-05-11 Daniel Richard G. + + PR binutils/14028 + * configure.in: Invoke ACX_HEADER_STRING. + * configure: Regenerate. + * config.in: Regenerate. + * sysdep.h: If STRINGS_WITH_STRING is defined then include both + string.h and strings.h. + 2012-05-11 Nick Clifton PR binutils/14006 diff --git a/opcodes/config.in b/opcodes/config.in index fab2a5120f..4eec821b30 100644 --- a/opcodes/config.in +++ b/opcodes/config.in @@ -73,6 +73,9 @@ /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS +/* Define if you can safely include both and . */ +#undef STRING_WITH_STRINGS + /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE diff --git a/opcodes/configure b/opcodes/configure index ec7434683e..1613ae055e 100755 --- a/opcodes/configure +++ b/opcodes/configure @@ -12089,6 +12089,38 @@ fi done +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether string.h and strings.h may both be included" >&5 +$as_echo_n "checking whether string.h and strings.h may both be included... " >&6; } +if test "${gcc_cv_header_string+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gcc_cv_header_string=yes +else + gcc_cv_header_string=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_header_string" >&5 +$as_echo "$gcc_cv_header_string" >&6; } +if test $gcc_cv_header_string = yes; then + +$as_echo "#define STRING_WITH_STRINGS 1" >>confdefs.h + +fi + ac_fn_c_check_decl "$LINENO" "basename" "ac_cv_have_decl_basename" "$ac_includes_default" if test "x$ac_cv_have_decl_basename" = x""yes; then : diff --git a/opcodes/configure.in b/opcodes/configure.in index 999379a3b2..1d3f2d9ca6 100644 --- a/opcodes/configure.in +++ b/opcodes/configure.in @@ -67,6 +67,7 @@ AC_SUBST(HDEFINES) AC_PROG_INSTALL AC_CHECK_HEADERS(string.h strings.h stdlib.h limits.h) +ACX_HEADER_STRING AC_CHECK_DECLS([basename, stpcpy]) diff --git a/opcodes/sysdep.h b/opcodes/sysdep.h index 2ca3935067..91c53ca9c9 100644 --- a/opcodes/sysdep.h +++ b/opcodes/sysdep.h @@ -1,5 +1,5 @@ /* Random host-dependent support code. - Copyright 1995, 1997, 2000, 2005, 2007 Free Software Foundation, Inc. + Copyright 1995, 1997, 2000, 2005, 2007, 2012 Free Software Foundation, Inc. Written by Ken Raeburn. This file is part of the GNU opcodes library. @@ -35,6 +35,10 @@ #include #endif +#ifdef STRING_WITH_STRINGS +#include +#include +#else #ifdef HAVE_STRING_H #include #else @@ -42,6 +46,7 @@ #include #endif #endif +#endif #if !HAVE_DECL_STPCPY extern char *stpcpy (char *__dest, const char *__src); -- 2.34.1