]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
make.sh: Pass number of processors and total memory so that we can adjust MAKETUNING
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 4 Mar 2019 11:33:50 +0000 (11:33 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 4 Mar 2019 11:33:50 +0000 (11:33 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
lfs/boost
make.sh

index 3ce49a0a9786386969f4fb34770d145fffa24450..e0b550c30eeb56aeb8e9d92673a4ca7dac869d44 100644 (file)
--- a/lfs/boost
+++ b/lfs/boost
@@ -35,6 +35,11 @@ TARGET     = $(DIR_INFO)/$(THISAPP)
 CFLAGS    += -O3 -fno-strict-aliasing
 CXXFLAGS  += -O3 -fno-strict-aliasing
 
+# The compiler uses a lot of memory to compile boost, hence we reduce
+# the total number of processes a little bit to be able to build on
+# smaller machines
+override MAKETUNING = -j$(shell echo $$(( $(SYSTEM_MEMORY) / 512)))
+
 CONFIGURE_OPTIONS = \
        --prefix=/usr \
        --layout=tagged \
diff --git a/make.sh b/make.sh
index 1b5cac46f2c9cc6fae81af4c10beff5d7b20a1b9..d821fed4acabfdddab56a3b5f904c732e16235fd 100755 (executable)
--- a/make.sh
+++ b/make.sh
@@ -554,6 +554,8 @@ enterchroot() {
                CCACHE_COMPILERCHECK="${CCACHE_COMPILERCHECK}" \
                KVER="${KVER}" \
                XZ_OPT="${XZ_OPT}" \
+               SYSTEM_PROCESSORS="${SYSTEM_PROCESSORS}" \
+               SYSTEM_MEMORY="${SYSTEM_MEMORY}" \
                $(fake_environ) \
                $(qemu_environ) \
                "$@"
@@ -634,6 +636,8 @@ lfsmake1() {
                CFLAGS="${CFLAGS}" \
                CXXFLAGS="${CXXFLAGS}" \
                MAKETUNING="${MAKETUNING}" \
+               SYSTEM_PROCESSORS="${SYSTEM_PROCESSORS}" \
+               SYSTEM_MEMORY="${SYSTEM_MEMORY}" \
                make -f $* \
                        TOOLCHAIN=1 \
                        TOOLS_DIR="${TOOLS_DIR}" \
@@ -907,6 +911,10 @@ if [ -n "${TARGET_ARCH}" ]; then
        unset TARGET_ARCH
 fi
 
+# Get some information about the host system
+SYSTEM_PROCESSORS="$(system_processors)"
+SYSTEM_MEMORY="$(system_memory)"
+
 # Get the amount of memory in this build system
 HOST_MEM=$(system_memory)