[lttng-dev] [PATCH lttng-ust] Fix: Move generated headers to the BUILT_SOURCES target

Mathieu Desnoyers mathieu.desnoyers at efficios.com
Wed May 7 15:57:21 EDT 2014


Merged into master and stable-2.4, thanks!

Mathieu

----- Original Message -----
> From: "Jérémie Galarneau" <jeremie.galarneau at efficios.com>
> To: lttng-dev at lists.lttng.org
> Cc: "mathieu desnoyers" <mathieu.desnoyers at efficios.com>, "Jérémie Galarneau" <jeremie.galarneau at efficios.com>
> Sent: Wednesday, May 7, 2014 11:41:46 AM
> Subject: [PATCH lttng-ust] 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 <dgoulet at efficios.com>
> Signed-off-by: Jérémie Galarneau <jeremie.galarneau at efficios.com>
> ---
>  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 37867a7..64c654b 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 9b86caa..bc13c76 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)" $<
>  
> --
> 1.9.2
> 
> 

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com



More information about the lttng-dev mailing list