X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/7f3b481ec937e79225ef78f167070b2249e2f62a..1777497ae7f299b3368a255c2d71d9cb01a7be2c:/include/quilt.mk diff --git a/include/quilt.mk b/include/quilt.mk index c5245a8ae..32a62fb0d 100644 --- a/include/quilt.mk +++ b/include/quilt.mk @@ -55,8 +55,12 @@ define PatchDir $(call PatchDir/$(if $(strip $(QUILT)),Quilt,Default),$(strip $(1)),$(strip $(2)),$(strip $(3))) endef +define HostPatchDir +$(call PatchDir/$(if $(strip $(HOST_QUILT)),Quilt,Default),$(strip $(1)),$(strip $(2)),$(strip $(3))) +endef + ifneq ($(PKG_BUILD_DIR),) - QUILT?=$(strip $(shell test -f $(PKG_BUILD_DIR)/.quilt_used && echo y)) + QUILT?=$(if $(wildcard $(PKG_BUILD_DIR)/.quilt_used),y) ifneq ($(QUILT),) STAMP_PATCHED:=$(PKG_BUILD_DIR)/.quilt_patched STAMP_CHECKED:=$(PKG_BUILD_DIR)/.quilt_checked @@ -67,7 +71,7 @@ ifneq ($(PKG_BUILD_DIR),) endif ifneq ($(HOST_BUILD_DIR),) - HOST_QUILT?=$(strip $(shell test -f $(if $(PKG_BUILD_DIR),$(PKG_BUILD_DIR),$(HOST_BUILD_DIR))/.quilt_used && echo y)) + HOST_QUILT?=$(if $(findstring command,$(origin $(QUILT))),$(QUILT),$(if $(wildcard $(HOST_BUILD_DIR)/.quilt_used),y)) ifneq ($(HOST_QUILT),) HOST_STAMP_PATCHED:=$(HOST_BUILD_DIR)/.quilt_patched HOST_STAMP_CHECKED:=$(HOST_BUILD_DIR)/.quilt_checked @@ -78,9 +82,9 @@ ifneq ($(HOST_BUILD_DIR),) endif define Host/Patch/Default - $(if $(QUILT),rm -rf $(HOST_BUILD_DIR)/patches; mkdir -p $(HOST_BUILD_DIR)/patches) - $(call PatchDir,$(HOST_BUILD_DIR),$(HOST_PATCH_DIR),) - $(if $(QUILT),touch $(HOST_BUILD_DIR)/.quilt_used) + $(if $(HOST_QUILT),rm -rf $(HOST_BUILD_DIR)/patches; mkdir -p $(HOST_BUILD_DIR)/patches) + $(call HostPatchDir,$(HOST_BUILD_DIR),$(HOST_PATCH_DIR),) + $(if $(HOST_QUILT),touch $(HOST_BUILD_DIR)/.quilt_used) endef define Build/Patch/Default