-define HostBuild
- $(if $(strip $(PKG_SOURCE_URL)),$(call Download,default))
- $(if $(DUMP),,$(call HostBuild/Autoclean))
-
- $(STAMP_PREPARED):
- @-rm -rf $(PKG_BUILD_DIR)
- @mkdir -p $(PKG_BUILD_DIR)
- $(call Build/Prepare)
- touch $$@
-
- $(STAMP_CONFIGURED): $(STAMP_PREPARED)
- $(call Build/Configure)
+define Host/Exports/Default
+ $(1) : export ACLOCAL_INCLUDE=$$(foreach p,$$(wildcard $$(STAGING_DIR_HOST)/share/aclocal $$(STAGING_DIR_HOST)/share/aclocal-* $(if $(IS_PACKAGE_BUILD),$$(STAGING_DIR_HOST)/share/aclocal $$(STAGING_DIR_HOST)/share/aclocal-*)),-I $$(p))
+ $(1) : export STAGING_PREFIX=$$(HOST_BUILD_PREFIX)
+ $(1) : export PKG_CONFIG_PATH=$$(STAGING_DIR_HOST)/lib/pkgconfig:$$(HOST_BUILD_PREFIX)/lib/pkgconfig
+ $(1) : export PKG_CONFIG_LIBDIR=$$(HOST_BUILD_PREFIX)/lib/pkgconfig
+ $(1) : export CCACHE_DIR:=$(STAGING_DIR_HOST)/ccache
+ $(if $(IS_PACKAGE_BUILD),$(1) : export PATH=$$(TARGET_PATH_PKG))
+endef
+Host/Exports=$(Host/Exports/Default)
+
+.NOTPARALLEL:
+
+ifndef DUMP
+ define HostBuild
+ $(if $(HOST_QUILT),$(Host/Quilt))
+ $(if $(if $(PKG_HOST_ONLY),,$(STAMP_PREPARED)),,$(if $(strip $(PKG_SOURCE_URL)),$(call Download,default)))
+ $(if $(DUMP),,$(call HostHost/Autoclean))
+
+ $(HOST_STAMP_PREPARED):
+ @-rm -rf $(HOST_BUILD_DIR)
+ @mkdir -p $(HOST_BUILD_DIR)
+ $(foreach hook,$(Hooks/HostPrepare/Pre),$(call $(hook))$(sep))
+ $(call Host/Prepare)
+ $(foreach hook,$(Hooks/HostPrepare/Post),$(call $(hook))$(sep))