diff options
author | Namhyung Kim <namhyung@kernel.org> | 2014-07-29 02:57:19 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2014-08-12 11:03:04 -0400 |
commit | 56c7d79e49776084b852e451bda5f59dc3bcf894 (patch) | |
tree | c9ee860136de4700bb3f47457b77477d99ce4550 /tools/perf/config | |
parent | 64c40908938953d7afa90e9363327875286349e5 (diff) |
perf tools: Fix make PYTHON override
Thomas reported that make PYTHON=python2 is not work on some systems. I
can reproduce it on my ArchLinux box too.
This is because it's overridden by config/feature-checks/Makefile
regardless of PYTHON setting. I guess it's a bug slipped into during
the feature checking change.
Actually, we don't need to check python-config in the feature-checks.
We can just pass appropriate FEATURE_CHECK_*FLAGS.
Reported-by: Thomas Ilsche <thomas.ilsche@tu-dresden.de>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Tested-by: Thomas Ilsche <thomas.ilsche@tu-dresden.de>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung.kim@lge.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Thomas Ilsche <thomas.ilsche@tu-dresden.de>
Link: http://lkml.kernel.org/r/1406617040-26909-1-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/config')
-rw-r--r-- | tools/perf/config/Makefile | 34 | ||||
-rw-r--r-- | tools/perf/config/feature-checks/Makefile | 18 |
2 files changed, 24 insertions, 28 deletions
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile index 1f67aa02d240..e05d8f99424d 100644 --- a/tools/perf/config/Makefile +++ b/tools/perf/config/Makefile | |||
@@ -120,6 +120,23 @@ ifdef PARSER_DEBUG | |||
120 | CFLAGS += -DPARSER_DEBUG | 120 | CFLAGS += -DPARSER_DEBUG |
121 | endif | 121 | endif |
122 | 122 | ||
123 | ifndef NO_LIBPYTHON | ||
124 | override PYTHON := \ | ||
125 | $(call get-executable-or-default,PYTHON,python) | ||
126 | override PYTHON_CONFIG := \ | ||
127 | $(call get-executable-or-default,PYTHON_CONFIG,$(PYTHON)-config) | ||
128 | |||
129 | PYTHON_CONFIG_SQ := $(call shell-sq,$(PYTHON_CONFIG)) | ||
130 | |||
131 | PYTHON_EMBED_LDOPTS := $(shell $(PYTHON_CONFIG_SQ) --ldflags 2>/dev/null) | ||
132 | PYTHON_EMBED_CCOPTS := $(shell $(PYTHON_CONFIG_SQ) --cflags 2>/dev/null) | ||
133 | |||
134 | FEATURE_CHECK_CFLAGS-libpython := $(PYTHON_EMBED_CCOPTS) | ||
135 | FEATURE_CHECK_LDFLAGS-libpython := $(PYTHON_EMBED_LDOPTS) | ||
136 | FEATURE_CHECK_CFLAGS-libpython-version := $(PYTHON_EMBED_CCOPTS) | ||
137 | FEATURE_CHECK_LDFLAGS-libpython-version := $(PYTHON_EMBED_LDOPTS) | ||
138 | endif | ||
139 | |||
123 | CFLAGS += -fno-omit-frame-pointer | 140 | CFLAGS += -fno-omit-frame-pointer |
124 | CFLAGS += -ggdb3 | 141 | CFLAGS += -ggdb3 |
125 | CFLAGS += -funwind-tables | 142 | CFLAGS += -funwind-tables |
@@ -482,21 +499,14 @@ define disable-python_code | |||
482 | NO_LIBPYTHON := 1 | 499 | NO_LIBPYTHON := 1 |
483 | endef | 500 | endef |
484 | 501 | ||
485 | override PYTHON := \ | 502 | ifdef NO_LIBPYTHON |
486 | $(call get-executable-or-default,PYTHON,python) | 503 | $(call disable-python) |
487 | |||
488 | ifndef PYTHON | ||
489 | $(call disable-python,python interpreter) | ||
490 | else | 504 | else |
491 | 505 | ||
492 | PYTHON_WORD := $(call shell-wordify,$(PYTHON)) | 506 | ifndef PYTHON |
493 | 507 | $(call disable-python,python interpreter) | |
494 | ifdef NO_LIBPYTHON | ||
495 | $(call disable-python) | ||
496 | else | 508 | else |
497 | 509 | PYTHON_WORD := $(call shell-wordify,$(PYTHON)) | |
498 | override PYTHON_CONFIG := \ | ||
499 | $(call get-executable-or-default,PYTHON_CONFIG,$(PYTHON)-config) | ||
500 | 510 | ||
501 | ifndef PYTHON_CONFIG | 511 | ifndef PYTHON_CONFIG |
502 | $(call disable-python,python-config tool) | 512 | $(call disable-python,python-config tool) |
diff --git a/tools/perf/config/feature-checks/Makefile b/tools/perf/config/feature-checks/Makefile index 6088f8d8a434..72ab2984718e 100644 --- a/tools/perf/config/feature-checks/Makefile +++ b/tools/perf/config/feature-checks/Makefile | |||
@@ -101,25 +101,11 @@ FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS) | |||
101 | test-libperl.bin: | 101 | test-libperl.bin: |
102 | $(BUILD) $(FLAGS_PERL_EMBED) | 102 | $(BUILD) $(FLAGS_PERL_EMBED) |
103 | 103 | ||
104 | override PYTHON := python | ||
105 | override PYTHON_CONFIG := python-config | ||
106 | |||
107 | escape-for-shell-sq = $(subst ','\'',$(1)) | ||
108 | shell-sq = '$(escape-for-shell-sq)' | ||
109 | |||
110 | PYTHON_CONFIG_SQ = $(call shell-sq,$(PYTHON_CONFIG)) | ||
111 | |||
112 | PYTHON_EMBED_LDOPTS = $(shell $(PYTHON_CONFIG_SQ) --ldflags 2>/dev/null) | ||
113 | PYTHON_EMBED_LDFLAGS = $(call strip-libs,$(PYTHON_EMBED_LDOPTS)) | ||
114 | PYTHON_EMBED_LIBADD = $(call grep-libs,$(PYTHON_EMBED_LDOPTS)) | ||
115 | PYTHON_EMBED_CCOPTS = $(shell $(PYTHON_CONFIG_SQ) --cflags 2>/dev/null) | ||
116 | FLAGS_PYTHON_EMBED = $(PYTHON_EMBED_CCOPTS) $(PYTHON_EMBED_LDOPTS) | ||
117 | |||
118 | test-libpython.bin: | 104 | test-libpython.bin: |
119 | $(BUILD) $(FLAGS_PYTHON_EMBED) | 105 | $(BUILD) |
120 | 106 | ||
121 | test-libpython-version.bin: | 107 | test-libpython-version.bin: |
122 | $(BUILD) $(FLAGS_PYTHON_EMBED) | 108 | $(BUILD) |
123 | 109 | ||
124 | test-libbfd.bin: | 110 | test-libbfd.bin: |
125 | $(BUILD) -DPACKAGE='"perf"' -lbfd -lz -liberty -ldl | 111 | $(BUILD) -DPACKAGE='"perf"' -lbfd -lz -liberty -ldl |