Add fallback if NUM_CORES cannot be found and print warning ihse-runtestprebuilt-branch
authorerikj
Wed, 03 Oct 2018 17:16:54 -0700
branchihse-runtestprebuilt-branch
changeset 56923 3603b2f71035
parent 56917 e3334aaef781
child 56924 3ff24f395d16
Add fallback if NUM_CORES cannot be found and print warning
make/RunTestsPrebuilt.gmk
--- a/make/RunTestsPrebuilt.gmk	Tue Oct 02 17:16:01 2018 -0700
+++ b/make/RunTestsPrebuilt.gmk	Wed Oct 03 17:16:54 2018 -0700
@@ -222,15 +222,17 @@
 
 # Check number of cores
 ifeq ($(OPENJDK_TARGET_OS), linux)
-    NUM_CORES := $(shell $(CAT) /proc/cpuinfo  | $(GREP) -c processor)
+  NUM_CORES := $(shell $(CAT) /proc/cpuinfo  | $(GREP) -c processor)
 else ifeq ($(OPENJDK_TARGET_OS), macosx)
-    NUM_CORES := $(shell /usr/sbin/sysctl -n hw.ncpu)
+  NUM_CORES := $(shell /usr/sbin/sysctl -n hw.ncpu)
 else ifeq ($(OPENJDK_TARGET_OS), solaris)
-    NUM_CORES := $(shell LC_MESSAGES=C /usr/sbin/psrinfo -v | $(GREP) -c on-line)
+  NUM_CORES := $(shell LC_MESSAGES=C /usr/sbin/psrinfo -v | $(GREP) -c on-line)
 else ifeq ($(OPENJDK_TARGET_OS), windows)
-    NUM_CORES := $(NUMBER_OF_PROCESSORS)
-else
-    NUM_CORES := 1
+  NUM_CORES := $(NUMBER_OF_PROCESSORS)
+endif
+ifeq ($(NUM_CORES), )
+  $(warn Could not find number of CPUs, assuming 1)
+  NUM_CORES := 1
 endif
 
 ################################################################################