From: Jérémie Galarneau Date: Wed, 7 May 2014 15:41:46 +0000 (-0400) Subject: Fix: Move generated headers to the BUILT_SOURCES target X-Git-Tag: v2.5.0-rc1~8 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=d099b3340db2a8cad810a2c096592df6d2bed75e;p=lttng-ust.git Fix: Move generated headers to the BUILT_SOURCES target 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 --- 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)" $<