aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt (VMware) <rostedt@goodmis.org>2017-02-16 17:45:20 -0500
committerSteven Rostedt (VMware) <rostedt@goodmis.org>2017-04-26 10:49:42 -0400
commit69ddfbbdd1fddcb0bf9bb9395cfd91de451a98f1 (patch)
tree156be483cf0f6815061a209378845dd6197ee467
parente0a5f0a59d0f4fe26cbfd3a05f8f45baab7cec3a (diff)
downloadtrace-cmd-69ddfbbdd1fddcb0bf9bb9395cfd91de451a98f1.tar.gz
trace-cmd build: If swig is not installed, force NO_PYTHON=1
While trying to build trace-cmd on a box without swig installed, I get an annoying error during build when the compile tries to build the python plugins. Force NO_PYTHON=1 when swig is not installed, and give a warning about it. Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
-rw-r--r--Makefile11
1 files changed, 11 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index ebae15a2..571af626 100644
--- a/Makefile
+++ b/Makefile
@@ -90,6 +90,12 @@ ifndef VERBOSE
VERBOSE = 0
endif
+SWIG_DEFINED := $(shell if swig -help &> /dev/null; then echo 1; else echo 0; fi)
+ifeq ($(SWIG_DEFINED), 0)
+BUILD_PYTHON := report_noswig
+NO_PYTHON = 1
+endif
+
ifndef NO_PYTHON
PYTHON := ctracecmd.so
PYTHON_GUI := ctracecmd.so ctracecmdgui.so
@@ -615,6 +621,11 @@ clean:
##### PYTHON STUFF #####
+report_noswig: force
+ $(Q)echo
+ $(Q)echo " NO_PYTHON forced: swig not installed, not compling python plugins"
+ $(Q)echo
+
PYTHON_INCLUDES = `pkg-config --cflags $(PYTHON_VERS)`
PYTHON_LDFLAGS = `pkg-config --libs $(PYTHON_VERS)` \
$(shell python2 -c "import distutils.sysconfig; print distutils.sysconfig.get_config_var('LINKFORSHARED')")