mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-11-28 11:05:17 +03:00
Use sysctl instead of nproc to get number of processors on FreeBSD
On FreeBSD `nproc` is not available in a standard installation, so the equivalent `sysctl -n hw.ncpu` is used.
This commit is contained in:
parent
b9e95d5d8d
commit
2477d060a8
@ -1,5 +1,10 @@
|
||||
INTERACTIVE ?= --interactive
|
||||
threads ?= `nproc`
|
||||
ifeq ($(shell uname), FreeBSD)
|
||||
NPROC = sysctl -n hw.ncpu
|
||||
else
|
||||
NPROC = nproc
|
||||
endif
|
||||
threads ?= `$(NPROC)`
|
||||
|
||||
.PHONY: testbin test
|
||||
|
||||
|
@ -1,5 +1,9 @@
|
||||
rm -f expected
|
||||
echo "$(nproc) processors" > expected
|
||||
if [ "FreeBSD" = "$(uname)" ]; then
|
||||
echo "$(sysctl -n hw.ncpu) processors" > expected
|
||||
else
|
||||
echo "$(nproc) processors" > expected
|
||||
fi
|
||||
|
||||
$1 --no-banner --no-color --console-width 0 NumProcessors.idr --exec main
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user