Fix: build jni libs with openjdk >= 10
[lttng-ust.git] / liblttng-ust-java / Makefile.am
index 399b62cac1d06cb322d3b549c9998523d72027fe..260774f972c81540854b9d20828be9651341f7d2 100644 (file)
@@ -17,11 +17,19 @@ liblttng_ust_java_la_LIBADD = -lc -L$(top_builddir)/liblttng-ust/.libs -llttng-u
 $(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
 
This page took 0.023327 seconds and 4 git commands to generate.