libctf: check for vasprintf
authorNick Alcock <nick.alcock@oracle.com>
Thu, 4 Jun 2020 16:16:09 +0000 (17:16 +0100)
committerNick Alcock <nick.alcock@oracle.com>
Wed, 22 Jul 2020 17:02:18 +0000 (18:02 +0100)
We've been using this for all of libctf's history in binutils: we should
check for it in configure.

libctf/
configure.ac: Check for vasprintf.
configure: Regenerated.
config.h.in: Likewise.

libctf/ChangeLog
libctf/config.h.in
libctf/configure
libctf/configure.ac

index c0db9585cbf49836c80f353a227bc4654d5dc507..c3e85a2ea44d1cb9be9fb1eeac7598ce87917d1f 100644 (file)
@@ -1,3 +1,9 @@
+2020-07-22  Nick Alcock  <nick.alcock@oracle.com>
+
+       configure.ac: Check for vasprintf.
+       configure: Regenerated.
+       config.h.in: Likewise.
+
 2020-07-22  Nick Alcock  <nick.alcock@oracle.com>
 
        * ctf-archive.c (ctf_arc_bufopen): Fix message.
index e663c694d85133361314fe6b28dde1f09c525e12..897587e587530cdaa646b9d6fdcf9fe1e9bb2eac 100644 (file)
    don't. */
 #undef HAVE_DECL_BSWAP_64
 
+/* 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 <dlfcn.h> header file. */
 #undef HAVE_DLFCN_H
 
index 1dc1b65fac31756c38e29268a0f502e1e87f97c5..58aaa3a529b179623bd3b234f5ace5990cb75ff1 100755 (executable)
 done
 
 
-ac_fn_c_check_decl "$LINENO" "asprintf" "ac_cv_have_decl_asprintf" "$ac_includes_default"
-if test "x$ac_cv_have_decl_asprintf" = xyes; 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" "bswap_16" "ac_cv_have_decl_bswap_16" "#include <byteswap.h>
 "
 if test "x$ac_cv_have_decl_bswap_16" = xyes; then :
@@ -13144,6 +13133,27 @@ cat >>confdefs.h <<_ACEOF
 #define HAVE_DECL_BSWAP_64 $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" = xyes; 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" = xyes; then :
+  ac_have_decl=1
+else
+  ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_VASPRINTF $ac_have_decl
+_ACEOF
+
 
 
 
index f31108c0fade9a9efb2ee895ab5ca342676796fc..26b062e7a54b762689b355203e39b92cd3984ad7 100644 (file)
@@ -100,9 +100,9 @@ AC_C_BIGENDIAN
 AC_CHECK_HEADERS(byteswap.h endian.h)
 AC_CHECK_FUNCS(pread)
 
-AC_CHECK_DECLS([asprintf])
 dnl Check for bswap_{16,32,64}
 AC_CHECK_DECLS([bswap_16, bswap_32, bswap_64], [], [], [[#include <byteswap.h>]])
+AC_CHECK_DECLS([asprintf, vasprintf])
 
 dnl Check for qsort_r.  (Taken from gnulib.)
 AC_CHECK_FUNCS_ONCE([qsort_r])