From 208a4923edd990535a9bbf73bf39a8609771aec3 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Fri, 11 May 2012 14:25:30 +0000 Subject: 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. --- ld/ChangeLog | 9 +++++++++ ld/config.in | 3 +++ ld/configure | 32 ++++++++++++++++++++++++++++++++ ld/configure.in | 1 + ld/sysdep.h | 7 ++++++- 5 files changed, 51 insertions(+), 1 deletion(-) (limited to 'ld') diff --git a/ld/ChangeLog b/ld/ChangeLog index fb6392c..7c1aef6 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 0a3219e..bb4f5fa 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 d087605..85e78ef 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 b29923c..160a060 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 b7d5b88..eadee88 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 -- cgit v1.1