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>
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
clean-local:
#
# 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.
#
# 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.
#
# 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
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
#
# 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