projects
/
summon-arm-toolchain.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6014e9e
)
support getting number of CPUs on FreeBSD et al.
author
Matthias Rampke
<matthias@rampke.de>
Tue, 16 Aug 2011 22:52:11 +0000
(
00:52
+0200)
committer
Matthias Rampke
<matthias@rampke.de>
Tue, 16 Aug 2011 22:52:11 +0000
(
00:52
+0200)
getconf won't say the number of CPUs, sysctl will.
summon-arm-toolchain
patch
|
blob
|
history
diff --git
a/summon-arm-toolchain
b/summon-arm-toolchain
index 56192e1cc961ffd52a172b117c4fbbd4b7cc2c71..9577702c3e5e41a91fd46c362282a3f859ac28e3 100755
(executable)
--- a/
summon-arm-toolchain
+++ b/
summon-arm-toolchain
@@
-72,8
+72,10
@@
b2269d30ce7b93b7c714b90ef2f40221c2df0fcd newlib-1.19.0.tar.gz"
# Flags section
##############################################################################
-if which getconf > /dev/null; then
+if which getconf > /dev/null
&& getconf _NPROCESSORS_ONLN > /dev/null
; then
CPUS=$(getconf _NPROCESSORS_ONLN)
+elif which sysctl > /dev/null && sysctl hw.ncpu > /dev/null; then
+ CPUS=$(sysctl hw.ncpu | sed -E -e 's/^hw\.ncpu(: | = )//')
else
CPUS=1
fi