summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config/global/build-behave.in2
-rw-r--r--scripts/crosstool-NG.sh.in6
2 files changed, 7 insertions, 1 deletions
diff --git a/config/global/build-behave.in b/config/global/build-behave.in
index ebf08b2..7092a7f 100644
--- a/config/global/build-behave.in
+++ b/config/global/build-behave.in
@@ -16,6 +16,8 @@ config PARALLEL_JOBS
Enter 1 (or 0) to have only one job at a time.
+ Enter -1 to set automatically based on how many processors the host has.
+
config LOAD
int
prompt "Maximum allowed load" if ! BACKEND
diff --git a/scripts/crosstool-NG.sh.in b/scripts/crosstool-NG.sh.in
index c2f35f6..6b6aa0e 100644
--- a/scripts/crosstool-NG.sh.in
+++ b/scripts/crosstool-NG.sh.in
@@ -488,7 +488,11 @@ if [ -z "${CT_RESTART}" ]; then
# And help make go faster
JOBSFLAGS=
- [ ${CT_PARALLEL_JOBS} -ne 0 ] && JOBSFLAGS="${JOBSFLAGS} -j${CT_PARALLEL_JOBS}"
+ # Use the number of processors+1 when automatically setting the number of
+ # parallel jobs. Fall back to 1 if the host doesn't use GLIBC.
+ AUTO_JOBS=$((`getconf _NPROCESSORS_ONLN 2> /dev/null || echo 0` + 1))
+ [ ${CT_PARALLEL_JOBS} -eq -1 ] && JOBSFLAGS="${JOBSFLAGS} -j${AUTO_JOBS}"
+ [ ${CT_PARALLEL_JOBS} -gt 0 ] && JOBSFLAGS="${JOBSFLAGS} -j${CT_PARALLEL_JOBS}"
[ ${CT_LOAD} -ne 0 ] && JOBSFLAGS="${JOBSFLAGS} -l${CT_LOAD}"
# We need to save the real .config with kconfig's value,