From adce547e132a6f12cf3c3a552df6102244a970cb Mon Sep 17 00:00:00 2001 From: Dominik Riebeling Date: Fri, 7 Aug 2020 22:11:30 +0200 Subject: [PATCH] rockboxdev: Make it work on macOS. macOS doesn't know about nproc; sysctl is the tool to be used on macOS. Change-Id: Ic7dcf9be51d7ef7b52394ebb2a4df1dc3e31097b --- tools/rockboxdev.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/rockboxdev.sh b/tools/rockboxdev.sh index bf50faf214..6009a0c3af 100755 --- a/tools/rockboxdev.sh +++ b/tools/rockboxdev.sh @@ -32,7 +32,12 @@ fi # This is the absolute path to where the script resides. rockboxdevdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -parallel=`nproc` +if [ `uname -s` = "Darwin" ]; then + parallel=`sysctl -n hw.physicalcpu` +else + parallel=`nproc` +fi + if [ $parallel -gt 1 ] ; then make_parallel=-j$parallel fi