From a40a1696b4e1a1881d7d67816880e6a52fd6e6f3 Mon Sep 17 00:00:00 2001 From: Gene Hightower Date: Tue, 15 Dec 2015 12:28:27 -0800 Subject: [PATCH] try to get native Windows build working --- defs.Win32 | 15 +++++++++++++-- rules | 12 +++++++++++- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/defs.Win32 b/defs.Win32 index 3b220e7..70b0ca6 100644 --- a/defs.Win32 +++ b/defs.Win32 @@ -39,10 +39,21 @@ CXXFLAGS += -DWIN32 -D_WIN32_WINNT=0x05010000 -DUNICODE -D_UNICODE -D_MT $(WINDRES) -O coff $(OUTPUT_OPTION) $< ifeq (JAVA,$(JAVA)) -# Try to use native Java for Win32 build + +define possibly_set_java_home +ifneq (,$(wildcard $(1))) +JAVA_HOME ?= $(1) +endif +endef + +possible_java_locations := /cygdrive/c/Java/jdk1.8.0_65 /usr/lib/jvm/java-1.8.0-openjdk + +$(foreach x,$(possible_java_locations),$(call possible_java_locations $(x))) + +# Fall back to "native" Java for Win32 build JAVA_HOME ?= /usr/lib/jvm/java-1.8.0-openjdk jvmdir = $(JAVA_HOME)/lib -CXXFLAGS += -I$(JAVA_HOME)/include +CXXFLAGS += -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/win32 #LDLIBS += $(jvmdir)/jvm.lib endif diff --git a/rules b/rules index 88c15cc..2c52775 100644 --- a/rules +++ b/rules @@ -2,7 +2,16 @@ SHELL := /bin/bash -TARG ?= $(shell uname) +uname := $(shell uname) + +ifneq (,$(findstring CYGWIN_NT,$(uname))) + TARG := Win32 +endif +ifneq (,$(findstring MINGW32_NT,$(uname))) + TARG := Win32 +endif + +TARG ?= $(uname) # Java is "special" in many ways, doesn't use pkg-config: requires # per-platform hacks. @@ -121,6 +130,7 @@ dump:: ifneq (,$(JAVA)) @echo "Using JAVA" endif + @echo JAVA_HOME == $(JAVA_HOME) @echo MAKEFILE_LIST == $(MAKEFILE_LIST) @echo .INCLUDE_DIRS == $(.INCLUDE_DIRS) @echo USES == $(USES) -- 2.11.4.GIT