This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
[RFA] patch to solve libiberty strsignal changes (plus a minor cross-compilation fix)
- To: gdb-patches at sourceware dot cygnus dot com
- Subject: [RFA] patch to solve libiberty strsignal changes (plus a minor cross-compilation fix)
- From: Chris Faylor <cgf at cygnus dot com>
- Date: Thu, 1 Jun 2000 22:21:33 -0400
- References: <20000531182910.A29100@cygnus.com> <200006010604.CAA09992@indy.delorie.com> <20000601021247.A13381@cygnus.com>
Following Andrew's suggestions, I submit the following for approval.
This patch adds checks for strsignal in string.h and strings.h, moves the
strsignal declaration from defs.h into gdb_string.h and adds a
NEED_DECLARATION_STRSIGNAL to config.in .
This patch also includes what I hope is a no-brainer fix to find the
correct versions of windres and ranlib (aka i686-pc-cygwin-windres and
i686-pc-cygwin-ranlib) when cross compiling.
cgf
Thu Jun 1 22:11:19 2000 Christopher Faylor <cgf@cygnus.com>
* configure.in: Check for declaration of strsignal in string{,s}.h.
Detect correct versions of ranlib and windres when cross-compiling.
* configure: Regenerate.
* config.in: Define NEED_DECLARATION_STRSIGNAL if strsignal is not
declared in system header file.
* defs.h: Move strsignal declaration into gdb_string.h.
* gdb_string.h: Declare strsignal here if if isn't declared anywhere
else.
Index: configure.in
===================================================================
RCS file: /cvs/src/src/gdb/configure.in,v
retrieving revision 1.29
diff -u -p -r1.29 configure.in
--- configure.in 2000/05/26 04:11:34 1.29
+++ configure.in 2000/06/02 02:15:26
@@ -78,6 +78,8 @@ AC_PROG_AWK
AC_PROG_INSTALL
AC_CHECK_TOOL(AR, ar)
AC_CHECK_TOOL(RANLIB, ranlib, :)
+AC_CHECK_TOOL(DLLTOOL, dlltool)
+AC_CHECK_TOOL(WINDRES, windres)
AC_PROG_YACC
dnl MiG is needed for the Hurd.
@@ -168,6 +170,11 @@ BFD_NEED_DECLARATION(strerror)
BFD_NEED_DECLARATION(strdup)
BFD_NEED_DECLARATION(strstr)
+AC_EGREP_HEADER(strsignal, string.h, , [
+ AC_EGREP_HEADER(strsignal, strings.h, , [
+AC_DEFINE(NEED_DECLARATION_STRSIGNAL)
+])
+])
# The following save_state_t checkery is only necessary for HPUX
# versions earlier than 10.20. When those fade from memory, this
@@ -606,11 +613,6 @@ AC_CACHE_CHECK([for cygwin], gdb_cv_os_c
#if defined (__CYGWIN__) || defined (__CYGWIN32__)
lose
#endif],[gdb_cv_os_cygwin=yes],[gdb_cv_os_cygwin=no])])
-
-DLLTOOL=${DLLTOOL-dlltool}
-WINDRES=${WINDRES-windres}
-AC_SUBST(DLLTOOL)
-AC_SUBST(WINDRES)
dnl Figure out which term library to use.
if test x$gdb_host = xgo32; then
Index: config.in
===================================================================
RCS file: /cvs/src/src/gdb/config.in,v
retrieving revision 1.12
diff -u -p -r1.12 config.in
--- config.in 2000/05/26 04:11:34 1.12
+++ config.in 2000/06/02 02:15:26
@@ -399,3 +399,5 @@
/* Define if <sys/procfs.h> has psaddr_t. */
#undef HAVE_PSADDR_T
+/* Define if have strsignal definition in string.h. */
+#undef NEED_DECLARATION_STRSIGNAL
Index: defs.h
===================================================================
RCS file: /cvs/src/src/gdb/defs.h,v
retrieving revision 1.22
diff -u -p -r1.22 defs.h
--- defs.h 2000/06/02 01:59:13 1.22
+++ defs.h 2000/06/02 02:15:27
@@ -56,9 +56,6 @@
#include "libiberty.h"
-/* libiberty.h can't declare this one, but evidently we can. */
-extern char *strsignal (int);
-
#include "progress.h"
#ifdef USE_MMALLOC
Index: gdb_string.h
===================================================================
RCS file: /cvs/src/src/gdb/gdb_string.h,v
retrieving revision 1.2
diff -u -p -r1.2 gdb_string.h
--- gdb_string.h 2000/05/28 01:12:27 1.2
+++ gdb_string.h 2000/06/02 02:15:27
@@ -68,4 +68,9 @@ extern char *strstr (const char *, const
#endif
#endif
+#ifdef NEED_DECLARATION_STRSIGNAL
+/* libiberty.h can't declare this one, but evidently we can. */
+extern char *strsignal (int);
+#endif
+
#endif /* !defined(GDB_STRING_H) */