[2/2] make.sh: Limit ninja to compute paralellism value

Message ID 20201226170924.12208-2-stefan.schantl@ipfire.org
State Accepted
Commit e1616eb4509bda0f4c892f992c3324980c796ebb
Headers
Series [1/2] ninja: Allow to limit the parallel build processes. |

Commit Message

Stefan Schantl Dec. 26, 2020, 5:09 p.m. UTC
  Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
---
 make.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
  

Patch

diff --git a/make.sh b/make.sh
index 5b1e949c4..8dfc8897d 100755
--- a/make.sh
+++ b/make.sh
@@ -220,6 +220,9 @@  configure_build() {
 	# Use this as default PARALLELISM
 	DEFAULT_PARALLELISM="${parallelism}"
 
+	# Limit lauched ninja build jobs to computed parallel value.
+	NINJAJOBS="${parallelism}"
+
 	# Compression parameters
 	# We use mode 8 for reasonable memory usage when decompressing
 	# but with overall good compression
@@ -465,7 +468,7 @@  prepareenv() {
 	# Setup environment
 	set +h
 	LC_ALL=POSIX
-	export LFS LC_ALL CFLAGS CXXFLAGS DEFAULT_PARALLELISM RUSTFLAGS
+	export LFS LC_ALL CFLAGS CXXFLAGS DEFAULT_PARALLELISM RUSTFLAGS NINJAJOBS
 	unset CC CXX CPP LD_LIBRARY_PATH LD_PRELOAD
 
 	# Make some extra directories