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.
pull/826/head
fanquake 3 years ago
parent de5512e28d
commit 8f7704d032
No known key found for this signature in database
GPG Key ID: 2EEB9F5CC09526C1

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

Loading…
Cancel
Save