aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@libertysurf.fr>2006-02-09 11:49:53 +0000
committerEric Botcazou <ebotcazou@libertysurf.fr>2006-02-09 11:49:53 +0000
commitdb50c8404c624dfe903294d439c54a6db7c6d6c8 (patch)
tree874d08b3b39f37476ae09cda3d562e765b4fde8d
parent0f699bbe04b7247382b913e0e63375454d864b73 (diff)
downloadgdb-db50c8404c624dfe903294d439c54a6db7c6d6c8.zip
gdb-db50c8404c624dfe903294d439c54a6db7c6d6c8.tar.gz
gdb-db50c8404c624dfe903294d439c54a6db7c6d6c8.tar.bz2
* configure.in (CHECK_DECLS): Add snprintf and vsnprintf.
* configure: Regenerate. * objdump.c (fprintf): Remove declaration. * bucomm.h (fprintf): Declare if not already declared. (snprintf): Likewise. (vsnprintf): Likewise.
-rw-r--r--binutils/ChangeLog9
-rw-r--r--binutils/bucomm.h12
-rwxr-xr-xbinutils/configure140
-rw-r--r--binutils/configure.in3
-rw-r--r--binutils/objdump.c5
5 files changed, 163 insertions, 6 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index fc78333..982523a 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,12 @@
+2006-02-09 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * configure.in (CHECK_DECLS): Add snprintf and vsnprintf.
+ * configure: Regenerate.
+ * objdump.c (fprintf): Remove declaration.
+ * bucomm.h (fprintf): Declare if not already declared.
+ (snprintf): Likewise.
+ (vsnprintf): Likewise.
+
2006-02-08 H.J. Lu <hongjiu.lu@intel.com>
* readelf.c (process_program_headers): Match PT_TLS segment
diff --git a/binutils/bucomm.h b/binutils/bucomm.h
index 2c662c8..9f914ad 100644
--- a/binutils/bucomm.h
+++ b/binutils/bucomm.h
@@ -90,6 +90,18 @@ extern char *getenv ();
extern char **environ;
#endif
+#if !HAVE_DECL_FPRINTF
+extern int fprintf (FILE *, const char *, ...);
+#endif
+
+#if !HAVE_DECL_SNPRINTF
+extern int snprintf(char *, size_t, const char *, ...);
+#endif
+
+#if !HAVE_DECL_VSNPRINTF
+extern int vsnprintf(char *, size_t, const char *, va_list);
+#endif
+
#ifndef O_RDONLY
#define O_RDONLY 0
#endif
diff --git a/binutils/configure b/binutils/configure
index 686f8c9..6ce8f23 100755
--- a/binutils/configure
+++ b/binutils/configure
@@ -10491,6 +10491,146 @@ _ACEOF
fi
+echo "$as_me:$LINENO: checking whether snprintf is declared" >&5
+echo $ECHO_N "checking whether snprintf is declared... $ECHO_C" >&6
+if test "${ac_cv_have_decl_snprintf+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+#ifndef snprintf
+ char *p = (char *) snprintf;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_have_decl_snprintf=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_have_decl_snprintf=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_have_decl_snprintf" >&5
+echo "${ECHO_T}$ac_cv_have_decl_snprintf" >&6
+if test $ac_cv_have_decl_snprintf = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_SNPRINTF 1
+_ACEOF
+
+
+else
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_SNPRINTF 0
+_ACEOF
+
+
+fi
+echo "$as_me:$LINENO: checking whether vsnprintf is declared" >&5
+echo $ECHO_N "checking whether vsnprintf is declared... $ECHO_C" >&6
+if test "${ac_cv_have_decl_vsnprintf+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+#ifndef vsnprintf
+ char *p = (char *) vsnprintf;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_have_decl_vsnprintf=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_have_decl_vsnprintf=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_have_decl_vsnprintf" >&5
+echo "${ECHO_T}$ac_cv_have_decl_vsnprintf" >&6
+if test $ac_cv_have_decl_vsnprintf = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_VSNPRINTF 1
+_ACEOF
+
+
+else
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_VSNPRINTF 0
+_ACEOF
+
+
+fi
diff --git a/binutils/configure.in b/binutils/configure.in
index ed23e34..1d426af 100644
--- a/binutils/configure.in
+++ b/binutils/configure.in
@@ -172,7 +172,8 @@ if test $bu_cv_header_utime_h = yes; then
AC_DEFINE(HAVE_GOOD_UTIME_H, 1, [Does <utime.h> define struct utimbuf?])
fi
-AC_CHECK_DECLS([fprintf, stpcpy, strstr, sbrk, getenv, environ, getc_unlocked])
+AC_CHECK_DECLS([fprintf, stpcpy, strstr, sbrk, getenv, environ, getc_unlocked,
+ snprintf, vsnprintf])
BFD_BINARY_FOPEN
diff --git a/binutils/objdump.c b/binutils/objdump.c
index fc9600c..838f083 100644
--- a/binutils/objdump.c
+++ b/binutils/objdump.c
@@ -66,11 +66,6 @@
#define BYTES_IN_WORD 32
#include "aout/aout64.h"
-#if !HAVE_DECL_FPRINTF
-/* This is needed by init_disassemble_info(). */
-extern int fprintf (FILE *, const char *, ...);
-#endif
-
/* Exit status. */
static int exit_status = 0;