Pass the CC variable to the example Makefiles
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 10 Jan 2014 21:38:05 +0000 (16:38 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 14 Jan 2014 14:29:45 +0000 (09:29 -0500)
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@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
doc/examples/Makefile.am
doc/examples/demo/Makefile
doc/examples/easy-ust/Makefile
doc/examples/gen-tp/Makefile
doc/examples/hello-static-lib/Makefile

index 725806d7d6e2cbf9098706c8be765c917aa4abd0..1e1423c76b6ba46ee9c5afc40a1c5b0fb39252b9 100644 (file)
@@ -54,7 +54,7 @@ all-local:
                done; \
        fi
        for subdir in $(SUBDIRS_PROXY); do \
-               (cd $$subdir && $(MAKE) AM_CPPFLAGS="$(CPPFLAGS) -I../../../include/" AM_CFLAGS='$(CFLAGS)' AM_LDFLAGS='$(LDFLAGS) -L../../../liblttng-ust/.libs/ -Wl,-rpath="$(PWD)/../../liblttng-ust/.libs/"' LTTNG_GEN_TP_PATH="../../../tools/" $(AM_MAKEFLAGS) all && cd ..) || exit 1; \
+               (cd $$subdir && $(MAKE) AM_CC="$(CC)" AM_CPPFLAGS="$(CPPFLAGS) -I../../../include/" AM_CFLAGS='$(CFLAGS)' AM_LDFLAGS='$(LDFLAGS) -L../../../liblttng-ust/.libs/ -Wl,-rpath="$(PWD)/../../liblttng-ust/.libs/"' LTTNG_GEN_TP_PATH="../../../tools/" $(AM_MAKEFLAGS) all && cd ..) || exit 1; \
        done
        @if [ x"$(SUBDIRS_JUL)" != x"" ]; then \
                for subdir in $(SUBDIRS_JUL); do \
index 27e4146012ab02a40051f80b858846e6529a611d..9c847b13a84d6a21cd270e03224c274ac789c86c 100644 (file)
 #
 # This makefile is purposefully kept simple to support GNU and BSD make.
 
-CC = gcc
+ifdef AM_CC
+       CC = $(AM_CC)
+endif
+
 LIBS = -ldl    # On Linux
 #LIBS = -lc    # On BSD
 LOCAL_CPPFLAGS += -I.
index 966c4744bb3c359e100bce061a0e273cb313f986..723780f31940bb35f466cc8107ccf5b86e371e21 100644 (file)
 #
 # This makefile is purposefully kept simple to support GNU and BSD make.
 
-CC = gcc
+ifdef AM_CC
+       CC = $(AM_CC)
+endif
+
 LIBS = -ldl -llttng-ust                # On Linux
 #LIBS = -lc -llttng-ust                # On BSD
 LOCAL_CPPFLAGS += -I.
index bc979d97b89a2ed0b20b657fd3eeed8583fe76c3..0fa757c11640fb651676bf4324e9d2f031704445 100644 (file)
@@ -17,7 +17,9 @@
 #
 # This makefile is purposefully kept simple to support GNU and BSD make.
 
-CC = gcc
+ifdef AM_CC
+       CC = $(AM_CC)
+endif
 
 LIBS = -ldl -llttng-ust                #On Linux
 #LIBS = -lc -llttng-ust                #On BSD
@@ -43,6 +45,7 @@ sample.o: sample.c sample_tracepoint.h
        CPPFLAGS="$(CPPFLAGS) $(AM_CPPFLAGS)" \
        CFLAGS="$(CFLAGS) $(AM_CFLAGS)" \
        LDFLAGS="$(LDFLAGS) $(AM_LDFLAGS)" \
+       CC=$(CC) \
        $(LTTNG_GEN_TP_PATH)lttng-gen-tp -o $@ $<
 
 # The following rule can be used to generate all files instead of having one
index 9a079ec1bfbdb6dbe250308baf746c6db30a10d5..ec185c1ca38ba59bc0dad57d85803e41e991144b 100644 (file)
 #
 # This makefile is purposefully kept simple to support GNU and BSD make.
 
-CC = gcc
+ifdef AM_CC
+       CC = $(AM_CC)
+endif
+
 LOCAL_CPPFLAGS += -I.
 LIBS = -ldl -llttng-ust        # On Linux
 #LIBS = -lc -llttng-ust        # On BSD
This page took 0.026665 seconds and 4 git commands to generate.