xref: /OK3568_Linux_fs/buildroot/package/nftables/nftables.mk (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1################################################################################
2#
3# nftables
4#
5################################################################################
6
7NFTABLES_VERSION = 1.0.0
8NFTABLES_SOURCE = nftables-$(NFTABLES_VERSION).tar.bz2
9NFTABLES_SITE = https://www.netfilter.org/projects/nftables/files
10NFTABLES_DEPENDENCIES = libmnl libnftnl host-pkgconf $(TARGET_NLS_DEPENDENCIES)
11NFTABLES_LICENSE = GPL-2.0
12NFTABLES_LICENSE_FILES = COPYING
13NFTABLES_CONF_OPTS = --disable-debug --disable-man-doc --disable-pdf-doc
14NFTABLES_SELINUX_MODULES = iptables
15
16ifeq ($(BR2_PACKAGE_GMP),y)
17NFTABLES_DEPENDENCIES += gmp
18NFTABLES_CONF_OPTS += --without-mini-gmp
19else
20NFTABLES_CONF_OPTS += --with-mini-gmp
21endif
22
23ifeq ($(BR2_PACKAGE_READLINE),y)
24NFTABLES_DEPENDENCIES += readline
25NFTABLES_LIBS += -lncurses
26else
27NFTABLES_CONF_OPTS += --without-cli
28endif
29
30ifeq ($(BR2_PACKAGE_JANSSON),y)
31NFTABLES_DEPENDENCIES += jansson
32NFTABLES_CONF_OPTS += --with-json
33else
34NFTABLES_CONF_OPTS += --without-json
35endif
36
37ifeq ($(BR2_PACKAGE_PYTHON)$(BR2_PACKAGE_PYTHON3),y)
38NFTABLES_CONF_OPTS += --enable-python
39NFTABLES_DEPENDENCIES += $(if $(BR2_PACKAGE_PYTHON),python,python3)
40else
41NFTABLES_CONF_OPTS += --disable-python
42endif
43
44ifeq ($(BR2_STATIC_LIBS)$(BR2_PACKAGE_LIBNFTNL_JSON),yy)
45NFTABLES_LIBS += -ljansson -lm
46endif
47
48NFTABLES_CONF_ENV = LIBS="$(NFTABLES_LIBS)"
49
50define NFTABLES_LINUX_CONFIG_FIXUPS
51	$(call KCONFIG_ENABLE_OPT,CONFIG_NETFILTER)
52	$(call KCONFIG_ENABLE_OPT,CONFIG_NF_TABLES)
53	$(call KCONFIG_ENABLE_OPT,CONFIG_NF_TABLES_INET)
54endef
55
56$(eval $(autotools-package))
57