diff options
-rw-r--r-- | Makefile.in | 16 | ||||
-rw-r--r-- | configure.ac | 13 |
2 files changed, 16 insertions, 13 deletions
diff --git a/Makefile.in b/Makefile.in index 64aea5adf56f..27c3e69aa6fd 100644 --- a/Makefile.in +++ b/Makefile.in @@ -55,6 +55,8 @@ include $(BUILDDIR)/config_$(gb_Side).mk export GMAKE_OPTIONS?=-r$(if $(verbose)$(VERBOSE),,s)$(value $(MAKEFLAGS)) +PARALLELISM_OPTION := $(if $(filter-out 0,$(PARALLELISM)),-j $(PARALLELISM),) + # # Partial Build # @@ -62,13 +64,13 @@ define gb_Top_GbuildModuleRules .PHONY: $(1) $(1).all $(1).build $(1).check $(1).clean $(1).showdeliverables $(1).subsequentcheck $(1): bootstrap fetch - cd $(SRCDIR)/$(2) && $(GNUMAKE) -j $(PARALLELISM) $(GMAKE_OPTIONS) + cd $(SRCDIR)/$(2) && $(GNUMAKE) $(PARALLELISM_OPTION) $(GMAKE_OPTIONS) $(1).build $(1).check $(1).clean $(1).showdeliverables $(1).subsequentcheck: - cd $(SRCDIR)/$(2) && $(GNUMAKE) -j $(PARALLELISM) $(GMAKE_OPTIONS) $$(patsubst $(1).%,%,$$@) + cd $(SRCDIR)/$(2) && $(GNUMAKE) $(PARALLELISM_OPTION) $(GMAKE_OPTIONS) $$(patsubst $(1).%,%,$$@) $(1).all: bootstrap fetch - $(GNUMAKE) -j $(PARALLELISM) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild $(WORKDIR)/Module/$(1) $(if $(CROSS_COMPILING),,$(WORKDIR)/Module/check/$(1) $(WORKDIR)/Module/slowcheck/$(1)) + $(GNUMAKE) $(PARALLELISM_OPTION) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild $(WORKDIR)/Module/$(1) $(if $(CROSS_COMPILING),,$(WORKDIR)/Module/check/$(1) $(WORKDIR)/Module/slowcheck/$(1)) endef @@ -121,7 +123,7 @@ gbuild_TARGETS := AllLangHelp \ # build a generic gbuild target $(foreach target,$(gbuild_TARGETS),$(target)_% $(foreach module,$(gbuild_modules),$(target)_$(module)/%)): - $(GNUMAKE) -j $(PARALLELISM) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild $@ + $(GNUMAKE) $(PARALLELISM_OPTION) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild $@ # # Clean @@ -221,15 +223,15 @@ build: bootstrap fetch $(if $(CROSS_COMPILING),cross-toolset) ifneq ($(filter-out WNT MACOSX IOS ANDROID,$(OS)),) mkdir -p $(INSTDIR) && install-gdb-printers -a $(INSTDIR) -c endif - $(GNUMAKE) -j $(PARALLELISM) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild $(build_goal) + $(GNUMAKE) $(PARALLELISM_OPTION) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild $(build_goal) ifeq ($(OS),IOS) - $(GNUMAKE) -j $(PARALLELISM) $(GMAKE_OPTIONS) ios + $(GNUMAKE) $(PARALLELISM_OPTION) $(GMAKE_OPTIONS) ios endif build-non-l10n-only build-l10n-only build-nocheck check debugrun help slowcheck translations unitcheck subsequentcheck packageinfo: build cross-toolset: bootstrap fetch - $(GNUMAKE) gb_Side=build -j $(PARALLELISM) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild build-tools + $(GNUMAKE) gb_Side=build $(PARALLELISM_OPTION) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild build-tools # diff --git a/configure.ac b/configure.ac index 89a816687984..016bb166b553 100644 --- a/configure.ac +++ b/configure.ac @@ -12373,7 +12373,7 @@ AC_MSG_CHECKING([for number of processors to use]) # plain --with-parallelism is just the default if test -n "$with_parallelism" -a "$with_parallelism" != "yes"; then if test "$with_parallelism" = "no"; then - PARALLELISM=1 + PARALLELISM=0 else PARALLELISM=$with_parallelism fi @@ -12397,10 +12397,7 @@ else esac # If we hit the catch-all case, but /proc/cpuinfo doesn't exist or has an - # unexpected format, 'wc -l' will have returned 0. - if test "$PARALLELISM" -eq 0; then - PARALLELISM=1 - fi + # unexpected format, 'wc -l' will have returned 0 (and we won't use -j at all). fi fi @@ -12414,7 +12411,11 @@ if test "$no_parallelism_make" = "YES" && test $PARALLELISM -gt 1; then fi fi -AC_MSG_RESULT([$PARALLELISM]) +if test $PARALLELISM -eq 0; then + AC_MSG_RESULT([explicit make -j option needed]) +else + AC_MSG_RESULT([$PARALLELISM]) +fi AC_SUBST(PARALLELISM) # |