diff options
author | Alexey Neyman <stilor@att.net> | 2015-10-30 13:53:53 -0700 |
---|---|---|
committer | Alexey Neyman <stilor@att.net> | 2015-10-30 13:53:53 -0700 |
commit | f849505ac94a3f616fc3af243f50be42409335ca (patch) | |
tree | 9a1b88ff42898191c69df5d62f6568a8def78228 /scripts | |
parent | 263e8026eca666e09516764f6535da518f36fcb9 (diff) | |
download | crosstool-ng-f849505ac94a3f616fc3af243f50be42409335ca.tar.gz crosstool-ng-f849505ac94a3f616fc3af243f50be42409335ca.tar.bz2 crosstool-ng-f849505ac94a3f616fc3af243f50be42409335ca.zip |
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.in | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/crosstool-NG.sh.in b/scripts/crosstool-NG.sh.in index e29dea5c..a3514cb9 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)) |