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_DEFINE([HAVE_EBPF], [1], [Define if using eBPF.]) ],
24 [ AS_IF([test "x$with_ebpf" = "xyes"], [
25 AC_MSG_ERROR([EBPF support requested but BPF_FUNC_tail_call not found in the eBPF headers])
28 [#include <linux/bpf.h>]