xtables-addons: adapt build to EXTERNAL_TOOLCHAIN
authorEneas U de Queiroz <cote2004-github@yahoo.com>
Sun, 26 May 2019 20:55:21 +0000 (17:55 -0300)
committerEneas Queiroz <cote2004-github@yahoo.com>
Wed, 29 May 2019 12:04:23 +0000 (09:04 -0300)
Commit 32aaaaa led to failures when openwrt ARCH did not match kernel
ARCH, and this may not be its only side-effect.

This restores the previous Build/Compile and Build/Install, using the
default ones only when using external toolchain; in this case, ARCH is
set to LINUX_KARCH.

Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
net/xtables-addons/Makefile

index 948f2b826b6b3ee15b680df4d5c5c9b99f1bf7eb..d81605388ac7deb0b2735466b639fd9c92989c1b 100644 (file)
@@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=xtables-addons
 PKG_VERSION:=2.14
-PKG_RELEASE:=7
+PKG_RELEASE:=8
 PKG_HASH:=d215a9a8b8e66aae04b982fa2e1228e8a71e7dfe42320df99e34e5000cbdf152
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
@@ -41,11 +41,31 @@ CONFIGURE_ARGS+= \
        --with-kbuild="$(LINUX_DIR)" \
        --with-xtlibdir="/usr/lib/iptables"
 
-MAKE_FLAGS += \
+ifdef CONFIG_EXTERNAL_TOOLCHAIN
+MAKE_FLAGS:= \
+       $(patsubst ARCH=%,ARCH=$(LINUX_KARCH),$(MAKE_FLAGS)) \
        DEPMOD="/bin/true"
 
-MAKE_INSTALL_FLAGS += \
+MAKE_INSTALL_FLAGS:= \
+       $(patsubst ARCH=%,ARCH=$(LINUX_KARCH),$(MAKE_FLAGS)) \
        DEPMOD="/bin/true"
+else
+define Build/Compile
+       +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
+               $(KERNEL_MAKE_FLAGS) \
+               DESTDIR="$(PKG_INSTALL_DIR)" \
+               DEPMOD="/bin/true" \
+               all
+endef
+
+define Build/Install
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               $(KERNEL_MAKE_FLAGS) \
+               DESTDIR="$(PKG_INSTALL_DIR)" \
+               DEPMOD="/bin/true" \
+               install
+endef
+endif
 
 # 1: extension/module suffix used in package name
 # 2: extension/module display name used in package title/description