iproute2: add ip-full variant to disable IP_CONFIG_TINY
iproute2: add ip-full variant to disable IP_CONFIG_TINY

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 <thomaswouters@gmail.com>

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@39854 3c298f89-4303-0410-b956-a3cf2f4a3e73

--- a/package/network/utils/iproute2/Makefile
+++ b/package/network/utils/iproute2/Makefile
@@ -16,25 +16,29 @@
 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
+  SUBMENU:=Routing and Redirection
+  DEPENDS:= +libnl-tiny
+  VARIANT:=$(1)
 endef
 
-define Package/ip
-$(call Package/iproute2/Default)
-  SUBMENU:=Routing and Redirection
-  DEPENDS:= +libnl-tiny
-  TITLE:=Routing control utility
-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
@@ -52,6 +56,10 @@
 $(call Package/iproute2/Default)
   TITLE:=Socket statistics utility
 endef
+
+ifeq ($(BUILD_VARIANT),tiny)
+  IP_CONFIG_TINY:=y
+endif
 
 define Build/Configure
 	$(SED) "s,-I/usr/include/db3,," $(PKG_BUILD_DIR)/Makefile
@@ -76,7 +84,7 @@
 	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 +105,10 @@
 	$(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 +127,7 @@
 endef
 
 $(eval $(call BuildPackage,ip))
+$(eval $(call BuildPackage,ip-full))
 $(eval $(call BuildPackage,tc))
 $(eval $(call BuildPackage,genl))
 $(eval $(call BuildPackage,ss))

comments