1
1
mirror of https://github.com/bitcoin/bitcoin.git synced 2024-05-17 23:56:39 +00:00

build: improve detection of eBPF support

Just checking for the `sys/sdt.h` header isn't enough, as systems like
macOS have the header, but it doesn't actually have the dtrace probes,
which leads to compile failures.
This commit is contained in:
fanquake 2021-06-14 13:35:05 +08:00
parent de5512e28d
commit 8f7704d032
No known key found for this signature in database
GPG Key ID: 2EEB9F5CC09526C1

View File

@ -1357,13 +1357,15 @@ if test x$enable_wallet != xno; then
fi
if test x$use_ebpf != xno; then
AC_CHECK_HEADER([sys/sdt.h], [have_sdt=yes], [have_sdt=no])
else
have_sdt=no
fi
if test x$have_sdt = xyes; then
AC_DEFINE([ENABLE_TRACING], [1], [Define to 1 to enable eBPF user static defined tracepoints])
AC_MSG_CHECKING([whether eBPF tracepoints are supported])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM(
[#include <sys/sdt.h>],
[DTRACE_PROBE("context", "event");]
)],
[AC_MSG_RESULT(yes); have_sdt=yes; AC_DEFINE([ENABLE_TRACING], [1], [Define to 1 to enable eBPF user static defined tracepoints])],
[AC_MSG_RESULT(no); have_sdt=no;]
)
fi
dnl Check for libminiupnpc (optional)