[PATCH 24/32] perf kbuild: remove legacy libpython-related build variable

From: Alexis Berlemont
Date: Tue Jun 03 2014 - 18:11:57 EST


Remove NO_LIBPYTHON (replaced by CONFIG_LIBPYTHON)
---
tools/perf/builtin-script.c | 2 +-
tools/perf/config/Makefile | 43 +++++++++++----------------------
tools/perf/config/Makefile.fix-config | 8 ------
tools/perf/config/Makefile.fix-legacy | 4 ---
tools/perf/util/trace-event-scripting.c | 3 ++-
5 files changed, 17 insertions(+), 43 deletions(-)

diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index ff67f0d..3e59b24 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -1368,7 +1368,7 @@ int find_scripts(char **scripts_array, char **scripts_path_array)
if (strstr(lang_path, "perl"))
continue;
#endif
-#ifdef NO_LIBPYTHON
+#ifndef CONFIG_LIBPYTHON
if (strstr(lang_path, "python"))
continue;
#endif
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 36ba89f..1dd3469 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -469,27 +469,24 @@ ifdef CONFIG_TIMERFD
endif
endif

-disable-python = $(eval $(disable-python_code))
-define disable-python_code
- CFLAGS += -DNO_LIBPYTHON
- $(if $(1),$(warning No $(1) was found))
- $(warning Python support will not be built)
- NO_LIBPYTHON := 1
-endef
-
-override PYTHON := \
- $(call get-executable-or-default,PYTHON,python)
+ifdef CONFIG_LIBPYTHON

-ifndef PYTHON
- $(call disable-python,python interpreter)
-else
+ disable-python = $(eval $(disable-python_code))
+ define disable-python_code
+ $(if $(1),$(warning No $(1) was found))
+ $(warning Python support will not be built)
+ $(shell $(KCONFIG_SCRIPT) -d CONFIG_LIBPYTHON)
+ endef

- PYTHON_WORD := $(call shell-wordify,$(PYTHON))
+ override PYTHON := \
+ $(call get-executable-or-default,PYTHON,python)

- ifdef NO_LIBPYTHON
- $(call disable-python)
+ ifndef PYTHON
+ $(call disable-python,python interpreter)
else

+ PYTHON_WORD := $(call shell-wordify,$(PYTHON))
+
override PYTHON_CONFIG := \
$(call get-executable-or-default,PYTHON_CONFIG,$(PYTHON)-config)

@@ -510,18 +507,7 @@ else
else

ifneq ($(feature-libpython-version), 1)
- $(warning Python 3 is not yet supported; please set)
- $(warning PYTHON and/or PYTHON_CONFIG appropriately.)
- $(warning If you also have Python 2 installed, then)
- $(warning try something like:)
- $(warning $(and ,))
- $(warning $(and ,) make PYTHON=python2)
- $(warning $(and ,))
- $(warning Otherwise, disable Python support entirely:)
- $(warning $(and ,))
- $(warning $(and ,) make NO_LIBPYTHON=1)
- $(warning $(and ,))
- $(error $(and ,))
+ $(call disable-python,python2 interpreter)
else
LDFLAGS += $(PYTHON_EMBED_LDFLAGS)
EXTLIBS += $(PYTHON_EMBED_LIBADD)
@@ -769,7 +755,6 @@ all:
$(call store,PYTHON_EMBED_CCOPTS)
$(call store,PERL_EMBED_CCOPTS)
$(call store,CONFIG_X86_64)
- $(call store,NO_LIBPYTHON)
$(call store,ETC_PERFCONFIG_SQ)
$(call store,DESTDIR_SQ)
$(call store,bindir_SQ)
diff --git a/tools/perf/config/Makefile.fix-config b/tools/perf/config/Makefile.fix-config
index 273f793..3f0e33e 100644
--- a/tools/perf/config/Makefile.fix-config
+++ b/tools/perf/config/Makefile.fix-config
@@ -3,12 +3,4 @@ include $(KCONFIG_CONFIG)

CONFIG := $(srctree)/scripts/config --file $(KCONFIG_CONFIG)

-# NO_LIBPYTHON
-ifdef CONFIG_LIBPYTHON
-ifdef NO_LIBPYTHON
-dummy := $(info Disabling CONFIG_LIBPYTHON)
-dummy := $(shell $(CONFIG) -d CONFIG_LIBPYTHON)
-endif
-endif
-
all:
diff --git a/tools/perf/config/Makefile.fix-legacy b/tools/perf/config/Makefile.fix-legacy
index 275b6d9..431c9bf 100644
--- a/tools/perf/config/Makefile.fix-legacy
+++ b/tools/perf/config/Makefile.fix-legacy
@@ -1,6 +1,2 @@

include $(KCONFIG_CONFIG)
-
-ifndef CONFIG_LIBPYTHON
-NO_LIBPYTHON := 1
-endif
diff --git a/tools/perf/util/trace-event-scripting.c b/tools/perf/util/trace-event-scripting.c
index 51d8019..4a70ef7 100644
--- a/tools/perf/util/trace-event-scripting.c
+++ b/tools/perf/util/trace-event-scripting.c
@@ -24,6 +24,7 @@
#include <string.h>
#include <errno.h>

+#include "generated/autoconf.h"
#include "../perf.h"
#include "util.h"
#include "trace-event.h"
@@ -93,7 +94,7 @@ static void register_python_scripting(struct scripting_ops *scripting_ops)
scripting_context = malloc(sizeof(struct scripting_context));
}

-#ifdef NO_LIBPYTHON
+#ifndef CONFIG_LIBPYTHON
void setup_python_scripting(void)
{
register_python_scripting(&python_scripting_unsupported_ops);
--
1.9.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/