From 28bb01f53ed89b4246489e9e0a0864402084f55f Mon Sep 17 00:00:00 2001 From: Brian Harring Date: Wed, 9 May 2012 15:26:09 -0700 Subject: [PATCH] Make default parallelization controllable. Specifically, do this via env for the time being since each program doesn't necessarily have an option (nor warrant one). BUG=None TEST=None Change-Id: I26e7f06ad5d6a44a7826bfa8465b34154d21b6a3 Reviewed-on: https://gerrit.chromium.org/gerrit/22295 Tested-by: Brian Harring Commit-Ready: Brian Harring Reviewed-by: David James --- common.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/common.sh b/common.sh index f270dc09bb..e3d0d2ecb3 100644 --- a/common.sh +++ b/common.sh @@ -10,7 +10,11 @@ # The number of jobs to pass to tools that can run in parallel (such as make # and dpkg-buildpackage -NUM_JOBS=$(grep -c "^processor" /proc/cpuinfo) +if [ -z "${NUM_JOBS}" ]; then + NUM_JOBS=$(grep -c "^processor" /proc/cpuinfo) +fi +# Ensure that any sub scripts we invoke get the max proc count. +export NUM_JOBS="${NUM_JOBS}" # True if we have the 'pv' utility - also set up COMMON_PV_CAT for convenience COMMON_PV_OK=1