From: Remi Gacogne Date: Tue, 19 Sep 2023 14:45:46 +0000 (+0200) Subject: dnsdist: Better detection of libbpf and libxdp X-Git-Tag: dnsdist-1.9.0-rc1^2~39 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=961e2a7ef00b4f26a2cd4603f2fb7be75298b868;p=thirdparty%2Fpdns.git dnsdist: Better detection of libbpf and libxdp --- diff --git a/pdns/dnsdistdist/m4/pdns_with_xsk.m4 b/pdns/dnsdistdist/m4/pdns_with_xsk.m4 index b45c9f30f1..a5f61dd524 100644 --- a/pdns/dnsdistdist/m4/pdns_with_xsk.m4 +++ b/pdns/dnsdistdist/m4/pdns_with_xsk.m4 @@ -1,7 +1,7 @@ AC_DEFUN([PDNS_WITH_XSK],[ - AC_MSG_CHECKING([if we have xsk support]) + AC_MSG_CHECKING([if we have AF_XDP (XSK) support]) AC_ARG_WITH([xsk], - AS_HELP_STRING([--with-xsk],[enable xsk support @<:@default=auto@:>@]), + AS_HELP_STRING([--with-xsk],[enable AF_XDP (XDK) support @<:@default=auto@:>@]), [with_xsk=$withval], [with_xsk=auto], ) @@ -9,14 +9,18 @@ AC_DEFUN([PDNS_WITH_XSK],[ AS_IF([test "x$with_xsk" != "xno"], [ AS_IF([test "x$with_xsk" = "xyes" -o "x$with_xsk" = "xauto"], [ - AC_CHECK_HEADERS([xdp/xsk.h], xsk_headers=yes, xsk_headers=no) + PKG_CHECK_MODULES([XDP], [libxdp], [ + AC_DEFINE([HAVE_XDP], [1], [Define to 1 if you have the XDP library]) + ], [:]) + PKG_CHECK_MODULES([BPF], [libbpf], [ + AC_DEFINE([HAVE_BPF], [1], [Define to 1 if you have the BPF library]) + ], [:]) ]) ]) + AM_CONDITIONAL([HAVE_XSK], [test x"$BPF_LIBS" != "x" -a x"$XDP_LIBS" != "x"]) AS_IF([test "x$with_xsk" = "xyes"], [ - AS_IF([test x"$xsk_headers" = "no"], [ - AC_MSG_ERROR([XSK support requested but required libxdp were not found]) + AS_IF([test x"$BPF_LIBS" = "x" -o x"$XDP_LIBS" = "x" ], [ + AC_MSG_ERROR([AF_XDP (XSK) support requested but required libbpf and/or libxdp were not found]) ]) ]) - AS_IF([test x"$xsk_headers" = "xyes" ], [ AC_DEFINE([HAVE_XSK], [1], [Define if using eBPF.]) ]) - AM_CONDITIONAL([HAVE_XSK], [test x"$xsk_headers" = "xyes" ]) ])