aboutsummaryrefslogtreecommitdiff
path: root/libctf/configure
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2020-01-05 09:50:27 +0400
committerJoel Brobecker <brobecker@adacore.com>2020-01-05 09:50:27 +0400
commit3a657c600bde2d3bd84870f75968622bbdb69ce8 (patch)
treed1ecb4e2a6921df85de3f4521a93ecd7701424d1 /libctf/configure
parent7fddfece829ebeb4f8496667260e3f421189b621 (diff)
downloadbinutils-3a657c600bde2d3bd84870f75968622bbdb69ce8.zip
binutils-3a657c600bde2d3bd84870f75968622bbdb69ce8.tar.gz
binutils-3a657c600bde2d3bd84870f75968622bbdb69ce8.tar.bz2
libctf: Add configure check for asprintf (for MinGW)
This commit fixes a compilation warning when compiling libctf on MinGW: libctf/ctf-dump.c:118:8: warning: implicit declaration of function 'asprintf'; did you mean 'vasprintf'? [-Wimplicit-function-declaration] if (asprintf (&bit, " %lx: [slice 0x%x:0x%x]", ^~~~~~~~ vasprintf MinGW doesn't provide that function, so we depend on the one provided by libiberty. However, the declaration is guarded by HAVE_DECL_ASPRINTF, which we do not have in libctf's config.h. libctf/ChangeLog: PR binutils/25155: * configure.ac: Add AC_CHECK_DECLS([asprintf]). * configure, config.h.in: Regenerate.
Diffstat (limited to 'libctf/configure')
-rwxr-xr-xlibctf/configure62
1 files changed, 60 insertions, 2 deletions
diff --git a/libctf/configure b/libctf/configure
index 66b583f..e5493b3 100755
--- a/libctf/configure
+++ b/libctf/configure
@@ -1875,6 +1875,52 @@ $as_echo "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_func
+
+# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
+# ---------------------------------------------
+# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
+# accordingly.
+ac_fn_c_check_decl ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ as_decl_name=`echo $2|sed 's/ *(.*//'`
+ as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
+$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+#ifndef $as_decl_name
+#ifdef __cplusplus
+ (void) $as_decl_use;
+#else
+ (void) $as_decl_name;
+#endif
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_decl
cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
@@ -11385,7 +11431,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11388 "configure"
+#line 11434 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11491,7 +11537,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11494 "configure"
+#line 11540 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -12971,6 +13017,18 @@ 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
+
+