diff --git a/Config.in b/Config.in index 85d3adf9fd8..c750a253308 100644 --- a/Config.in +++ b/Config.in @@ -247,6 +247,20 @@ menu "Global build settings" help The number of jobs (-jX) to pass to packages submake. + config PKG_DEFAULT_PARALLEL + bool + prompt "Always parallelize the default package build rule (Dangerous)" + depends on PKG_BUILD_PARALLEL + default n + help + Always set the default package build rules to parallel build. + + WARNING: This may break build or kill your cat, as it builds + packages with multiple jobs that are probably not tested in + a parallel build environment. + + Say N. Only say Y for testing. + comment "Stripping options" choice diff --git a/include/host-build.mk b/include/host-build.mk index acb7f6bbdfa..4fd6587aec0 100644 --- a/include/host-build.mk +++ b/include/host-build.mk @@ -8,7 +8,7 @@ HOST_BUILD_DIR ?= $(BUILD_DIR_HOST)/$(PKG_NAME)$(if $(PKG_VERSION),-$(PKG_VERSION)) HOST_INSTALL_DIR ?= $(HOST_BUILD_DIR)/host-install HOST_BUILD_PARALLEL ?= -HOST_JOBS ?= $(if $(HOST_BUILD_PARALLEL),$(if $(CONFIG_PKG_BUILD_PARALLEL),-j$(CONFIG_PKG_BUILD_JOBS))) +HOST_JOBS ?= $(if $(HOST_BUILD_PARALLEL)$(CONFIG_PKG_DEFAULT_PARALLEL),$(if $(CONFIG_PKG_BUILD_PARALLEL),-j$(CONFIG_PKG_BUILD_JOBS))) include $(INCLUDE_DIR)/host.mk include $(INCLUDE_DIR)/unpack.mk diff --git a/include/package.mk b/include/package.mk index fd53123f613..a07d875f8cf 100644 --- a/include/package.mk +++ b/include/package.mk @@ -11,7 +11,7 @@ PKG_BUILD_DIR ?= $(BUILD_DIR)/$(PKG_NAME)$(if $(PKG_VERSION),-$(PKG_VERSION)) PKG_INSTALL_DIR ?= $(PKG_BUILD_DIR)/ipkg-install PKG_MD5SUM ?= unknown PKG_BUILD_PARALLEL ?= -PKG_JOBS ?= $(if $(PKG_BUILD_PARALLEL),$(if $(CONFIG_PKG_BUILD_PARALLEL),-j$(CONFIG_PKG_BUILD_JOBS))) +PKG_JOBS ?= $(if $(PKG_BUILD_PARALLEL)$(CONFIG_PKG_DEFAULT_PARALLEL),$(if $(CONFIG_PKG_BUILD_PARALLEL),-j$(CONFIG_PKG_BUILD_JOBS))) include $(INCLUDE_DIR)/prereq.mk include $(INCLUDE_DIR)/host.mk