libreboot

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit d4d2f8cb6142531b180dc4d7e40709c35cfbd60a
parent d0ea6701083f30fe87a401da04b8804fef39f5a3
Author: Timothy Pearson <tpearson@raptorengineeringinc.com>
Date:   Thu, 17 Mar 2016 17:41:01 -0500

helpers/build/crossgcc: Honor NPROC environment variable

Diffstat:
resources/scripts/helpers/build/module/crossgcc | 18+++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)

diff --git 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 )