From: Jérémie Galarneau Date: Fri, 10 Jan 2014 21:39:05 +0000 (-0500) Subject: Pass the CC variable to the example Makefiles X-Git-Tag: v0.8.2~14 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=6b5a2125ab523e1c8fcb3118141102cba9f9ca43;p=userspace-rcu.git 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 Signed-off-by: Mathieu Desnoyers --- diff --git a/doc/examples/Makefile.am b/doc/examples/Makefile.am index 7687098..705e817 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 + $(MAKE) -f dist-files/Makefile AM_CC="$(CC)" 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