Skip to content

Commit f501ef0

Browse files
committed
Makefile: Improve OS detection on Cygwin.
Fail if java is not located. And default to 64-bit.
1 parent 2688eb3 commit f501ef0

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

prism/Makefile

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,17 @@ endif
102102
# For Windows, we decide whether to build in 64-bit mode based on
103103
# whether java is 32/64-bit (since these need to match)
104104
ifeq ($(OSTYPE),cygwin)
105-
JAVA_VERSION_STRING = $(shell java -version 2>&1)
106-
ifneq (,$(findstring 64-bit, $(JAVA_VERSION_STRING)))
107-
ARCH = x86_64
105+
# Default to 64-bit, which is most likely these days
106+
ARCH = x86_64
107+
ifeq ($(shell which java 2>/dev/null),)
108+
$(error "Could not find java executable. Please install Java or add it to your PATH.")
108109
endif
109-
ifneq (,$(findstring 64-Bit, $(JAVA_VERSION_STRING)))
110-
ARCH = x86_64
110+
JAVA_VERSION_STRING := $(shell java -version 2>&1)
111+
ifneq (,$(findstring 32-bit, $(JAVA_VERSION_STRING)))
112+
ARCH =
113+
endif
114+
ifneq (,$(findstring Client VM, $(JAVA_VERSION_STRING)))
115+
ARCH =
111116
endif
112117
endif
113118

0 commit comments

Comments
 (0)