From ca29d05e022a2937dbe0e0b82263e57a2a294ff6 Mon Sep 17 00:00:00 2001 From: Toni Uhlig Date: Mon, 24 Sep 2018 09:40:38 +0200 Subject: set `make -jN` concurrent buildjobs according to logical cpu count Signed-off-by: Toni Uhlig --- build-gcc.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'build-gcc.sh') diff --git a/build-gcc.sh b/build-gcc.sh index e06da91..897568c 100755 --- a/build-gcc.sh +++ b/build-gcc.sh @@ -13,6 +13,7 @@ set -x BIN_DLSITE="https://ftp.gnu.org/gnu/binutils" GCC_DLSITE="https://mirrors-usa.go-parts.com/gcc/releases" +CPUCORES=$(cat /proc/cpuinfo | grep -E '^processor' | wc -l) # download choosen binutils version BIN_CONTENT=$(wget "${BIN_DLSITE}" -q -O - | grep -oE '>binutils-[[:digit:]]+.[[:digit:]]+(|.[[:digit:]]+)(|.[[:digit:]]+).tar.gz<') @@ -126,7 +127,7 @@ cd ${BIN_BUILD} --disable-nls \ --enable-gold=default \ && sed -i 's|^MAKEINFO\s\+=\s\+makeinfo$|MAKEINFO = true|' ./Makefile \ -&& make -j3 \ +&& make -j${CPUCORES:-2} \ && make install cd ../${GCC_BUILD} @@ -149,7 +150,7 @@ cd ../${GCC_BUILD} --enable-lto \ --disable-nls \ && sed -i 's|^MAKEINFO\s\+=\s\+makeinfo$|MAKEINFO = true|' ./Makefile \ -&& make -j3 \ +&& make -j${CPUCORES:-2} \ && make install # write activation script to gcc root -- cgit v1.2.3