nftables: allow to build with json support
authorRosy Song <rosysong@rosinson.com>
Tue, 31 Jul 2018 09:09:34 +0000 (17:09 +0800)
committerJohn Crispin <john@phrozen.org>
Wed, 1 Aug 2018 09:25:04 +0000 (11:25 +0200)
Signed-off-by: Rosy Song <rosysong@rosinson.com>
package/network/utils/nftables/Makefile

index f3bdc5caeea27540c245c921666fe7709ae219d0..d1e995116dff883f9356a7e249123a79e6a951a3 100644 (file)
@@ -34,10 +34,21 @@ define Package/nftables
   CATEGORY:=Network
   SUBMENU:=Firewall
   TITLE:=nftables packet filtering userspace utility
   CATEGORY:=Network
   SUBMENU:=Firewall
   TITLE:=nftables packet filtering userspace utility
-  DEPENDS:=+kmod-nft-core +libnftnl
+  DEPENDS:=+kmod-nft-core +libnftnl +PACKAGE_NFT_WITH_JSON:jansson
   URL:=http://netfilter.org/projects/nftables/
 endef
 
   URL:=http://netfilter.org/projects/nftables/
 endef
 
+define Package/nftables/config
+       config PACKAGE_NFT_WITH_JSON
+               bool "Build nftables with json support"
+               depends on PACKAGE_nftables
+               default n
+endef
+
+ifeq ($(CONFIG_PACKAGE_NFT_WITH_JSON),y)
+CONFIGURE_ARGS += --with-json
+endif
+
 define Package/nftables/install
        $(INSTALL_DIR) $(1)/usr/sbin
        $(CP) $(PKG_INSTALL_DIR)/usr/sbin/nft $(1)/usr/sbin/
 define Package/nftables/install
        $(INSTALL_DIR) $(1)/usr/sbin
        $(CP) $(PKG_INSTALL_DIR)/usr/sbin/nft $(1)/usr/sbin/