summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2017-03-31 19:23:29 +0200
committerUlf Hermann <ulf.hermann@qt.io>2017-05-04 12:24:08 +0000
commitf95af4ca39f5ff2073a2b0bc6e1bd0d3832b1a8f (patch)
treed1db164ddcdb1ba538c59397b86a95b10458f61c /configure.ac
parent0d2c0bfbe284d715abc0885796436f1bf8e790db (diff)
Add our own tdestroy if search.h exposes a node_t struct
tdestroy is not necessarily available from search.h, but we need it. gnulib cannot help us here as it will detect search.h to be available and functional in that case. However, some search.h expose a node_t struct which can be used to implement tdestroy. If that is the case, add an implementation to libgnu.a. Change-Id: I983f3aeb6b9090d2b24cbc01fe0790d2d0c96824 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac21
1 files changed, 21 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index bfdc53fb..88b9d0a9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -610,6 +610,27 @@ AC_CHECK_DECLS([feof_unlocked, ferror_unlocked, fputc_unlocked, fputs_unlocked,
fwrite_unlocked, putc_unlocked, putchar_unlocked],
[], [], [[#include <stdio.h>]])
+AC_CHECK_DECLS([tdestroy], [], [],
+ [#include <search.h>])
+if test "x$ac_cv_have_decl_tdestroy" != "xyes"; then
+ AC_CHECK_MEMBERS([node_t.key, node_t.rlink, node_t.llink],
+ [have_node_t="yes"], [have_node_t="no"],
+ [#define _SEARCH_PRIVATE
+ #include <search.h>])
+ if test "x$have_node_t" = "xyes"; then
+ AC_DEFINE([USE_PRIVATE_TDESTROY], [1], [Implement tdestroy using private node_t from search.h])
+ fi
+fi
+AM_CONDITIONAL(USE_PRIVATE_TDESTROY, [test "x$have_node_t" = "xyes"])
+
+AH_VERBATIM([USE_PRIVATE_TDESTROY], [
+/* Declare tdestroy here if it is not available from a system header. */
+#undef USE_PRIVATE_TDESTROY
+#ifdef USE_PRIVATE_TDESTROY
+void tdestroy(void *root, void (*free_node)(void *nodep));
+#endif
+])
+
dnl Check if we have <linux/bpf.h> for EM_BPF disassembly.
AC_CHECK_HEADERS(linux/bpf.h)
AM_CONDITIONAL(HAVE_LINUX_BPF_H, [test "x$ac_cv_header_linux_bpf_h" = "xyes"])