2017-11-16 08:12:46 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2017-11-16 12:26:17 +00:00
|
|
|
# Determine parallel build capabilities.
|
2019-02-24 08:06:20 +00:00
|
|
|
proc="$(nproc >&1)"
|
|
|
|
parallel_build=$((proc - 1))
|
2017-11-16 12:26:17 +00:00
|
|
|
|
2019-02-24 08:06:20 +00:00
|
|
|
if [ ${proc} -gt 20 ]
|
2017-11-16 12:26:17 +00:00
|
|
|
then
|
|
|
|
BB_NUMBER_THREADS=20
|
2017-12-06 16:06:59 +00:00
|
|
|
PARALLEL_MAKE="-j 20"
|
2017-11-16 12:26:17 +00:00
|
|
|
else
|
|
|
|
BB_NUMBER_THREADS=${parallel_build}
|
2017-12-06 16:06:59 +00:00
|
|
|
PARALLEL_MAKE="-j "${parallel_build}
|
2017-11-16 12:26:17 +00:00
|
|
|
fi
|
|
|
|
|
2017-12-06 16:06:59 +00:00
|
|
|
BB_ENV_EXTRAWHITE="BB_NUMBER_THREADS PARALLEL_MAKE BB_NUMBER_PARSE_THREADS"
|
|
|
|
|
2017-11-16 12:26:17 +00:00
|
|
|
export BB_NUMBER_THREADS
|
|
|
|
export PARALLEL_MAKE
|
2017-12-06 16:06:59 +00:00
|
|
|
export BB_ENV_EXTRAWHITE
|
2017-11-16 08:12:46 +00:00
|
|
|
|
2017-12-06 16:06:59 +00:00
|
|
|
exec "$@"
|
2019-02-24 08:06:20 +00:00
|
|
|
|