This change creates a new ip-full variant for the ip package.
It disables IP_CONFIG_TINY to make some iproute2 features available like xfrm, 
gretap, ...

Signed-off-by: Thomas Wouters <thomaswout...@gmail.com>

---
 package/network/utils/iproute2/Makefile | 32 +++++++++++++++++++++++++-------
 1 file changed, 25 insertions(+), 7 deletions(-)

diff --git a/package/network/utils/iproute2/Makefile 
b/package/network/utils/iproute2/Makefile
index a44572d..2bc1781 100644
--- a/package/network/utils/iproute2/Makefile
+++ b/package/network/utils/iproute2/Makefile
@@ -16,27 +16,31 @@ 
PKG_SOURCE_URL:=http://kernel.org/pub/linux/utils/net/iproute2/
 PKG_MD5SUM:=d7ffb27bc9f0d80577b1f3fb9d1a7689
 PKG_BUILD_PARALLEL:=1
 
-PKG_BUILD_DIR:=$(BUILD_DIR)/iproute2-$(PKG_VERSION)
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
 
 include $(INCLUDE_DIR)/package.mk
 
 define Package/iproute2/Default
+  TITLE:=Routing control utility ($(2))
   SECTION:=net
   CATEGORY:=Network
   URL:=http://linux-net.osdl.org/index.php/Iproute2
-endef
-
-define Package/ip
-$(call Package/iproute2/Default)
   SUBMENU:=Routing and Redirection
   DEPENDS:= +libnl-tiny
-  TITLE:=Routing control utility
+  VARIANT:=$(1)
 endef
 
+Package/ip=$(call Package/iproute2/Default,tiny,Minimal)
+Package/ip-full=$(call Package/iproute2/Default,full,Full)
+
 define Package/ip/conffiles
 /etc/iproute2/rt_tables
 endef
 
+define Package/ip-$(BUILD_VARIANT)/conffiles
+$(Package/ip/conffiles)
+endef
+
 define Package/tc
 $(call Package/iproute2/Default)
   TITLE:=Traffic control utility
@@ -53,6 +57,15 @@ $(call Package/iproute2/Default)
   TITLE:=Socket statistics utility
 endef
 
+ifdef BUILD_VARIANT
+  ifeq ($(BUILD_VARIANT),tiny)
+    IP_CONFIG_TINY:=y
+  endif
+  ifeq ($(BUILD_VARIANT),full)
+    IP_CONFIG_TINY:=n
+  endif
+endif
+
 define Build/Configure
        $(SED) "s,-I/usr/include/db3,," $(PKG_BUILD_DIR)/Makefile
        $(SED) "s,^KERNEL_INCLUDE.*,KERNEL_INCLUDE=$(LINUX_DIR)/include," \
@@ -76,7 +89,7 @@ MAKE_FLAGS += \
        KERNEL_INCLUDE="$(LINUX_DIR)/include" \
        SHARED_LIBS="" \
        LDFLAGS="-Wl,--gc-sections" \
-       IP_CONFIG_TINY=y \
+       IP_CONFIG_TINY=$(IP_CONFIG_TINY) \
        FPIC=""
 
 define Build/Compile
@@ -97,6 +110,10 @@ define Package/ip/install
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/ip/ip $(1)/usr/sbin/
 endef
 
+define Package/ip-$(BUILD_VARIANT)/install
+       $(Package/ip/install)
+endef
+
 define Package/tc/install
        $(INSTALL_DIR) $(1)/usr/sbin
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/tc/tc $(1)/usr/sbin/
@@ -115,6 +132,7 @@ define Package/ss/install
 endef
 
 $(eval $(call BuildPackage,ip))
+$(eval $(call BuildPackage,ip-full))
 $(eval $(call BuildPackage,tc))
 $(eval $(call BuildPackage,genl))
 $(eval $(call BuildPackage,ss))
-- 
1.9.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to