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

Jérémie Galarneau jeremie.galarneau at efficios.com
Fri Jan 10 16:39:05 EST 2014


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




More information about the lttng-dev mailing list