make.sh: Introduce DEFAULT_PARALLELISM
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 4 Mar 2019 11:43:47 +0000 (11:43 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 4 Mar 2019 11:43:47 +0000 (11:43 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
lfs/Config
make.sh

index 76f279d..be6725b 100644 (file)
@@ -33,6 +33,8 @@
 # Cleanup environment from any variables
 unexport BUILD_ARCH BUILD_PLATFORM BUILDTARGET CROSSTARGET TOOLCHAIN TOOLS_DIR
 
+MAKETUNING = -j $(DEFAULT_PARALLELISM)
+
 ifeq "$(BUILD_ARCH)" "aarch64"
        IS_64BIT = 1
 endif
diff --git a/make.sh b/make.sh
index f3b125d..92f1ffa 100755 (executable)
--- a/make.sh
+++ b/make.sh
@@ -215,6 +215,9 @@ configure_build() {
                        parallelism=${cpu_max}
                fi
 
+               # Use this as default PARALLELISM
+               DEFAULT_PARALLELISM="${parallelism}"
+
                # limit to -j23 because perl will not build
                # more
                if [ ${parallelism} -gt 23 ]; then
@@ -467,7 +470,7 @@ prepareenv() {
        # Setup environment
        set +h
        LC_ALL=POSIX
-       export LFS LC_ALL CFLAGS CXXFLAGS MAKETUNING
+       export LFS LC_ALL CFLAGS CXXFLAGS DEFAULT_PARALLELISM MAKETUNING
        unset CC CXX CPP LD_LIBRARY_PATH LD_PRELOAD
 
        # Make some extra directories
@@ -552,6 +555,7 @@ enterchroot() {
                CCACHE_COMPILERCHECK="${CCACHE_COMPILERCHECK}" \
                KVER="${KVER}" \
                XZ_OPT="${XZ_OPT}" \
+               DEFAULT_PARALLELISM="${DEFAULT_PARALLELISM}" \
                SYSTEM_PROCESSORS="${SYSTEM_PROCESSORS}" \
                SYSTEM_MEMORY="${SYSTEM_MEMORY}" \
                $(fake_environ) \
@@ -634,6 +638,7 @@ lfsmake1() {
                CFLAGS="${CFLAGS}" \
                CXXFLAGS="${CXXFLAGS}" \
                MAKETUNING="${MAKETUNING}" \
+               DEFAULT_PARALLELISM="${DEFAULT_PARALLELISM}" \
                SYSTEM_PROCESSORS="${SYSTEM_PROCESSORS}" \
                SYSTEM_MEMORY="${SYSTEM_MEMORY}" \
                make -f $* \