From 85560933590e6ef401216b3b4fba9df917b25a22 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Mon, 4 Mar 2019 11:33:50 +0000 Subject: [PATCH] make.sh: Pass number of processors and total memory so that we can adjust MAKETUNING Signed-off-by: Michael Tremer --- lfs/boost | 5 +++++ make.sh | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/lfs/boost b/lfs/boost index 3ce49a0a97..e0b550c30e 100644 --- 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 1b5cac46f2..d821fed4ac 100755 --- 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) -- 2.39.2