From 025907937f0f5aa689385a575e8cebb7e9381a1e Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Wed, 7 May 2014 11:41:46 -0400 Subject: [PATCH] Fix: Move generated headers to the BUILT_SOURCES target MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This fixes the out of tree build when enabling Java support. The problem in using an LTTngUst.c target is that automake will then assume the file is generated and thus be found in the builddir. Using the BUILT_SOURCES target will ensure the org_lttng_ust_LTTngUst.h and org_lttng_ust_jul_LTTngUst.h headers are generated before LTTngUst.c is compiled. Tested-by: David Goulet Signed-off-by: Jérémie Galarneau Signed-off-by: Mathieu Desnoyers --- liblttng-ust-java/Makefile.am | 5 ++--- liblttng-ust-jul/Makefile.am | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/liblttng-ust-java/Makefile.am b/liblttng-ust-java/Makefile.am index 37867a7c..64c654bb 100644 --- a/liblttng-ust-java/Makefile.am +++ b/liblttng-ust-java/Makefile.am @@ -3,8 +3,9 @@ LTTNG_JUST_DESTDIR = $(builddir)/org/lttng/ust if BUILD_JNI_INTERFACE -AM_CPPFLAGS = -I$(top_srcdir)/include +AM_CPPFLAGS = -I$(top_srcdir)/include -I$(builddir) +BUILT_SOURCES = org_lttng_ust_LTTngUst.h lib_LTLIBRARIES = liblttng-ust-java.la liblttng_ust_java_la_SOURCES = LTTngUst.c lttng_ust_java.h nodist_liblttng_ust_java_la_SOURCES = org_lttng_ust_LTTngUst.h @@ -24,8 +25,6 @@ clean-local: rm -f liblttng-ust-java.jar rm -rf org/lttng/ust/*.class -LTTngUst.c: org_lttng_ust_LTTngUst.h - $(LTTNG_JUST_DESTDIR)/LTTngUst.class: $(LTTNG_JUST_SRCDIR)/LTTngUst.java $(JCC)/javac -d "$(builddir)" "$(LTTNG_JUST_SRCDIR)/LTTngUst.java" diff --git a/liblttng-ust-jul/Makefile.am b/liblttng-ust-jul/Makefile.am index 9b86caae..bc13c76f 100644 --- a/liblttng-ust-jul/Makefile.am +++ b/liblttng-ust-jul/Makefile.am @@ -3,8 +3,9 @@ LTTNG_JUL_DESTDIR = $(builddir)/org/lttng/ust/jul if BUILD_JNI_INTERFACE -AM_CPPFLAGS = -I$(top_srcdir)/include +AM_CPPFLAGS = -I$(top_srcdir)/include -I$(builddir) +BUILT_SOURCES = org_lttng_ust_jul_LTTngUst.h lib_LTLIBRARIES = liblttng-ust-jul-jni.la liblttng_ust_jul_jni_la_SOURCES = LTTngUst.c lttng_ust_jul.h nodist_liblttng_ust_jul_jni_la_SOURCES = org_lttng_ust_jul_LTTngUst.h @@ -35,8 +36,6 @@ clean-local: rm -f liblttng-ust-jul.jar rm -f org/lttng/ust/jul/*.class -LTTngUst.c: org_lttng_ust_jul_LTTngUst.h - %.class: %.java $(JCC)/javac -d "$(builddir)" $< -- 2.34.1