From 75f209c4c94f59296fca5275bb56ea4e2488b626 Mon Sep 17 00:00:00 2001 From: Lephenixnoir Date: Thu, 18 Mar 2021 09:51:47 +0100 Subject: [PATCH] build: obtain number of cores in an OpenBSD-compliant way --- build.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index acc2395..2d5393c 100755 --- a/build.sh +++ b/build.sh @@ -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"