build: obtain number of cores in an OpenBSD-compliant way

This commit is contained in:
Lephenixnoir 2021-03-18 14:24:13 +01:00
parent b241b246ea
commit 49de34fe9e
Signed by untrusted user: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
1 changed files with 8 additions and 1 deletions

View File

@ -6,6 +6,13 @@
source util.sh
cd build
# Number of processor cores
if [[ $(uname) == "OpenBSD" ]]; then
cores=$(sysctl -n hw.ncpu)
else
cores=$(nproc)
fi
echo "$TAG Compiling gcc (usually 10-20 minutes)..."
run_quietly giteapc-build.log \
make -j$(nproc) all-gcc all-target-libgcc
make -j"$cores" all-gcc all-target-libgcc