diff options
| author | Jiri Olsa <jolsa@redhat.com> | 2013-03-17 19:35:32 -0400 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-05-29 07:45:44 -0400 |
| commit | 6e533cf12de06368aee4a44b6e781c9d3c9f7eb2 (patch) | |
| tree | 751e8078bd0e70d9aed2a77a883862a12438e7ef /tools/perf/Makefile | |
| parent | 3082cb339fb51b156db66516a80599b958dabbf4 (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/perf/Makefile')
| -rw-r--r-- | tools/perf/Makefile | 68 |
1 files changed, 3 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 | # |
| 197 | PROGRAMS += $(OUTPUT)perf | 197 | PROGRAMS += $(OUTPUT)perf |
| 198 | 198 | ||
| 199 | LANG_BINDINGS = | ||
| 200 | |||
| 201 | # what 'all' will build and 'install' will install, in perfexecdir | 199 | # what 'all' will build and 'install' will install, in perfexecdir |
| 202 | ALL_PROGRAMS = $(PROGRAMS) $(SCRIPTS) | 200 | ALL_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 |
| 536 | endif | 534 | endif |
| 537 | 535 | ||
| 538 | disable-python = $(eval $(disable-python_code)) | 536 | ifndef NO_LIBPYTHON |
| 539 | define 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) | ||
| 543 | endef | ||
| 544 | |||
| 545 | override PYTHON := \ | ||
| 546 | $(call get-executable-or-default,PYTHON,python) | ||
| 547 | |||
| 548 | ifndef PYTHON | ||
| 549 | $(call disable-python,python interpreter) | ||
| 550 | else | ||
| 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 | ||
| 601 | endif | 539 | endif |
| 602 | 540 | ||
| 603 | ifdef NO_DEMANGLE | 541 | ifdef NO_DEMANGLE |
