about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2020-04-02 23:59:55 +0200
committerMichael Vetter <jubalh@iodoru.org>2020-04-02 23:59:55 +0200
commitc57bd566557558fc94c306b0a8f7e3c5ad5b4d9c (patch)
tree3221467161d77cd85218163c5f964865d3787a54
parentdf23c3461171053ac359bfebfd68656c6ad1b29b (diff)
parent15e05d1706cc3cdc3d637e25ed83f6acbd26b59e (diff)
downloadprofani-tty-c57bd566557558fc94c306b0a8f7e3c5ad5b4d9c.tar.gz
Merge branch 'master' of github.com:profanity-im/profanity
-rwxr-xr-xci-build.sh13
1 files changed, 12 insertions, 1 deletions
diff --git a/ci-build.sh b/ci-build.sh
index 438388b0..0a42e099 100755
--- a/ci-build.sh
+++ b/ci-build.sh
@@ -11,10 +11,21 @@ error_handler()
 
 trap error_handler ERR
 
+num_cores()
+{
+    # Check for cores, for systems with:
+    #   Line 1. Linux w/ coreutils, or...
+    #   Line 2. OpenBSD, FreeBSD, NetBSD or macOS, or...
+    #   Line 3. Fallback for Linux w/o coreutils (glibc).
+    nproc \
+        || sysctl -n hw.ncpu \
+        || getconf _NPROCESSORS_ONLN 2>/dev/null
+}
+
 ./bootstrap.sh
 
 tests=()
-MAKE="make --quiet -j$(nproc)"
+MAKE="make --quiet -j$(num_cores)"
 CC="gcc"
 
 case $(uname | tr '[:upper:]' '[:lower:]') in