aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@redhat.com>2013-03-17 19:35:32 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2013-05-29 07:45:44 -0400
commit6e533cf12de06368aee4a44b6e781c9d3c9f7eb2 (patch)
tree751e8078bd0e70d9aed2a77a883862a12438e7ef /tools
parent3082cb339fb51b156db66516a80599b958dabbf4 (diff)
perf tools: Move libpython check config into config/Makefile
Moving libpython check config into config/Makefile. Signed-off-by: Jiri Olsa <jolsa@redhat.com> Cc: Borislav Petkov <bp@alien8.de> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Sam Ravnborg <sam@ravnborg.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1369398928-9809-13-git-send-email-jolsa@redhat.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/Makefile68
-rw-r--r--tools/perf/config/Makefile63
2 files changed, 66 insertions, 65 deletions
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index f856bb5b8009..061de65569c2 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -196,8 +196,6 @@ SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH))
196# 196#
197PROGRAMS += $(OUTPUT)perf 197PROGRAMS += $(OUTPUT)perf
198 198
199LANG_BINDINGS =
200
201# what 'all' will build and 'install' will install, in perfexecdir 199# what 'all' will build and 'install' will install, in perfexecdir
202ALL_PROGRAMS = $(PROGRAMS) $(SCRIPTS) 200ALL_PROGRAMS = $(PROGRAMS) $(SCRIPTS)
203 201
@@ -535,69 +533,9 @@ ifndef NO_LIBPERL
535 LIB_OBJS += $(OUTPUT)scripts/perl/Perf-Trace-Util/Context.o 533 LIB_OBJS += $(OUTPUT)scripts/perl/Perf-Trace-Util/Context.o
536endif 534endif
537 535
538disable-python = $(eval $(disable-python_code)) 536ifndef NO_LIBPYTHON
539define disable-python_code 537 LIB_OBJS += $(OUTPUT)util/scripting-engines/trace-event-python.o
540 BASIC_CFLAGS += -DNO_LIBPYTHON 538 LIB_OBJS += $(OUTPUT)scripts/python/Perf-Trace-Util/Context.o
541 $(if $(1),$(warning No $(1) was found))
542 $(warning Python support will not be built)
543endef
544
545override PYTHON := \
546 $(call get-executable-or-default,PYTHON,python)
547
548ifndef PYTHON
549 $(call disable-python,python interpreter)
550else
551
552 PYTHON_WORD := $(call shell-wordify,$(PYTHON))
553
554 ifdef NO_LIBPYTHON
555 $(call disable-python)
556 else
557
558 override PYTHON_CONFIG := \
559 $(call get-executable-or-default,PYTHON_CONFIG,$(PYTHON)-config)
560
561 ifndef PYTHON_CONFIG
562 $(call disable-python,python-config tool)
563 else
564
565 PYTHON_CONFIG_SQ := $(call shell-sq,$(PYTHON_CONFIG))
566
567 PYTHON_EMBED_LDOPTS := $(shell $(PYTHON_CONFIG_SQ) --ldflags 2>/dev/null)
568 PYTHON_EMBED_LDFLAGS := $(call strip-libs,$(PYTHON_EMBED_LDOPTS))
569 PYTHON_EMBED_LIBADD := $(call grep-libs,$(PYTHON_EMBED_LDOPTS))
570 PYTHON_EMBED_CCOPTS := $(shell $(PYTHON_CONFIG_SQ) --cflags 2>/dev/null)
571 FLAGS_PYTHON_EMBED := $(PYTHON_EMBED_CCOPTS) $(PYTHON_EMBED_LDOPTS)
572
573 ifneq ($(call try-cc,$(SOURCE_PYTHON_EMBED),$(FLAGS_PYTHON_EMBED),python),y)
574 $(call disable-python,Python.h (for Python 2.x))
575 else
576
577 ifneq ($(call try-cc,$(SOURCE_PYTHON_VERSION),$(FLAGS_PYTHON_EMBED),python version),y)
578 $(warning Python 3 is not yet supported; please set)
579 $(warning PYTHON and/or PYTHON_CONFIG appropriately.)
580 $(warning If you also have Python 2 installed, then)
581 $(warning try something like:)
582 $(warning $(and ,))
583 $(warning $(and ,) make PYTHON=python2)
584 $(warning $(and ,))
585 $(warning Otherwise, disable Python support entirely:)
586 $(warning $(and ,))
587 $(warning $(and ,) make NO_LIBPYTHON=1)
588 $(warning $(and ,))
589 $(error $(and ,))
590 else
591 ALL_LDFLAGS += $(PYTHON_EMBED_LDFLAGS)
592 EXTLIBS += $(PYTHON_EMBED_LIBADD)
593 LIB_OBJS += $(OUTPUT)util/scripting-engines/trace-event-python.o
594 LIB_OBJS += $(OUTPUT)scripts/python/Perf-Trace-Util/Context.o
595 LANG_BINDINGS += $(OUTPUT)python/perf.so
596 endif
597
598 endif
599 endif
600 endif
601endif 539endif
602 540
603ifdef NO_DEMANGLE 541ifdef NO_DEMANGLE
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index a42c7b8e071d..b9b146538f7b 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -261,3 +261,66 @@ else
261 EXTLIBS += $(PERL_EMBED_LIBADD) 261 EXTLIBS += $(PERL_EMBED_LIBADD)
262 endif 262 endif
263endif 263endif
264
265disable-python = $(eval $(disable-python_code))
266define disable-python_code
267 BASIC_CFLAGS += -DNO_LIBPYTHON
268 $(if $(1),$(warning No $(1) was found))
269 $(warning Python support will not be built)
270 NO_LIBPYTHON := 1
271endef
272
273override PYTHON := \
274 $(call get-executable-or-default,PYTHON,python)
275
276ifndef PYTHON
277 $(call disable-python,python interpreter)
278else
279
280 PYTHON_WORD := $(call shell-wordify,$(PYTHON))
281
282 ifdef NO_LIBPYTHON
283 $(call disable-python)
284 else
285
286 override PYTHON_CONFIG := \
287 $(call get-executable-or-default,PYTHON_CONFIG,$(PYTHON)-config)
288
289 ifndef PYTHON_CONFIG
290 $(call disable-python,python-config tool)
291 else
292
293 PYTHON_CONFIG_SQ := $(call shell-sq,$(PYTHON_CONFIG))
294
295 PYTHON_EMBED_LDOPTS := $(shell $(PYTHON_CONFIG_SQ) --ldflags 2>/dev/null)
296 PYTHON_EMBED_LDFLAGS := $(call strip-libs,$(PYTHON_EMBED_LDOPTS))
297 PYTHON_EMBED_LIBADD := $(call grep-libs,$(PYTHON_EMBED_LDOPTS))
298 PYTHON_EMBED_CCOPTS := $(shell $(PYTHON_CONFIG_SQ) --cflags 2>/dev/null)
299 FLAGS_PYTHON_EMBED := $(PYTHON_EMBED_CCOPTS) $(PYTHON_EMBED_LDOPTS)
300
301 ifneq ($(call try-cc,$(SOURCE_PYTHON_EMBED),$(FLAGS_PYTHON_EMBED),python),y)
302 $(call disable-python,Python.h (for Python 2.x))
303 else
304
305 ifneq ($(call try-cc,$(SOURCE_PYTHON_VERSION),$(FLAGS_PYTHON_EMBED),python version),y)
306 $(warning Python 3 is not yet supported; please set)
307 $(warning PYTHON and/or PYTHON_CONFIG appropriately.)
308 $(warning If you also have Python 2 installed, then)
309 $(warning try something like:)
310 $(warning $(and ,))
311 $(warning $(and ,) make PYTHON=python2)
312 $(warning $(and ,))
313 $(warning Otherwise, disable Python support entirely:)
314 $(warning $(and ,))
315 $(warning $(and ,) make NO_LIBPYTHON=1)
316 $(warning $(and ,))
317 $(error $(and ,))
318 else
319 ALL_LDFLAGS += $(PYTHON_EMBED_LDFLAGS)
320 EXTLIBS += $(PYTHON_EMBED_LIBADD)
321 LANG_BINDINGS += $(OUTPUT)python/perf.so
322 endif
323 endif
324 endif
325 endif
326endif