[PATCH] trace-cmd build: Do not execute python scripts if there is no python

From: Steven Rostedt (VMware)
Date: Thu Mar 22 2018 - 18:38:22 EST


I was triggering the following build messages when not having swig installed:

make: -config: Command not found

NO_PYTHON forced: swig not installed, not compiling python plugins

make: -config: Command not found
UPDATE trace_python_dir
make: -config: Command not found

This is due to the executing of $(PYTHON_VERS)-config, which would just turn
into "-config". Do not assign the PYTHON_* variables if NO_PYTHON is
defined.

Signed-off-by: Steven Rostedt (VMware) <rostedt@xxxxxxxxxxx>
---
Makefile | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/Makefile b/Makefile
index 2c82301..26fd42b 100644
--- a/Makefile
+++ b/Makefile
@@ -373,10 +373,16 @@ report_nopythondev: force
$(Q)echo " python-dev is not installed, not compiling python plugins"
$(Q)echo

+ifndef NO_PYTHON
PYTHON_INCLUDES = `pkg-config --cflags $(PYTHON_VERS)`
PYTHON_LDFLAGS = `pkg-config --libs $(PYTHON_VERS)` \
$(shell $(PYTHON_VERS)-config --ldflags)
PYGTK_CFLAGS = `pkg-config --cflags pygtk-2.0`
+else
+PYTHON_INCLUDES =
+PYTHON_LDFLAGS =
+PYGTK_CFLAGS =
+endif

export PYTHON_INCLUDES
export PYTHON_LDFLAGS
--
2.13.6