summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAlexey Neyman <stilor@att.net>2015-10-30 20:53:53 (GMT)
committerAlexey Neyman <stilor@att.net>2015-10-30 20:53:53 (GMT)
commitf849505ac94a3f616fc3af243f50be42409335ca (patch)
tree9a1b88ff42898191c69df5d62f6568a8def78228 /scripts
parent263e8026eca666e09516764f6535da518f36fcb9 (diff)
Sanity check for number of parallel jobs.
Signed-off-by: Alexey Neyman <stilor@att.net>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/crosstool-NG.sh.in7
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/crosstool-NG.sh.in b/scripts/crosstool-NG.sh.in
index e29dea5..a3514cb 100644
--- a/scripts/crosstool-NG.sh.in
+++ b/scripts/crosstool-NG.sh.in
@@ -516,7 +516,12 @@ if [ -z "${CT_RESTART}" ]; then
# And help make go faster
JOBSFLAGS=
# Override the configured jobs with what's been given on the command line
- [ -n "${CT_JOBS}" ] && CT_PARALLEL_JOBS="${CT_JOBS}"
+ if [ -n "${CT_JOBS}" ]; then
+ if [ ! -z "`echo "${CT_JOBS}" | sed 's/[0-9]//g'`" ]; then
+ CT_Abort "Number of parallel jobs must be integer."
+ fi
+ CT_PARALLEL_JOBS="${CT_JOBS}"
+ fi
# 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))