Commit 9cea2f81 authored by Michael Jeanson's avatar Michael Jeanson

Drop patch applied upstream

parent 9967d21d
From 7080b0958c5a3915b116ba03731dce2f84b19863 Mon Sep 17 00:00:00 2001
From: Michael Jeanson <mjeanson@efficios.com>
Date: Thu, 3 May 2018 15:34:08 -0400
Subject: [PATCH] Fix: build jni libs with openjdk >= 10
In openjdk 10, the "javah" utility used to generate c headers from java
classes was removed and replaced with an option of "javac".
When we detect "javac" but no "javah", assume we are working with
openjdk >= 10 and configure the build system to use the proper tool and
switches.
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
---
configure.ac | 2 ++
liblttng-ust-java-agent/java/lttng-ust-agent-common/Makefile.am | 6 ++++++
liblttng-ust-java-agent/java/lttng-ust-agent-jul/Makefile.am | 6 ++++++
liblttng-ust-java-agent/java/lttng-ust-agent-log4j/Makefile.am | 6 ++++++
liblttng-ust-java/Makefile.am | 8 ++++++++
5 files changed, 28 insertions(+)
--- a/configure.ac
+++ b/configure.ac
@@ -345,6 +345,8 @@
CPPFLAGS="$saved_CPPFLAGS"
])
+AM_CONDITIONAL([HAVE_JAVAH], [test "x$JAVAH" != "x"])
+
AS_IF([test "x$java_agent_log4j" = "xyes"], [
AX_CHECK_CLASSPATH
AX_CHECK_CLASS([org.apache.log4j.Logger])
--- a/liblttng-ust-java-agent/java/lttng-ust-agent-common/Makefile.am
+++ b/liblttng-ust-java-agent/java/lttng-ust-agent-common/Makefile.am
@@ -50,11 +50,17 @@
$(jarfile): classnoinst.stamp
$(JAR) cfm $(JARFLAGS) $@ $(jarfile_manifest) $(classes) && rm -f $(jarfile_symlink) && $(LN_S) $@ $(jarfile_symlink)
+if !HAVE_JAVAH
+# If we don't have javah, assume we are running openjdk >= 10 and use javac
+# to generate the jni header file.
+AM_JAVACFLAGS = -h $(jnioutdir)
+else
context-jni-header.stamp: $(dist_noinst_JAVA)
$(JAVAH) -classpath $(CLASSPATH):$(srcdir) -d $(jnioutdir) $(JAVAHFLAGS) org.lttng.ust.agent.context.LttngContextApi && \
echo "Context API JNI header generated" > context-jni-header.stamp
all-local: context-jni-header.stamp
+endif
install-data-hook:
cd $(DESTDIR)/$(jardir) && rm -f $(jarfile_symlink) && $(LN_S) $(jarfile) $(jarfile_symlink)
--- a/liblttng-ust-java-agent/java/lttng-ust-agent-jul/Makefile.am
+++ b/liblttng-ust-java-agent/java/lttng-ust-agent-jul/Makefile.am
@@ -26,11 +26,17 @@
$(jarfile): classnoinst.stamp
$(JAR) cfm $(JARFLAGS) $@ $(jarfile_manifest) $(classes) && rm -f $(jarfile_symlink) && $(LN_S) $@ $(jarfile_symlink)
+if !HAVE_JAVAH
+# If we don't have javah, assume we are running openjdk >= 10 and use javac
+# to generate the jni header file.
+AM_JAVACFLAGS = -h $(juljniout)
+else
jul-jni-header.stamp: $(dist_noinst_JAVA)
$(JAVAH) -classpath $(CLASSPATH):$(srcdir) -d $(juljniout) $(JAVAHFLAGS) org.lttng.ust.agent.jul.LttngJulApi && \
echo "JUL JNI header generated" > jul-jni-header.stamp
all-local: $(stamp)
+endif
install-data-hook:
cd $(DESTDIR)/$(jardir) && rm -f $(jarfile_symlink) && $(LN_S) $(jarfile) $(jarfile_symlink)
--- a/liblttng-ust-java-agent/java/lttng-ust-agent-log4j/Makefile.am
+++ b/liblttng-ust-java-agent/java/lttng-ust-agent-log4j/Makefile.am
@@ -26,11 +26,17 @@
$(jarfile): classnoinst.stamp
$(JAR) cfm $(JARFLAGS) $@ $(jarfile_manifest) $(classes) && rm -f $(jarfile_symlink) && $(LN_S) $@ $(jarfile_symlink)
+if !HAVE_JAVAH
+# If we don't have javah, assume we are running openjdk >= 10 and use javac
+# to generate the jni header file.
+AM_JAVACFLAGS = -h $(log4jjniout)
+else
log4j-jni-header.stamp: $(dist_noinst_JAVA)
$(JAVAH) -classpath $(CLASSPATH):$(srcdir) -d $(log4jjniout) $(JAVAHFLAGS) org.lttng.ust.agent.log4j.LttngLog4jApi && \
echo "Log4j JNI header generated" > log4j-jni-header.stamp
all-local: $(stamp)
+endif
install-data-hook:
cd $(DESTDIR)/$(jardir) && rm -f $(jarfile_symlink) && $(LN_S) $(jarfile) $(jarfile_symlink)
--- a/liblttng-ust-java/Makefile.am
+++ b/liblttng-ust-java/Makefile.am
@@ -18,11 +18,19 @@
$(jarfile): classnoinst.stamp
$(JAR) cf $(JARFLAGS) $@ $(pkgpath)/*.class
+if !HAVE_JAVAH
+# If we don't have javah, assume we are running openjdk >= 10 and use javac
+# to generate the jni header file.
+AM_JAVACFLAGS = -h .
+
+org_lttng_ust_LTTngUst.h: $(jarfile)
+else
org_lttng_ust_LTTngUst.h: jni-header.stamp
jni-header.stamp: $(dist_noinst_JAVA)
$(JAVAH) -classpath $(srcdir) $(JAVAHFLAGS) org.lttng.ust.LTTngUst && \
echo "JNI header generated" > jni-header.stamp
+endif
all-local: org_lttng_ust_LTTngUst.h
fix-jni-libdir.patch
fix-jni-openjdk-10.patch
use-python3.patch
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment