iptables.mk 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. ################################################################################
  2. #
  3. # iptables
  4. #
  5. ################################################################################
  6. IPTABLES_VERSION = 1.8.5
  7. IPTABLES_SOURCE = iptables-$(IPTABLES_VERSION).tar.bz2
  8. IPTABLES_SITE = https://netfilter.org/projects/iptables/files
  9. IPTABLES_INSTALL_STAGING = YES
  10. IPTABLES_DEPENDENCIES = host-pkgconf \
  11. $(if $(BR2_PACKAGE_LIBNETFILTER_CONNTRACK),libnetfilter_conntrack)
  12. IPTABLES_LICENSE = GPL-2.0
  13. IPTABLES_LICENSE_FILES = COPYING
  14. # Building static causes ugly warnings on some plugins
  15. IPTABLES_CONF_OPTS = --libexecdir=/usr/lib --with-kernel=$(STAGING_DIR)/usr \
  16. $(if $(BR2_STATIC_LIBS),,--disable-static)
  17. # For connlabel match
  18. ifeq ($(BR2_PACKAGE_LIBNETFILTER_CONNTRACK),y)
  19. IPTABLES_DEPENDENCIES += libnetfilter_conntrack
  20. endif
  21. # For nfnl_osf
  22. ifeq ($(BR2_PACKAGE_LIBNFNETLINK),y)
  23. IPTABLES_DEPENDENCIES += libnfnetlink
  24. endif
  25. # For iptables-compat tools
  26. ifeq ($(BR2_PACKAGE_IPTABLES_NFTABLES),y)
  27. IPTABLES_CONF_OPTS += --enable-nftables
  28. IPTABLES_DEPENDENCIES += host-bison host-flex libmnl libnftnl
  29. else
  30. IPTABLES_CONF_OPTS += --disable-nftables
  31. endif
  32. # bpf compiler support and nfsynproxy tool
  33. ifeq ($(BR2_PACKAGE_IPTABLES_BPF_NFSYNPROXY),y)
  34. # libpcap is tricky for static-only builds and needs help
  35. ifeq ($(BR2_STATIC_LIBS),y)
  36. IPTABLES_LIBS_FOR_STATIC_LINK += `$(STAGING_DIR)/usr/bin/pcap-config --static --additional-libs`
  37. IPTABLES_CONF_OPTS += LIBS="$(IPTABLES_LIBS_FOR_STATIC_LINK)"
  38. endif
  39. IPTABLES_CONF_OPTS += --enable-bpf-compiler --enable-nfsynproxy
  40. IPTABLES_DEPENDENCIES += libpcap
  41. else
  42. IPTABLES_CONF_OPTS += --disable-bpf-compiler --disable-nfsynproxy
  43. endif
  44. define IPTABLES_LINUX_CONFIG_FIXUPS
  45. $(call KCONFIG_ENABLE_OPT,CONFIG_IP_NF_IPTABLES)
  46. $(call KCONFIG_ENABLE_OPT,CONFIG_IP_NF_FILTER)
  47. $(call KCONFIG_ENABLE_OPT,CONFIG_NETFILTER)
  48. $(call KCONFIG_ENABLE_OPT,CONFIG_NETFILTER_XTABLES)
  49. endef
  50. $(eval $(autotools-package))