iproute2: merge upstream CAKE support

Add upstream support for CAKE into iproute2 and conditionally enable it
depending on the build environment we're running under.

When running with SDK=1 and CONFIG_BUILDBOT=y we assume that we're
invoked by the release package builder at
http://release-builds.lede-project.org/17.01/packages/ and produce shared
iproute2 executables with legacy CAKE support for older released kernels.

When not running under the release package builder environment, produce
nonshared packages using the new, upstream CAKE support suitable for
the latest kernel.

Depending on the environment, suffix the PKG_RELEASE field with either
"-cake-legacy" or "-cake-upstream" to ensure that the nonshared packages
are preferred by opkg for newer builds.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
Jo-Philipp Wich 2018-07-21 11:22:09 +01:00
parent 28d4e55432
commit 2725ad8de4
3 changed files with 1511 additions and 0 deletions

View File

@ -19,6 +19,10 @@ PKG_LICENSE:=GPL-2.0
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
USE_CAKE:=$(if $(filter 1y,$(SDK)$(CONFIG_BUILDBOT)),cake-legacy,cake-upstream)
PKG_FLAGS:=$(if $(filter cake-upstream,$(USE_CAKE)),nonshared)
PKG_RELEASE:=$(PKG_RELEASE)-$(USE_CAKE)
include $(INCLUDE_DIR)/package.mk
define Package/iproute2/Default
@ -70,6 +74,14 @@ ifeq ($(BUILD_VARIANT),tiny)
IP_CONFIG_TINY:=y
endif
PATCH_DIR:=$(PKG_BUILD_DIR)/openwrt-patches
define Build/Patch
$(INSTALL_DIR) $(PATCH_DIR)
$(CP) ./patches/* ./patches-$(USE_CAKE)/* $(PATCH_DIR)/
$(call Build/Patch/Default)
endef
define Build/Configure
$(SED) "s,-I/usr/include/db3,," $(PKG_BUILD_DIR)/Makefile
$(SED) "s,^KERNEL_INCLUDE.*,KERNEL_INCLUDE=$(LINUX_DIR)/include," \