diff options
author | Daniel Salzman <daniel.salzman@nic.cz> | 2023-07-08 22:30:44 +0200 |
---|---|---|
committer | Daniel Salzman <daniel.salzman@nic.cz> | 2023-07-09 19:56:23 +0200 |
commit | 6a9e75147c21bef676ff678c3ed0fee8260b7f78 (patch) | |
tree | 9db4428037892251a7ceca95504d2db15222c579 /configure.ac | |
parent | quic: adapt to ngtcp2 v0.17.0 (diff) | |
download | knot-6a9e75147c21bef676ff678c3ed0fee8260b7f78.tar.xz knot-6a9e75147c21bef676ff678c3ed0fee8260b7f78.zip |
configure: add detection of libbpf>=1.0 without libxdp
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac index ec6a3e640..e525c5c25 100644 --- a/configure.ac +++ b/configure.ac @@ -207,10 +207,18 @@ AC_ARG_ENABLE([xdp], AS_HELP_STRING([--enable-xdp=auto|yes|no], [enable eXpress Data Path [default=auto]]), [], [enable_xdp=auto]) +PKG_CHECK_MODULES([libbpf], [libbpf], + [save_LIBS=$LIBS + LIBS="$LIBS $libbpf_LIBS" + AC_CHECK_FUNC([bpf_object__find_map_by_offset], [libbpf1=no], [libbpf1=yes]) + LIBS=$save_LIBS + have_libbpf=yes], + [have_libbpf=no] +) + AS_CASE([$enable_xdp], - [auto], [PKG_CHECK_MODULES([libbpf], [libbpf], [enable_xdp=yes], [enable_xdp=no])], - [yes], [PKG_CHECK_MODULES([libbpf], [libbpf], [enable_xdp=yes], [ - AC_MSG_ERROR([libbpf not available])])], + [auto], [AS_IF([test "$have_libbpf" = "yes"], [enable_xdp=yes], [enable_xdp=no])], + [yes], [AS_IF([test "$have_libbpf" = "yes"], [enable_xdp=yes], [AC_MSG_ERROR([libbpf not available])])], [no], [], [*], [AC_MSG_ERROR([Invalid value of --enable-xdp.])] ) @@ -218,11 +226,12 @@ AM_CONDITIONAL([ENABLE_XDP], [test "$enable_xdp" != "no"]) AS_IF([test "$enable_xdp" = "yes"], [ PKG_CHECK_MODULES([libxdp], [libxdp], [enable_xdp=libxdp], [enable_xdp=yes]) - AS_IF([test "$enable_xdp" = "libxdp"], [ - AC_DEFINE([USE_LIBXDP], [1], [Use libxdp.]) - libbpf_CFLAGS="$libbpf_CFLAGS $libxdp_CFLAGS" - libbpf_LIBS="$libbpf_LIBS $libxdp_LIBS" - ])] + AS_IF([test "$enable_xdp" = "libxdp"], + [AC_DEFINE([USE_LIBXDP], [1], [Use libxdp.]) + libbpf_CFLAGS="$libbpf_CFLAGS $libxdp_CFLAGS" + libbpf_LIBS="$libbpf_LIBS $libxdp_LIBS"], + [AS_IF([test "$libbpf1" = "yes"], [AC_MSG_ERROR([libxdp not available])])] + )] ) AC_SUBST([libbpf_CFLAGS]) AC_SUBST([libbpf_LIBS]) |