diff options
author | Jin Yao <yao.jin@linux.intel.com> | 2018-03-30 05:27:12 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-04-02 12:50:17 -0400 |
commit | 8e2c241f0c9768c589319ff48d007526465374d2 (patch) | |
tree | 95e27d901a1effaa2f65a9cda52a1eb11e0f5c53 | |
parent | 6b416ebcc32c5753214d53c18ac5719c93bc340e (diff) |
perf config: Add some new -DHAVE_XXX to CFLAGS
For most of libraries, in perf.config, they are recorded with -DHAVE_XXX in
CFLAGS according to if the libraries are compiled-in. Then C code then will
know if the library is compiled-in or not.
While for glibc, no -DHAVE_GLIBC_SUPPORT exists.
For python and perl libraries, only -DNO_PYTHON and -DNO_LIBPERL exist.
To make the code more consistent, the patch creates -DHAVE_LIBPYTHON_SUPPORT
and -DHAVE_LIBPERL_SUPPORT if the python and perl libraries are compiled-in.
Since the existing flags -DNO_PYTHON and -DNO_LIBPERL are being used in many
places in C code, this patch doesn't remove them. In a follow-up patch, we will
recontruct the C code and then use HAVE_XXX instead.
v3:
Move 'CFLAGS += -DHAVE_LIBPYTHON_SUPPORT' and 'CFLAGS +=
-DHAVE_LIBPERL_SUPPORT' to other places to avoid duplicated feature checking.
v2:
Create -DHAVE_GLIBC_SUPPORT, -DHAVE_LIBPYTHON_SUPPORT and
-DHAVE_LIBPERL_SUPPORT.
Signed-off-by: Jin Yao <yao.jin@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Jin Yao <yao.jin@intel.com>
Cc: Kan Liang <kan.liang@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1522402036-22915-3-git-send-email-yao.jin@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/perf/Makefile.config | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index 98ff73648b51..deb8fba2f4f1 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config | |||
@@ -352,6 +352,10 @@ else | |||
352 | endif # libelf support | 352 | endif # libelf support |
353 | endif # NO_LIBELF | 353 | endif # NO_LIBELF |
354 | 354 | ||
355 | ifeq ($(feature-glibc), 1) | ||
356 | CFLAGS += -DHAVE_GLIBC_SUPPORT | ||
357 | endif | ||
358 | |||
355 | ifdef NO_DWARF | 359 | ifdef NO_DWARF |
356 | NO_LIBDW_DWARF_UNWIND := 1 | 360 | NO_LIBDW_DWARF_UNWIND := 1 |
357 | endif | 361 | endif |
@@ -635,6 +639,7 @@ else | |||
635 | else | 639 | else |
636 | LDFLAGS += $(PERL_EMBED_LDFLAGS) | 640 | LDFLAGS += $(PERL_EMBED_LDFLAGS) |
637 | EXTLIBS += $(PERL_EMBED_LIBADD) | 641 | EXTLIBS += $(PERL_EMBED_LIBADD) |
642 | CFLAGS += -DHAVE_LIBPERL_SUPPORT | ||
638 | $(call detected,CONFIG_LIBPERL) | 643 | $(call detected,CONFIG_LIBPERL) |
639 | endif | 644 | endif |
640 | endif | 645 | endif |
@@ -671,6 +676,7 @@ else | |||
671 | LDFLAGS += $(PYTHON_EMBED_LDFLAGS) | 676 | LDFLAGS += $(PYTHON_EMBED_LDFLAGS) |
672 | EXTLIBS += $(PYTHON_EMBED_LIBADD) | 677 | EXTLIBS += $(PYTHON_EMBED_LIBADD) |
673 | LANG_BINDINGS += $(obj-perf)python/perf.so | 678 | LANG_BINDINGS += $(obj-perf)python/perf.so |
679 | CFLAGS += -DHAVE_LIBPYTHON_SUPPORT | ||
674 | $(call detected,CONFIG_LIBPYTHON) | 680 | $(call detected,CONFIG_LIBPYTHON) |
675 | endif | 681 | endif |
676 | endif | 682 | endif |