make.sh: Pass number of processors and total memory so that we can adjust MAKETUNING

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
Michael Tremer
2019-03-04 11:33:50 +00:00
parent 23164efba5
commit 8556093359
2 changed files with 13 additions and 0 deletions

View File

@@ -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 \

View File

@@ -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)