This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb/gdb-7.10-branch] Check for asprintf and vasprintf during configure stage.


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=a03bd1099151e16a07b3a9b3846a28bdef1ba686

commit a03bd1099151e16a07b3a9b3846a28bdef1ba686
Author: Iain Buclaw <ibuclaw@gdcproject.org>
Date:   Tue Jul 28 09:57:32 2015 +0200

    Check for asprintf and vasprintf during configure stage.
    
    This should fix some build errors seen on AIX, MinGW, and possibly other
    non-GNU systems too due to missing asprintf().
    
    bfd/
    
    	* configure.in: Add asprintf and vasprintf to AC_CHECK_DECLS.
    	* config.in, configure: Regenerate.

Diff:
---
 bfd/ChangeLog    |  5 +++++
 bfd/config.in    |  8 ++++++++
 bfd/configure    | 22 ++++++++++++++++++++++
 bfd/configure.ac |  2 ++
 4 files changed, 37 insertions(+)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 92fc32a..44b54d9 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2015-07-28  Iain Buclaw  <ibuclaw@gdcproject.org>
+
+	* configure.in: Add asprintf and vasprintf to AC_CHECK_DECLS.
+	* config.in, configure: Regenerate.
+
 2015-07-06  Joel Brobecker  <brobecker@adacore.com>
 
 	* development.sh (development): Set to false.
diff --git a/bfd/config.in b/bfd/config.in
index 1ee1081..58248bd 100644
--- a/bfd/config.in
+++ b/bfd/config.in
@@ -17,6 +17,10 @@
 /* Define to 1 if you have the <alloca.h> header file. */
 #undef HAVE_ALLOCA_H
 
+/* Define to 1 if you have the declaration of `asprintf', and to 0 if you
+   don't. */
+#undef HAVE_DECL_ASPRINTF
+
 /* Define to 1 if you have the declaration of `basename', and to 0 if you
    don't. */
 #undef HAVE_DECL_BASENAME
@@ -72,6 +76,10 @@
    */
 #undef HAVE_DECL_STRSTR
 
+/* Define to 1 if you have the declaration of `vasprintf', and to 0 if you
+   don't. */
+#undef HAVE_DECL_VASPRINTF
+
 /* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you
    don't. */
 #undef HAVE_DECL_VSNPRINTF
diff --git a/bfd/configure b/bfd/configure
index eeeb89a..1b6350a 100755
--- a/bfd/configure
+++ b/bfd/configure
@@ -13819,6 +13819,28 @@ cat >>confdefs.h <<_ACEOF
 #define HAVE_DECL_STRSTR $ac_have_decl
 _ACEOF
 
+ac_fn_c_check_decl "$LINENO" "asprintf" "ac_cv_have_decl_asprintf" "$ac_includes_default"
+if test "x$ac_cv_have_decl_asprintf" = x""yes; then :
+  ac_have_decl=1
+else
+  ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_ASPRINTF $ac_have_decl
+_ACEOF
+
+ac_fn_c_check_decl "$LINENO" "vasprintf" "ac_cv_have_decl_vasprintf" "$ac_includes_default"
+if test "x$ac_cv_have_decl_vasprintf" = x""yes; then :
+  ac_have_decl=1
+else
+  ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_VASPRINTF $ac_have_decl
+_ACEOF
+
 ac_fn_c_check_decl "$LINENO" "snprintf" "ac_cv_have_decl_snprintf" "$ac_includes_default"
 if test "x$ac_cv_have_decl_snprintf" = x""yes; then :
   ac_have_decl=1
diff --git a/bfd/configure.ac b/bfd/configure.ac
index 4225f7d..2a38842 100644
--- a/bfd/configure.ac
+++ b/bfd/configure.ac
@@ -232,6 +232,8 @@ AC_CHECK_DECLS(malloc)
 AC_CHECK_DECLS(realloc)
 AC_CHECK_DECLS(stpcpy)
 AC_CHECK_DECLS(strstr)
+AC_CHECK_DECLS(asprintf)
+AC_CHECK_DECLS(vasprintf)
 AC_CHECK_DECLS(snprintf)
 AC_CHECK_DECLS(vsnprintf)
 AC_CHECK_DECLS(strnlen)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]