Skip to content

Commit 8f7704d

Browse files
committed
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.
1 parent de5512e commit 8f7704d

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

configure.ac

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1357,13 +1357,15 @@ if test x$enable_wallet != xno; then
13571357
fi
13581358

13591359
if test x$use_ebpf != xno; then
1360-
AC_CHECK_HEADER([sys/sdt.h], [have_sdt=yes], [have_sdt=no])
1361-
else
1362-
have_sdt=no
1363-
fi
1364-
1365-
if test x$have_sdt = xyes; then
1366-
AC_DEFINE([ENABLE_TRACING], [1], [Define to 1 to enable eBPF user static defined tracepoints])
1360+
AC_MSG_CHECKING([whether eBPF tracepoints are supported])
1361+
AC_COMPILE_IFELSE([
1362+
AC_LANG_PROGRAM(
1363+
[#include <sys/sdt.h>],
1364+
[DTRACE_PROBE("context", "event");]
1365+
)],
1366+
[AC_MSG_RESULT(yes); have_sdt=yes; AC_DEFINE([ENABLE_TRACING], [1], [Define to 1 to enable eBPF user static defined tracepoints])],
1367+
[AC_MSG_RESULT(no); have_sdt=no;]
1368+
)
13671369
fi
13681370

13691371
dnl Check for libminiupnpc (optional)

0 commit comments

Comments
 (0)