From 5998f75a480eca0651051374a4e6c712bae830f8 Mon Sep 17 00:00:00 2001 From: Kamil Rytarowski Date: Thu, 21 Jan 2016 20:03:31 +0100 Subject: NetBSD: Add support for retrieving the number of available CPUs $ uname NetBSD $ getconf NPROCESSORS_ONLN 2 $ getconf _NPROCESSORS_ONLN getconf: _NPROCESSORS_ONLN: unknown variable --- build.sh | 2 ++ run-cppcheck.sh | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 67bc2c5b1f..807a57ab8f 100755 --- a/build.sh +++ b/build.sh @@ -129,6 +129,8 @@ build_coreclr() # processors available to a single process. if [ `uname` = "FreeBSD" ]; then NumProc=`sysctl hw.ncpu | awk '{ print $2+1 }'` + elif [ `uname` = "NetBSD" ]; then + NumProc=$(($(getconf NPROCESSORS_ONLN)+1)) else NumProc=$(($(getconf _NPROCESSORS_ONLN)+1)) fi diff --git a/run-cppcheck.sh b/run-cppcheck.sh index 6888468bfa..c505fd184d 100755 --- a/run-cppcheck.sh +++ b/run-cppcheck.sh @@ -41,6 +41,8 @@ SloccountOutput="sloccount.sc" # processors available to a single process. if [ `uname` = "FreeBSD" ]; then NumProc=`sysctl hw.ncpu | awk '{ print $2+1 }'` +elif [ `uname` = "NetBSD" ]; then +NumProc=$(($(getconf NPROCESSORS_ONLN)+1)) else NumProc=$(($(getconf _NPROCESSORS_ONLN)+1)) fi @@ -114,4 +116,4 @@ then fi echo Check finished. Results can be found in: $CppCheckOutputs $SlocCountOutputs -exit 0 \ No newline at end of file +exit 0 -- cgit v1.2.3