mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-12-26 12:55:27 +00:00
Merge pull request #5033 from gilles-peskine-arm/all.sh-makeflags-nproc-2.x
Backport 2.x: Limit make parallelism to the number of CPUs in all.sh
This commit is contained in:
commit
70c1260968
|
@ -165,7 +165,7 @@ pre_initialize_variables () {
|
|||
|
||||
# if MAKEFLAGS is not set add the -j option to speed up invocations of make
|
||||
if [ -z "${MAKEFLAGS+set}" ]; then
|
||||
export MAKEFLAGS="-j"
|
||||
export MAKEFLAGS="-j$(all_sh_nproc)"
|
||||
fi
|
||||
|
||||
# Include more verbose output for failing tests run by CMake or make
|
||||
|
@ -313,6 +313,18 @@ trap 'fatal_signal HUP' HUP
|
|||
trap 'fatal_signal INT' INT
|
||||
trap 'fatal_signal TERM' TERM
|
||||
|
||||
# Number of processors on this machine. Used as the default setting
|
||||
# for parallel make.
|
||||
all_sh_nproc ()
|
||||
{
|
||||
{
|
||||
nproc || # Linux
|
||||
sysctl -n hw.ncpuonline || # NetBSD, OpenBSD
|
||||
sysctl -n hw.ncpu || # FreeBSD
|
||||
echo 1
|
||||
} 2>/dev/null
|
||||
}
|
||||
|
||||
msg()
|
||||
{
|
||||
if [ -n "${current_component:-}" ]; then
|
||||
|
|
Loading…
Reference in a new issue