mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
java: support OpenJDK 10+
Starting OpenJDK 10, the 'javah' utility is no more provided [1], and its functionality is provided by 'javac' itself. Hence, do not error out on missing 'javah', and store whether it was found; in case it is not, then: 1) assume 'javac' has the -h parameter to generate the C header, and make use of it 2) tell the buildsystem that com_redhat_et_libguestfs_GuestFS.h depends on the JAR, since the the header is generated at the step (1) [1] https://bugs.java.com/view_bug.do?bug_id=JDK-8182758
This commit is contained in:
committed by
Hilko Bengen
parent
784f18156e
commit
662dc5d0bf
@@ -77,6 +77,9 @@ if HAVE_JAVA
|
||||
|
||||
JAVAC_FLAGS = $(EXTRA_JAVAC_FLAGS) -encoding utf-8
|
||||
JAVADOC_FLAGS = -encoding utf-8
|
||||
if !HAVE_JAVAH
|
||||
JAVAC_FLAGS += -h .
|
||||
endif
|
||||
|
||||
# Java source.
|
||||
|
||||
@@ -125,10 +128,18 @@ libguestfs_jni_la_LDFLAGS = -version-info $(JNI_VERSION_INFO) -shared
|
||||
|
||||
BUILT_SOURCES = com_redhat_et_libguestfs_GuestFS.h
|
||||
|
||||
if HAVE_JAVAH
|
||||
|
||||
com_redhat_et_libguestfs_GuestFS.h: $(java_prefix)/GuestFS.class
|
||||
rm -f $@
|
||||
$(JAVAH) -classpath $(srcdir):. com.redhat.et.libguestfs.GuestFS
|
||||
|
||||
else
|
||||
|
||||
com_redhat_et_libguestfs_GuestFS.h: libguestfs-${VERSION}.jar
|
||||
|
||||
endif
|
||||
|
||||
# Documentation.
|
||||
|
||||
noinst_SCRIPTS = doc-stamp
|
||||
|
||||
Reference in New Issue
Block a user