From d4d2f8cb6142531b180dc4d7e40709c35cfbd60a Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Thu, 17 Mar 2016 18:41:01 -0400 Subject: helpers/build/crossgcc: Honor NPROC environment variable --- (limited to 'resources/scripts/helpers/build/module') diff --git a/resources/scripts/helpers/build/module/crossgcc b/resources/scripts/helpers/build/module/crossgcc index 801cd5e..7a23e39 100755 --- a/resources/scripts/helpers/build/module/crossgcc +++ b/resources/scripts/helpers/build/module/crossgcc @@ -24,14 +24,26 @@ [ "x${DEBUG+set}" = 'xset' ] && set -v set -u -e +if [ -z ${NPROC+x} ]; then + cores="$(nproc)" +else + case ${NPROC} in + ''|*[!0-9]*) + printf "value '%s' for NPROC is invalid. non-numeric. Exiting.\n" "${NPROC}" + exit 1 + ;; + esac + cores="${NPROC}" +fi + ( cd "crossgcc/" if [ $# -lt 1 ]; then - make crossgcc-i386 - make crossgcc-arm + make crossgcc-i386 CPUS=${cores} + make crossgcc-arm CPUS=${cores} else for architecture in "${@}"; do - make crossgcc-${architecture} + make crossgcc-${architecture} CPUS=${cores} done fi ) -- cgit v0.9.1