Use NPROCESSORS_ONLN in Makefile on SunOS platform

On illumos, which is derived from SunOS, there is no _NPROCESSORS_ONLN
parameter for getconf [1].

[1] https://github.com/illumos/illumos-gate/blob/master/usr/src/cmd/getconf/getconf.c#L761-L766
This commit is contained in:
japinli 2024-06-19 09:55:25 +08:00 committed by Japin
parent 13e3bb88a9
commit 6186535119

View file

@ -1,6 +1,10 @@
PKG_PREFIX := github.com/VictoriaMetrics/VictoriaMetrics
ifeq ($(shell uname -s),SunOS)
MAKE_CONCURRENCY ?= $(shell getconf NPROCESSORS_ONLN)
else
MAKE_CONCURRENCY ?= $(shell getconf _NPROCESSORS_ONLN)
endif
MAKE_PARALLEL := $(MAKE) -j $(MAKE_CONCURRENCY)
DATEINFO_TAG ?= $(shell date -u +'%Y%m%d-%H%M%S')
BUILDINFO_TAG ?= $(shell echo $$(git describe --long --all | tr '/' '-')$$( \