From e122f1f5f1f443e5297d87eb971009456ac792cb Mon Sep 17 00:00:00 2001 From: Steve Ellcey Date: Fri, 1 Jul 2005 17:18:06 +0000 Subject: [PATCH] * configure.ac (BFD_NEED_DECLARATION): Replace with AC_CHECK_DECLS. * configure: Regenerate. * config.in: Regenerate. * server.h (NEED_DECLARATION_STRERROR): Replace with !HAVE_DECL_STRERROR. --- gdb/gdbserver/ChangeLog | 8 +++++++ gdb/gdbserver/config.in | 7 +++--- gdb/gdbserver/configure | 48 +++++++++++++++++--------------------- gdb/gdbserver/configure.ac | 2 +- gdb/gdbserver/server.h | 2 +- 5 files changed, 36 insertions(+), 31 deletions(-) diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 4c3e0fef6f..71a799df23 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,11 @@ +2005-07-01 Steve Ellcey + + * configure.ac (BFD_NEED_DECLARATION): Replace with AC_CHECK_DECLS. + * configure: Regenerate. + * config.in: Regenerate. + * server.h (NEED_DECLARATION_STRERROR): + Replace with !HAVE_DECL_STRERROR. + 2005-06-16 Daniel Jacobowitz * linux-low.c (linux_wait, linux_send_signal): Don't test diff --git a/gdb/gdbserver/config.in b/gdb/gdbserver/config.in index 7e3f86f51b..b9ea6a1c86 100644 --- a/gdb/gdbserver/config.in +++ b/gdb/gdbserver/config.in @@ -1,5 +1,9 @@ /* config.in. Generated from configure.ac by autoheader. */ +/* Define to 1 if you have the declaration of `strerror', and to 0 if you + don't. */ +#undef HAVE_DECL_STRERROR + /* Define if has elf_fpregset_t. */ #undef HAVE_ELF_FPREGSET_T @@ -79,9 +83,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H -/* Define if strerror is not declared in system header files. */ -#undef NEED_DECLARATION_STRERROR - /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure index 0a5b6e5052..69d666da88 100755 --- a/gdb/gdbserver/configure +++ b/gdb/gdbserver/configure @@ -3081,9 +3081,9 @@ fi done -echo "$as_me:$LINENO: checking whether strerror must be declared" >&5 -echo $ECHO_N "checking whether strerror must be declared... $ECHO_C" >&6 -if test "${bfd_cv_decl_needed_strerror+set}" = set; then +echo "$as_me:$LINENO: checking whether strerror is declared" >&5 +echo $ECHO_N "checking whether strerror is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_strerror+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -3092,25 +3092,14 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - -#include -#ifdef HAVE_STRING_H -#include -#else -#ifdef HAVE_STRINGS_H -#include -#endif -#endif -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif +$ac_includes_default int main () { -char *(*pfn) = (char *(*)) strerror +#ifndef strerror + char *p = (char *) strerror; +#endif + ; return 0; } @@ -3137,27 +3126,34 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - bfd_cv_decl_needed_strerror=no + ac_cv_have_decl_strerror=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -bfd_cv_decl_needed_strerror=yes +ac_cv_have_decl_strerror=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_strerror" >&5 +echo "${ECHO_T}$ac_cv_have_decl_strerror" >&6 +if test $ac_cv_have_decl_strerror = yes; then -echo "$as_me:$LINENO: result: $bfd_cv_decl_needed_strerror" >&5 -echo "${ECHO_T}$bfd_cv_decl_needed_strerror" >&6 -if test $bfd_cv_decl_needed_strerror = yes; then +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRERROR 1 +_ACEOF -cat >>confdefs.h <<\_ACEOF -#define NEED_DECLARATION_STRERROR 1 + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRERROR 0 _ACEOF + fi + echo "$as_me:$LINENO: checking for socklen_t" >&5 echo $ECHO_N "checking for socklen_t... $ECHO_C" >&6 if test "${ac_cv_type_socklen_t+set}" = set; then diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac index eda888241f..68c5d84fff 100644 --- a/gdb/gdbserver/configure.ac +++ b/gdb/gdbserver/configure.ac @@ -38,7 +38,7 @@ AC_CHECK_HEADERS(sgtty.h termio.h termios.h sys/reg.h string.h dnl proc_service.h sys/procfs.h thread_db.h linux/elf.h dnl stdlib.h unistd.h) -BFD_NEED_DECLARATION(strerror) +AC_CHECK_DECLS(strerror) AC_CHECK_TYPES(socklen_t, [], [], [#include diff --git a/gdb/gdbserver/server.h b/gdb/gdbserver/server.h index 49161fb161..4b146a1cb1 100644 --- a/gdb/gdbserver/server.h +++ b/gdb/gdbserver/server.h @@ -34,7 +34,7 @@ #include #endif -#ifdef NEED_DECLARATION_STRERROR +#if !HAVE_DECL_STRERROR #ifndef strerror extern char *strerror (int); /* X3.159-1989 4.11.6.2 */ #endif -- 2.34.1