From: Lukas Sismis Date: Sun, 29 Aug 2021 21:43:14 +0000 (+0200) Subject: dpdk: edit configure.ac to include DPDK compilation option X-Git-Tag: suricata-7.0.0-beta1~1110 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fcfee6994e211b29de7bbc6e461f5548afb85ef4;p=thirdparty%2Fsuricata.git dpdk: edit configure.ac to include DPDK compilation option Add a build flag --enable-dpdk to support DPDK parts in the source code. --- diff --git a/configure.ac b/configure.ac index e6e036d8b7..037adda170 100644 --- a/configure.ac +++ b/configure.ac @@ -1331,6 +1331,46 @@ [[#include ]]) ]) + # DPDK support + AC_ARG_ENABLE(dpdk, + AS_HELP_STRING([--enable-dpdk], [Enable DPDK support [default=no]]), + [enable_dpdk=$enableval],[enable_dpdk=no]) + AS_IF([test "x$enable_dpdk" = "xyes"], [ + AC_CHECK_LIB(numa, numa_available,, [numa_found="no"]) + if test "$numa_found" = "no"; then + echo + echo " ERROR! libnuma not found by pkg-config, go get it" + echo " from http://github.com/numactl/numactl or your distribution:" + echo " Ubuntu: apt-get install libnuma-dev" + echo " Fedora: dnf install numactl-devel" + echo " CentOS/RHEL: yum install numactl-devel" + echo + exit 1 + fi + + AC_DEFINE([HAVE_DPDK],[1],(DPDK support enabled)) + PKG_CHECK_EXISTS(libdpdk >= 20.11, [pkgconfig_libdpdk_above20=yes], ) + if test "$pkgconfig_libdpdk_above20" = "yes"; then + AC_DEFINE([HAVE_STRLCAT],[1],[STRLCAT is predefined by DPDK 20.11+]) + AC_DEFINE([HAVE_STRLCPY],[1],[STRLCPY is predefined by DPDK 20.11+]) + fi + + PKG_CHECK_EXISTS(libdpdk >= 19.11, , [with_pkgconfig_libdpdk=no]) + if test "$with_pkgconfig_libdpdk" = "no"; then + echo + echo " ERROR! libdpdk >= 19.11 not found by pkg-config, go get it" + echo " from https://www.dpdk.org/ or your distribution:" + echo + echo " Ubuntu: apt-get install dpdk-dev" + echo " Fedora: dnf install dpdk-devel" + echo " CentOS/RHEL: yum install dpdk-devel" + echo + exit 1 + fi + CFLAGS="${CFLAGS} `pkg-config --cflags libdpdk`" + LIBS="${LIBS} -Wl,-R,`pkg-config --libs-only-L libdpdk | cut -c 3-` -lnuma `pkg-config --libs libdpdk`" + ]) + # Netmap support AC_ARG_ENABLE(netmap, AS_HELP_STRING([--enable-netmap], [Enable Netmap support]),[enable_netmap=$enableval],[enable_netmap=no]) @@ -2518,6 +2558,7 @@ AC_OUTPUT SURICATA_BUILD_CONF="Suricata Configuration: AF_PACKET support: ${enable_af_packet} + DPDK support: ${enable_dpdk} eBPF support: ${enable_ebpf} XDP support: ${have_xdp} PF_RING support: ${enable_pfring}