Skip to content

Commit

Permalink
Merge pull request #15 from jserv/build-macos-jni
Browse files Browse the repository at this point in the history
Allow JNI build on macOS
  • Loading branch information
WEI, CHEN committed Mar 16, 2018
2 parents 3219c0e + 8ecdcc4 commit f316736
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,20 @@ else
PYFLAGS += 0
endif

# FIXME: avoid hardcoded OS path
ifneq ("$(DISABLE_JNI)","1")
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
JAVA_HOME := $(shell /usr/libexec/java_home)
CFLAGS_JNI = \
-I$(JAVA_HOME)/include \
-I$(JAVA_HOME)/include/darwin
else
# Default to Linux
CFLAGS_JNI = \
-I$(OPENJDK_PATH)/include \
-I$(OPENJDK_PATH)/include/linux
endif
endif

TESTS = \
trinary \
Expand Down

0 comments on commit f316736

Please sign in to comment.