summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--macosx/module.defs4
-rw-r--r--macosx/module.xcodebuild8
-rw-r--r--make/include/tool.defs1
3 files changed, 11 insertions, 2 deletions
diff --git a/macosx/module.defs b/macosx/module.defs
index 20daeef5a..cbf537a4c 100644
--- a/macosx/module.defs
+++ b/macosx/module.defs
@@ -62,7 +62,7 @@ MACOSX.XCODE = $(strip \
EXTERNAL_CONF_ARGS='$(CONF.args)' \
EXTERNAL_DRIVER='$(XCODE.driver)' \
EXTERNAL_GOALS='$(3)' \
- EXTERNAL_JOBS='$(BUILD.jobs)' \
+ EXTERNAL_JOBS='$(MACOSX.JOBS)' \
EXTERNAL_VARS='$(-*-command-variables-*-)' \
\
$(MACOSX.extra_cflags) \
@@ -87,7 +87,7 @@ MACOSX.XCODE_ARCHIVE = $(strip \
EXTERNAL_CONF_ARGS='$(CONF.args)' \
EXTERNAL_DRIVER='$(XCODE.driver)' \
EXTERNAL_GOALS='$(3)' \
- EXTERNAL_JOBS='$(BUILD.jobs)' \
+ EXTERNAL_JOBS='$(MACOSX.JOBS)' \
EXTERNAL_VARS='$(-*-command-variables-*-)' \
\
$(MACOSX.extra_cflags) \
diff --git a/macosx/module.xcodebuild b/macosx/module.xcodebuild
index 960e64562..cb66479d7 100644
--- a/macosx/module.xcodebuild
+++ b/macosx/module.xcodebuild
@@ -52,3 +52,11 @@ $(MACOSX.goals): __goals__
__goals__:
$(call MACOSX.XCODE,external,build,$(MACOSX.goals))
+
+###############################################################################
+
+MACOSX.JOBS := $(shell ps T | $(GREP.exe) "^\s*$(shell echo $$PPID).*$(MAKE)" | $(GREP.exe) -o "\(\-j\|\-\-jobs\)[= ]*[^\s]*" | $(GREP.exe) -o "[0-9][0-9]*")
+ifeq "${MACOSX.JOBS}" ""
+ # fall back to number of jobs specified in makefile created by configure
+ MACOSX.JOBS := $(BUILD.jobs)
+endif
diff --git a/make/include/tool.defs b/make/include/tool.defs
index 6b3995fd0..0e5cfcc05 100644
--- a/make/include/tool.defs
+++ b/make/include/tool.defs
@@ -14,3 +14,4 @@ LN.exe = ln
GIT.exe = git
SED.exe = sed
PKGCONFIG.exe = pkg-config
+GREP.exe = grep