From 45ac5f174121c91166a4e89e5ed611946c8987ff Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sun, 28 Apr 2024 17:31:16 +0100 Subject: [PATCH] option.sh: don't use nproc (not portable) export CBMK_THREADS=x where x is an integer. this is already supported for setting the number of build threads, but if not set it uses nproc. openbsd doesn't have nproc. default to 1 thread. now you MUST set threads. e.g. in linux do: export CBMK_THREADS=$(nproc) preliminary work is being done to make cbmk run on openbsd! Signed-off-by: Leah Rowe --- include/option.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/option.sh b/include/option.sh index 45b6f67..7348b76 100755 --- a/include/option.sh +++ b/include/option.sh @@ -15,13 +15,14 @@ tmpgit="${PWD}/tmp/gitclone" eval "$(setvars "" board boarddir)" threads= -set | grep CBMK_THREADS 1>/dev/null 2>/dev/null || threads=$(nproc) || : -[ -z "$threads" ] && threads=$CBMK_THREADS -[ -z "$threads" ] && threads=1 # CBMK_THREADS not set, and nproc failed +set | grep CBMK_THREADS 1>/dev/null 2>/dev/null && threads="$CBMK_THREADS" +[ -z "$threads" ] && threads=1 expr "X$threads" : "X-\{0,1\}[0123456789][0123456789]*$" \ 1>/dev/null 2>/dev/null || threads=1 # user specified a non-integer +export CBMK_THREADS="$threads" + items() { rval=1