summaryrefslogtreecommitdiff
path: root/src/runtime/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/java')
-rw-r--r--src/runtime/java/INSTALL15
-rw-r--r--src/runtime/java/Makefile9
2 files changed, 17 insertions, 7 deletions
diff --git a/src/runtime/java/INSTALL b/src/runtime/java/INSTALL
index 6d97dd279..3facef134 100644
--- a/src/runtime/java/INSTALL
+++ b/src/runtime/java/INSTALL
@@ -1,10 +1,15 @@
-Before compiling the Java binding you first need to have the C runtime
+Before compiling the Java binding you first need to have the C runtime
compiled and installed. You also need to find where your jni.h header
is installed. It is part of the Java JDK, but it might be placed
-in different places on different platforms. The path to the jni.h
-header should be assigned to the JNI_PATH variable in the beginning
-of the Makefile that you will find in the root directory of
-the binding. Once this is done type:
+in different places on different platforms.
+The Makefile in this directory will try to figure out the location of
+jni.h, but if it doesn't succeed you should add it manually to the
+JNI_INCLUDES variable in the beginning of the Makefile.
+
+Once this is done type:
$ make
$ make install
+
+For Windows you might have to uncomment the lines around
+WINDOWS_FLAGS in the Makefile.
diff --git a/src/runtime/java/Makefile b/src/runtime/java/Makefile
index b7a7264cc..d5a25a2f6 100644
--- a/src/runtime/java/Makefile
+++ b/src/runtime/java/Makefile
@@ -3,10 +3,15 @@ JAVA_SOURCES = $(wildcard org/grammaticalframework/pgf/*.java) \
$(wildcard org/grammaticalframework/sg/*.java)
JNI_INCLUDES = $(if $(wildcard /usr/lib/jvm/default-java/include/.*), -I/usr/lib/jvm/default-java/include -I/usr/lib/jvm/default-java/include/linux, \
- $(if $(wildcard /System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/.*), /System/Library/Frameworks/JavaVM.framework/Versions/A/Headers, \
+ $(if $(wildcard /System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/.*), -I/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers, \
$(if $(wildcard /Library/Java/Home/include/.*), -I/Library/Java/Home/include/ -I/Library/Java/Home/include/darwin, \
$(error No JNI headers found))))
+# For Windows replace the previous line with something like this:
+#
+# JNI_INCLUDES = -I "C:/Program Files/Java/jdk1.8.0_171/include" -I "C:/Program Files/Java/jdk1.8.0_171/include/win32" -I "C:/MinGW/msys/1.0/local/include"
+# WINDOWS_FLAGS = -L"C:/MinGW/msys/1.0/local/lib" -no-undefined
+
INSTALL_PATH = /usr/local/lib
LIBTOOL = glibtool --tag=CC
@@ -15,7 +20,7 @@ LIBTOOL = $(if $(shell command -v glibtool 2>/dev/null), glibtool --tag=CC, libt
all: libjpgf.la jpgf.jar
libjpgf.la: $(patsubst %.c, %.lo, $(C_SOURCES))
- $(LIBTOOL) --mode=link gcc $(CFLAGS) -g -O -o libjpgf.la -shared $^ -rpath $(INSTALL_PATH) -lgu -lpgf -lsg
+ $(LIBTOOL) --mode=link gcc $(CFLAGS) -g -O -o libjpgf.la -shared $^ -rpath $(INSTALL_PATH) -lgu -lpgf -lsg $(WINDOWS_FLAGS)
%.lo : %.c
$(LIBTOOL) --mode=compile gcc $(CFLAGS) -g -O -c $(JNI_INCLUDES) -std=c99 -shared $< -o $@