[lttng-dev] [PATCH URCU] Pass the CC variable to the example Makefiles

Mathieu Desnoyers mathieu.desnoyers at efficios.com
Tue Jan 14 09:40:09 EST 2014


Merged with a tiny change: moved AM_CC as make argument rather than env.

Thanks,

Mathieu

----- Original Message -----
> From: "Jérémie Galarneau" <jeremie.galarneau at efficios.com>
> To: lttng-dev at lists.lttng.org
> Sent: Friday, January 10, 2014 4:39:05 PM
> Subject: [lttng-dev] [PATCH URCU] Pass the CC variable to the example	Makefiles
> 
> Cross-compilation fails when using the --host configure option
> since the cross-compiler is not invoked by the hand-made Makefiles
> in doc/examples.
> 
> The CC variable must be passed explicitly to ensure the host's
> default compiler is not invoked.
> 
> Signed-off-by: Jérémie Galarneau <jeremie.galarneau at efficios.com>
> ---
>  doc/examples/Makefile.am                | 2 +-
>  doc/examples/Makefile.examples.template | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/doc/examples/Makefile.am b/doc/examples/Makefile.am
> index 7687098..9c38429 100644
> --- a/doc/examples/Makefile.am
> +++ b/doc/examples/Makefile.am
> @@ -128,7 +128,7 @@ all-local:
>  			cp -fR $(srcdir)/$$subdir $(builddir); \
>  		done; \
>  	fi
> -	$(MAKE) -f dist-files/Makefile AM_CPPFLAGS="$(CPPFLAGS) -I../../../urcu/
> -I../../../" AM_CFLAGS='$(CFLAGS)' AM_LDFLAGS='$(LDFLAGS) -L../../../.libs/
> -Wl,-rpath="$(PWD)/../../.libs/"' $(AM_MAKEFLAGS) all
> +	AM_CC="$(CC)" $(MAKE) -f dist-files/Makefile AM_CPPFLAGS="$(CPPFLAGS)
> -I../../../urcu/ -I../../../" AM_CFLAGS='$(CFLAGS)' AM_LDFLAGS='$(LDFLAGS)
> -L../../../.libs/ -Wl,-rpath="$(PWD)/../../.libs/"' $(AM_MAKEFLAGS) all
>  
>  clean-local:
>  	$(MAKE) -f dist-files/Makefile $(AM_MAKEFLAGS) clean
> diff --git a/doc/examples/Makefile.examples.template
> b/doc/examples/Makefile.examples.template
> index 4a0379a..6dd2bac 100644
> --- a/doc/examples/Makefile.examples.template
> +++ b/doc/examples/Makefile.examples.template
> @@ -11,8 +11,8 @@
>  #
>  # This makefile is purposefully kept simple to support GNU and BSD make.
>  
> -ifndef CC
> -CC = gcc
> +ifdef AM_CC
> +CC = $(AM_CC)
>  endif
>  CFLAGS = -g -O2 -Wall
>  
> --
> 1.8.5.2
> 
> 
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
> 

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



More information about the lttng-dev mailing list