]>
Commit | Line | Data |
---|---|---|
87b515ed RG |
1 | AC_DEFUN([PDNS_WITH_EBPF],[ |
2 | AC_MSG_CHECKING([if we have eBPF support]) | |
3 | AC_ARG_WITH([ebpf], | |
4 | AS_HELP_STRING([--with-ebpf],[enable eBPF support @<:@default=auto@:>@]), | |
5 | [with_ebpf=$withval], | |
6 | [with_ebpf=auto], | |
7 | ) | |
8 | AC_MSG_RESULT([$with_ebpf]) | |
9 | ||
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) | |
13 | ]) | |
14 | ]) | |
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]) | |
18 | ]) | |
19 | ]) | |
20 | AM_CONDITIONAL([HAVE_EBPF], [test x"$bpf_headers" = "xyes" ]) | |
7e8692aa RG |
21 | AS_IF([test x"$bpf_headers" = "xyes" ], |
22 | [AC_CHECK_DECL(BPF_FUNC_tail_call, | |
1aebc828 RG |
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]) | |
27 | ])], | |
28 | [#include <sys/socket.h> | |
29 | ] | |
30 | )], | |
7e8692aa | 31 | [ AS_IF([test "x$with_ebpf" = "xyes"], [ |
1aebc828 RG |
32 | AC_MSG_ERROR([EBPF support requested but BPF_FUNC_tail_call not found in the eBPF headers]) |
33 | ])], | |
34 | [#include <linux/bpf.h> | |
35 | ] | |
7e8692aa RG |
36 | )] |
37 | ) | |
87b515ed | 38 | ]) |