From 6b5a2125ab523e1c8fcb3118141102cba9f9ca43 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Fri, 10 Jan 2014 16:39:05 -0500 Subject: [PATCH] Pass the CC variable to the example Makefiles MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- 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..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 -- 2.34.1