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
No known key found for this signature in database
GPG key ID: 1BBA026E13FC0495

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