From a4e2c093247d929471eae2f16fa7c4e799eedfe3 Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Tue, 23 Mar 2021 12:09:49 -0400 Subject: [PATCH] fix: use configured python when building the examples Prior to the refactoring of the autotools setup we used different python detection mechanisms for the python agent feature and the example code. The example code detection was flawed as it would only work with a python binary named exactly 'python'. Wire the detected python binary in the examples Makefile integration. Change-Id: I07b9222a8869ff154073e5b72fb2ac0d70f14896 Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- doc/examples/Makefile.am | 1 + doc/examples/gen-tp/Makefile | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/doc/examples/Makefile.am b/doc/examples/Makefile.am index d713d1ea..c16210f4 100644 --- a/doc/examples/Makefile.am +++ b/doc/examples/Makefile.am @@ -132,6 +132,7 @@ all-local: $(MAKE) all \ AR="$(AR)" \ CC="$(CC)" \ + PYTHON="$(PYTHON)" \ CPPFLAGS="$(CPPFLAGS)" \ AM_CPPFLAGS="$(AM_CPPFLAGS) \ -I$$rel_src_subdir$(top_srcdir)/include/ \ diff --git a/doc/examples/gen-tp/Makefile b/doc/examples/gen-tp/Makefile index de62e481..07627f3d 100644 --- a/doc/examples/gen-tp/Makefile +++ b/doc/examples/gen-tp/Makefile @@ -10,6 +10,8 @@ # # This makefile is purposefully kept simple to support GNU and BSD make. +PYTHON := python + LIBS = -ldl -llttng-ust #On Linux #LIBS = -lc -llttng-ust #On BSD AM_V_P := : @@ -39,7 +41,7 @@ sample.o: sample.c sample_tracepoint.h CFLAGS="$(AM_CFLAGS) $(CFLAGS)" \ LDFLAGS="$(AM_LDFLAGS) $(LDFLAGS)" \ CC="$(CC)" \ - $(LTTNG_GEN_TP_PATH)lttng-gen-tp -o $@ $< + $(PYTHON) $(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 @@ -49,11 +51,11 @@ sample.o: sample.c sample_tracepoint.h %.h: %.tp @if $(AM_V_P); then set -x; else echo " GEN $@"; fi; \ - $(LTTNG_GEN_TP_PATH)lttng-gen-tp -o $@ $< + $(PYTHON) $(LTTNG_GEN_TP_PATH)lttng-gen-tp -o $@ $< %.c: %.tp @if $(AM_V_P); then set -x; else echo " GEN $@"; fi; \ - $(LTTNG_GEN_TP_PATH)lttng-gen-tp -o $@ $< + $(PYTHON) $(LTTNG_GEN_TP_PATH)lttng-gen-tp -o $@ $< .PHONY: clean clean: -- 2.34.1