luarocks: fix site config for host build
authorFelix Fietkau <nbd@nbd.name>
Fri, 31 Jan 2020 17:00:37 +0000 (18:00 +0100)
committerFelix Fietkau <nbd@nbd.name>
Fri, 31 Jan 2020 17:00:38 +0000 (18:00 +0100)
The host utility is used to build other lua modules for the target.
For that, the site config needs to specify the correct arch/system type.
Use target dependent build/staging dirs to avoid issue when switching
between targets

Signed-off-by: Felix Fietkau <nbd@nbd.name>
lang/luarocks/Makefile

index 5ddc4328acb5a52664f86cf32fdd1fdfd6707b58..4c21e5c3696dcd340c08a0620af765b43afaea71 100644 (file)
@@ -26,6 +26,9 @@ PKG_BUILD_DEPENDS:=lua/host
 HOST_BUILD_DEPENDS:=$(PKG_BUILD_DEPENDS)
 HOST_BUILD_PARALLEL:=1
 
+HOST_BUILD_PREFIX:=$(STAGING_DIR)/host
+HOST_BUILD_DIR:=$(BUILD_DIR)/host/$(PKG_NAME)-$(PKG_VERSION)
+
 include $(INCLUDE_DIR)/host-build.mk
 include $(INCLUDE_DIR)/package.mk
 
@@ -49,14 +52,18 @@ CONFIGURE_ARGS = \
     --with-lua=$(STAGING_DIR_HOSTPKG)
 
 HOST_CONFIGURE_ARGS= \
-    --prefix=$(STAGING_DIR_HOSTPKG) \
-    --sysconfdir=$(STAGING_DIR_HOSTPKG)/etc \
+    --prefix=$(STAGING_DIR)/host \
+    --sysconfdir=$(STAGING_DIR)/host/etc \
     --with-lua=$(STAGING_DIR_HOSTPKG)
 
 CONFIGURE_VARS = \
        LUAROCKS_UNAME_S="Linux" \
        LUAROCKS_UNAME_M="$(ARCH)"
 
+HOST_CONFIGURE_VARS = \
+       LUAROCKS_UNAME_S="Linux" \
+       LUAROCKS_UNAME_M="$(ARCH)"
+
 define Build/Compile
        $(call Build/Compile/Default,build)
 endef