summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Pearson <tpearson@raptorengineeringinc.com>2016-03-17 18:41:01 (EDT)
committer Francis Rowe <info@gluglug.org.uk>2016-03-20 14:21:24 (EDT)
commitd4d2f8cb6142531b180dc4d7e40709c35cfbd60a (patch)
tree321a8f665b9a01636e5492ec95466eb2d56acdab
parentd0ea6701083f30fe87a401da04b8804fef39f5a3 (diff)
downloadlibreboot-d4d2f8cb6142531b180dc4d7e40709c35cfbd60a.zip
libreboot-d4d2f8cb6142531b180dc4d7e40709c35cfbd60a.tar.gz
libreboot-d4d2f8cb6142531b180dc4d7e40709c35cfbd60a.tar.bz2
helpers/build/crossgcc: Honor NPROC environment variable
-rwxr-xr-xresources/scripts/helpers/build/module/crossgcc18
1 files changed, 15 insertions, 3 deletions
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
)