oe-buildenv/init.sh

24 lines
420 B
Bash
Raw Normal View History

#!/bin/bash
# Determine parallel build capabilities.
proc="$(nproc >&1)"
parallel_build=$((proc - 1))
if [ ${proc} -gt 20 ]
then
BB_NUMBER_THREADS=20
PARALLEL_MAKE="-j 20"
else
BB_NUMBER_THREADS=${parallel_build}
PARALLEL_MAKE="-j "${parallel_build}
fi
BB_ENV_EXTRAWHITE="BB_NUMBER_THREADS PARALLEL_MAKE BB_NUMBER_PARSE_THREADS"
export BB_NUMBER_THREADS
export PARALLEL_MAKE
export BB_ENV_EXTRAWHITE
exec "$@"