Skip to content

Commit f9515d5

Browse files
rburchellawesomekling
authored andcommitted
BuildIt: Allow specifying MAKEJOBS rather than forcing to nprocs
1 parent bfd94db commit f9515d5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Toolchain/BuildIt.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ mkdir -p $PREFIX
6363
mkdir -p "$DIR/Build/binutils"
6464
mkdir -p "$DIR/Build/gcc"
6565

66+
if [ -z "$MAKEJOBS" ]; then
67+
MAKEJOBS=$(nproc)
68+
fi
69+
6670
pushd "$DIR/Build/"
6771
unset PKG_CONFIG_LIBDIR # Just in case
6872

@@ -71,7 +75,7 @@ pushd "$DIR/Build/"
7175
--target=$TARGET \
7276
--with-sysroot=$SYSROOT \
7377
--disable-nls || exit 1
74-
make -j $(nproc) || exit 1
78+
make -j $MAKEJOBS || exit 1
7579
make install || exit 1
7680
popd
7781

@@ -84,7 +88,7 @@ pushd "$DIR/Build/"
8488
--enable-languages=c,c++ || exit 1
8589

8690
echo "XXX build gcc and libgcc"
87-
make -j $(nproc) all-gcc all-target-libgcc || exit 1
91+
make -j $MAKEJOBS all-gcc all-target-libgcc || exit 1
8892
echo "XXX install gcc and libgcc"
8993
make install-gcc install-target-libgcc || exit 1
9094

0 commit comments

Comments
 (0)