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

This commit is contained in:
Lephenixnoir 2021-03-18 09:51:47 +01:00
parent 8957b70549
commit 75f209c4c9
Signed by: 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 core
if [[ $(uname) == "OpenBSD" ]]; then
cores=$(sysctl -n hw.ncpu)
else
cores=$(nproc)
fi
echo "$TAG Compiling binutils (usually 5-10 minutes)..."
run_quietly giteapc-build.log \
make -j$(nproc)
make -j"$cores"