1 AC_DEFUN([PDNS_WITH_EBPF],[
2 AC_MSG_CHECKING([if we have eBPF support])
4 AS_HELP_STRING([--with-ebpf],[enable eBPF support @<:@default=auto@:>@]),
8 AC_MSG_RESULT([$with_ebpf])
10 AS_IF([test "x$with_ebpf" != "xno"], [
11 AS_IF([test "x$with_ebpf" = "xyes" -o "x$with_ebpf" = "xauto"], [
12 AC_CHECK_HEADERS([linux/bpf.h], bpf_headers=yes, bpf_headers=no)
15 AS_IF([test "x$with_ebpf" = "xyes"], [
16 AS_IF([test x"$bpf_headers" = "no"], [
17 AC_MSG_ERROR([EBPF support requested but required eBPF headers were not found])
20 AM_CONDITIONAL([HAVE_EBPF], [test x"$bpf_headers" = "xyes" ])
21 AS_IF([test x"$bpf_headers" = "xyes" ],
22 [AC_CHECK_DECL(BPF_FUNC_tail_call,
23 [ AC_CHECK_DECL(SO_ATTACH_BPF,
24 [ AC_DEFINE([HAVE_EBPF], [1], [Define if using eBPF.]) ],
25 [ AS_IF([test "x$with_ebpf" = "xyes"], [
26 AC_MSG_ERROR([EBPF support requested but SO_ATTACH_BPF not found])
28 [#include <sys/socket.h>
31 [ AS_IF([test "x$with_ebpf" = "xyes"], [
32 AC_MSG_ERROR([EBPF support requested but BPF_FUNC_tail_call not found in the eBPF headers])
34 [#include <linux/bpf.h>