From 49de34fe9e9e0064e1ca4cef5688b7a95f98c10e Mon Sep 17 00:00:00 2001 From: Lephenixnoir Date: Thu, 18 Mar 2021 14:24:13 +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 d650d52..ba5eb65 100755 --- a/build.sh +++ b/build.sh @@ -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