Skip to content

Commit ed1e7e0

Browse files
committed
snort3: refactor architecture-specific dependencies and CMake options
1. Enabled hyperscan/vectorscan together with adding dependency only for x86_64 and aarch64. 2. Disabled tmalloc (from gperftools package) for powerpc and mips. By doing this refactor, snort3 is going to be available for more OpenWrt devices (as it was in the past) as currently it was compiled only for x86_x64 and aarch64 by mistake. Fixes: 257e2fc ("snort3: fix logic in gpertools-runtime depends") Signed-off-by: Josef Schlehofer <[email protected]> (cherry picked from commit 126364e) [For OpenWrt 24.10: There is hyperscan instead of vectorscan]
1 parent ed702ba commit ed1e7e0

File tree

1 file changed

+24
-16
lines changed

1 file changed

+24
-16
lines changed

net/snort3/Makefile

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
77

88
PKG_NAME:=snort3
99
PKG_VERSION:=3.9.5.0
10-
PKG_RELEASE:=2
10+
PKG_RELEASE:=3
1111

1212
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
1313
PKG_SOURCE_URL:=https://codeload.github.com/snort3/snort3/tar.gz/$(PKG_VERSION)?
@@ -21,23 +21,15 @@ PKG_CPE_ID:=cpe:/a:snort:snort
2121
include $(INCLUDE_DIR)/package.mk
2222
include $(INCLUDE_DIR)/cmake.mk
2323

24-
ifeq ($(filter $(ARCH),mips mips64 mipsel powerpc),)
25-
EXTRA_DEPENDS += +gperftools-runtime
26-
endif
27-
ifeq ($(filter $(ARCH),x86_64),$(ARCH))
28-
EXTRA_DEPENDS += +hyperscan-runtime
29-
CMAKE_OPTIONS += -DHS_INCLUDE_DIRS=$(STAGING_DIR)/usr/include/hs
30-
endif
31-
32-
SNORT3DEPS:=+libstdcpp +libdaq3 +libdnet +libopenssl +libpcap +libpcre2 \
33-
+libpthread +libuuid +zlib +libhwloc +libtirpc @HAS_LUAJIT_ARCH +luajit +libatomic \
34-
+kmod-nft-queue +liblzma +ucode +ucode-mod-fs +ucode-mod-uci $(EXTRA_DEPENDS)
35-
3624
define Package/snort3
3725
SUBMENU:=Firewall
3826
SECTION:=net
3927
CATEGORY:=Network
40-
DEPENDS:=$(SNORT3DEPS)
28+
DEPENDS:=+libstdcpp +libdaq3 +libdnet +libopenssl +libpcap +libpcre2 \
29+
+libpthread +libuuid +zlib +libhwloc +libtirpc @HAS_LUAJIT_ARCH +luajit +libatomic \
30+
+kmod-nft-queue +liblzma +ucode +ucode-mod-fs +ucode-mod-uci \
31+
+PACKAGE_gperftools-runtime:gperftools-runtime \
32+
+PACKAGE_hyperscan-runtime:hyperscan-runtime
4133
TITLE:=Lightweight Network Intrusion Detection System
4234
URL:=http://www.snort.org/
4335
MENU:=1
@@ -64,10 +56,26 @@ CMAKE_OPTIONS += \
6456
-DMAKE_PDF_DOC:BOOL=NO \
6557
-DMAKE_TEXT_DOC:BOOL=NO \
6658
-DHAVE_LIBUNWIND=OFF \
67-
-DENABLE_TCMALLOC=ON \
68-
-DTCMALLOC_LIBRARIES=$(STAGING_DIR)/usr/lib/libtcmalloc.so \
6959
-DHAVE_LZMA=ON
7060

61+
ifneq ($(findstring powerpc,$(CONFIG_ARCH))$(findstring mips,$(CONFIG_ARCH)),)
62+
CMAKE_OPTIONS += \
63+
-DENABLE_TCMALLOC=OFF
64+
else
65+
CMAKE_OPTIONS += \
66+
-DENABLE_TCMALLOC=ON \
67+
-DTCMALLOC_LIBRARIES=$(STAGING_DIR)/usr/lib/libtcmalloc.so
68+
endif
69+
70+
ifneq ($(findstring x86_64,$(CONFIG_ARCH))$(findstring aarch64,$(CONFIG_ARCH)),)
71+
CMAKE_OPTIONS += \
72+
-DENABLE_HYPERSCAN=ON \
73+
-DHS_INCLUDE_DIRS=$(STAGING_DIR)/usr/include/hs
74+
else
75+
CMAKE_OPTIONS += \
76+
-DENABLE_HYPERSCAN=OFF
77+
endif
78+
7179
TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include/daq3 -I$(STAGING_DIR)/usr/include/tirpc
7280
TARGET_LDFLAGS += -L$(STAGING_DIR)/usr/lib/daq3 -ltirpc
7381

0 commit comments

Comments
 (0)