summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2012-05-11 14:25:29 +0000
committerNick Clifton <nickc@redhat.com>2012-05-11 14:25:29 +0000
commitbf8dde2a61cfc8261c156a2ae67aed967af9a6d2 (patch)
tree3f25e46ce9b41a9aa67bde98c9c2f4816bafadb8
parente1472911964d98cb3adacb6e401e849a1ebe936e (diff)
downloadgdb-bf8dde2a61cfc8261c156a2ae67aed967af9a6d2.tar.gz
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.
-rw-r--r--opcodes/ChangeLog9
-rw-r--r--opcodes/config.in3
-rwxr-xr-xopcodes/configure32
-rw-r--r--opcodes/configure.in1
-rw-r--r--opcodes/sysdep.h7
5 files changed, 51 insertions, 1 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index c1cc70b6c38..37f67a3f416 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,12 @@
+2012-05-11 Daniel Richard G. <skunk@iskunk.org>
+
+ 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 <nickc@redhat.com>
PR binutils/14006
diff --git a/opcodes/config.in b/opcodes/config.in
index fab2a5120f6..4eec821b30b 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 <string.h> and <strings.h>. */
+#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 ec7434683e8..1613ae055e3 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 <string.h>
+#include <strings.h>
+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 999379a3b25..1d3f2d9ca68 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 2ca39350675..91c53ca9c9f 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 <stdlib.h>
#endif
+#ifdef STRING_WITH_STRINGS
+#include <string.h>
+#include <strings.h>
+#else
#ifdef HAVE_STRING_H
#include <string.h>
#else
@@ -42,6 +46,7 @@
#include <strings.h>
#endif
#endif
+#endif
#if !HAVE_DECL_STPCPY
extern char *stpcpy (char *__dest, const char *__src);