From: Nick Alcock Date: Thu, 4 Jun 2020 16:16:09 +0000 (+0100) Subject: libctf: check for vasprintf X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=43a61d7d3e619385b98c03d43733572b5b1dc015;p=binutils-gdb.git 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. --- diff --git a/libctf/ChangeLog b/libctf/ChangeLog index c0db9585cbf..c3e85a2ea44 100644 --- a/libctf/ChangeLog +++ b/libctf/ChangeLog @@ -1,3 +1,9 @@ +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. diff --git a/libctf/config.h.in b/libctf/config.h.in index e663c694d85..897587e5875 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 1dc1b65fac3..58aaa3a529b 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 f31108c0fad..26b062e7a54 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])