[2/2] lttng-ust: Using toolchain to compile examples
Details
Commit Message
new file mode 100644
@@ -0,0 +1,97 @@
+From ea7d68aba7723633dcc3944a58f0b30191ea782b Mon Sep 17 00:00:00 2001
+From: Chong Lu <Chong.Lu@windriver.com>
+Date: Fri, 22 Nov 2013 16:11:53 +0800
+Subject: [PATCH] lttng-ust: several fixes
+
+This patch fixes below issues:
+
+1. Using cross compile toolchain to build examples.
+2. Implement the .o file generation manually instead of lttng-gen-tp.
+
+Upstream-Status: Pending
+
+Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
+---
+ doc/examples/demo/Makefile | 1 -
+ doc/examples/easy-ust/Makefile | 1 -
+ doc/examples/gen-tp/Makefile | 17 ++++++++---------
+ doc/examples/hello-static-lib/Makefile | 1 -
+ 4 files changed, 8 insertions(+), 12 deletions(-)
+
+diff --git a/doc/examples/demo/Makefile b/doc/examples/demo/Makefile
+index 27e4146..d0d83e5 100644
+--- a/doc/examples/demo/Makefile
++++ b/doc/examples/demo/Makefile
+@@ -14,7 +14,6 @@
+ #
+ # This makefile is purposefully kept simple to support GNU and BSD make.
+
+-CC = gcc
+ LIBS = -ldl # On Linux
+ #LIBS = -lc # On BSD
+ LOCAL_CPPFLAGS += -I.
+diff --git a/doc/examples/easy-ust/Makefile b/doc/examples/easy-ust/Makefile
+index 966c474..0cfeec4 100644
+--- a/doc/examples/easy-ust/Makefile
++++ b/doc/examples/easy-ust/Makefile
+@@ -16,7 +16,6 @@
+ #
+ # This makefile is purposefully kept simple to support GNU and BSD make.
+
+-CC = gcc
+ LIBS = -ldl -llttng-ust # On Linux
+ #LIBS = -lc -llttng-ust # On BSD
+ LOCAL_CPPFLAGS += -I.
+diff --git a/doc/examples/gen-tp/Makefile b/doc/examples/gen-tp/Makefile
+index bc979d9..b9fe757 100644
+--- a/doc/examples/gen-tp/Makefile
++++ b/doc/examples/gen-tp/Makefile
+@@ -17,7 +17,6 @@
+ #
+ # This makefile is purposefully kept simple to support GNU and BSD make.
+
+-CC = gcc
+
+ LIBS = -ldl -llttng-ust #On Linux
+ #LIBS = -lc -llttng-ust #On BSD
+@@ -33,17 +32,17 @@ sample.o: sample.c sample_tracepoint.h
+ -c -o $@ $<
+
+ # Use this command to compile the .c manually
+-#sample_tracepoint.o: sample_tracepoint.c sample_tracepoint.h
+-# $(CC) $(CPPFLAGS) $(CFLAGS) $(AM_CPPFLAGS) $(AM_CFLAGS) \
+-# -I. -c -o $@ $<
++sample_tracepoint.o: sample_tracepoint.c sample_tracepoint.h
++ $(CC) $(CPPFLAGS) $(CFLAGS) $(AM_CPPFLAGS) $(AM_CFLAGS) \
++ -I. -c -o $@ $<
+
+ # This rule generate .o only and depends on rules for generating
+ # the .h and .c
+-%.o: %.tp %.c %.h
+- CPPFLAGS="$(CPPFLAGS) $(AM_CPPFLAGS)" \
+- CFLAGS="$(CFLAGS) $(AM_CFLAGS)" \
+- LDFLAGS="$(LDFLAGS) $(AM_LDFLAGS)" \
+- $(LTTNG_GEN_TP_PATH)lttng-gen-tp -o $@ $<
++#%.o: %.tp %.c %.h
++# CPPFLAGS="$(CPPFLAGS) $(AM_CPPFLAGS)" \
++# CFLAGS="$(CFLAGS) $(AM_CFLAGS)" \
++# LDFLAGS="$(LDFLAGS) $(AM_LDFLAGS)" \
++# $(LTTNG_GEN_TP_PATH)lttng-gen-tp -o $@ $<
+
+ # The following rule can be used to generate all files instead of having one
+ # for each file type. Note that the sample.o has a dependency on the
+diff --git a/doc/examples/hello-static-lib/Makefile b/doc/examples/hello-static-lib/Makefile
+index 9a079ec..4ed5dcf 100644
+--- a/doc/examples/hello-static-lib/Makefile
++++ b/doc/examples/hello-static-lib/Makefile
+@@ -14,7 +14,6 @@
+ #
+ # This makefile is purposefully kept simple to support GNU and BSD make.
+
+-CC = gcc
+ LOCAL_CPPFLAGS += -I.
+ LIBS = -ldl -llttng-ust # On Linux
+ #LIBS = -lc -llttng-ust # On BSD
+--
+1.7.9.5
+
@@ -22,6 +22,7 @@ PV = "2.3.0"
PE = "2"
SRC_URI = "git://git.lttng.org/lttng-ust.git \
+ file://0001-lttng-ust-several-fixes.patch \
"
S = "${WORKDIR}/git"