From 43a61d7d3e619385b98c03d43733572b5b1dc015 Mon Sep 17 00:00:00 2001 From: Nick Alcock Date: Thu, 4 Jun 2020 17:16:09 +0100 Subject: libctf: check for vasprintf 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 | 6 ++++++ libctf/config.h.in | 4 ++++ libctf/configure | 32 +++++++++++++++++++++----------- libctf/configure.ac | 2 +- 4 files changed, 32 insertions(+), 12 deletions(-) diff --git a/libctf/ChangeLog b/libctf/ChangeLog index c0db958..c3e85a2 100644 --- a/libctf/ChangeLog +++ b/libctf/ChangeLog @@ -1,5 +1,11 @@ 2020-07-22 Nick Alcock + configure.ac: Check for vasprintf. + configure: Regenerated. + config.h.in: Likewise. + +2020-07-22 Nick Alcock + * ctf-archive.c (ctf_arc_bufopen): Fix message. 2020-07-22 Nick Alcock diff --git a/libctf/config.h.in b/libctf/config.h.in index e663c69..897587e 100644 --- a/libctf/config.h.in +++ b/libctf/config.h.in @@ -29,6 +29,10 @@ 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 header file. */ #undef HAVE_DLFCN_H diff --git a/libctf/configure b/libctf/configure index 1dc1b65..58aaa3a 100755 --- a/libctf/configure +++ b/libctf/configure @@ -13099,17 +13099,6 @@ fi 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 " 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 + diff --git a/libctf/configure.ac b/libctf/configure.ac index f31108c..26b062e 100644 --- a/libctf/configure.ac +++ b/libctf/configure.ac @@ -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 ]]) +AC_CHECK_DECLS([asprintf, vasprintf]) dnl Check for qsort_r. (Taken from gnulib.) AC_CHECK_FUNCS_ONCE([qsort_r]) -- cgit v1.1