From: Jeff Lucovsky Date: Sat, 21 Aug 2021 12:57:18 +0000 (-0400) Subject: config/netmap: Check for latest API version X-Git-Tag: suricata-7.0.0-beta1~1176 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1c1c21be9ea88aeca15306dafaf7b8343d2cd46e;p=thirdparty%2Fsuricata.git config/netmap: Check for latest API version This commit checks for the latest Netmap API version. --- diff --git a/configure.ac b/configure.ac index 59ccafada6..bf3139c57a 100644 --- a/configure.ac +++ b/configure.ac @@ -1352,61 +1352,29 @@ #include ],[ #ifndef NETMAP_API - #error "outdated netmap, need one with NETMAP_API" + #error "Outdated netmap, need one with NETMAP_API" #endif - #if NETMAP_API < 11 - #error "outdated netmap, need at least api version 11" + #if NETMAP_API < 14 + #error "Outdated netmap, need at least API version 14" #endif ])], [have_recent_netmap="yes"]) if test "x$have_recent_netmap" != "xyes"; then - echo "ERROR: outdated netmap" + echo "ERROR: outdated netmap; need at least v14" exit 1 fi - have_netmap_version="unknown" - have_v11_netmap="no" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ - #include - ],[ - #if NETMAP_API != 11 - #error "not 11" - #endif - ])], [have_v11_netmap="yes"]) - if test "x$have_v11_netmap" = "xyes"; then - have_netmap_version="v11" - fi - have_v12_netmap="no" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ - #include - ],[ - #if NETMAP_API != 12 - #error "not 12" - #endif - ])], [have_v12_netmap="yes"]) - if test "x$have_v12_netmap" = "xyes"; then - have_netmap_version="v12" - fi - have_v13_netmap="no" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ - #include - ],[ - #if NETMAP_API != 13 - #error "not 13" - #endif - ])], [have_v13_netmap="yes"]) - if test "x$have_v13_netmap" = "xyes"; then - have_netmap_version="v13" - fi - have_gtv13_netmap="no" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ - #include - ],[ - #if NETMAP_API <= 13 - #error "not gt 13" - #endif - ])], [have_gtv13_netmap="yes"]) - if test "x$have_gtv13_netmap" = "xyes"; then - have_netmap_version="> v13" + have_netmap_version="v14+" + AC_CHECK_HEADER(libnetmap.h,,[AC_MSG_ERROR(libnetmap.h not found ...)],) + LIBNETMAP="" + AC_SEARCH_LIBS([nmport_open],[netmap],,[LIBNETMAP="no"]) + if test "$LIBNETMAP" = "no"; then + echo + echo " ERROR! libnetmap library not found!" + echo " Go get it from https://github.com/luigirizzo/netmap" + echo " or your distribution." + echo + exit 1 fi + AC_DEFINE([HAVE_NETMAP_V14],[1],(NETMAP API v14 support enabled)) ]) # Suricata-Update.