aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@redhat.com>2013-03-24 19:45:08 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2013-05-28 09:24:07 -0400
commitcf4cca10f6905229b9269e8f0a300016010320de (patch)
treedba38792a7f9238fb97718776bdf37c4a82e2350 /tools
parent362493f0d63e25698018f6f36b2e02201342dbee (diff)
perf tools: Move libelf check config into config/Makefile
Moving libelf 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-6-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/Makefile46
-rw-r--r--tools/perf/config/Makefile47
2 files changed, 47 insertions, 46 deletions
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index aa6f93389c55..a174c687efb5 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -473,45 +473,6 @@ ifneq ($(MAKECMDGOALS),tags)
473# because maintaining the nesting to match is a pain. If 473# because maintaining the nesting to match is a pain. If
474# we had "elif" things would have been much nicer... 474# we had "elif" things would have been much nicer...
475 475
476ifdef NO_LIBELF
477 NO_DWARF := 1
478 NO_DEMANGLE := 1
479 NO_LIBUNWIND := 1
480else
481FLAGS_LIBELF=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS)
482ifneq ($(call try-cc,$(SOURCE_LIBELF),$(FLAGS_LIBELF),libelf),y)
483 FLAGS_GLIBC=$(ALL_CFLAGS) $(ALL_LDFLAGS)
484 ifeq ($(call try-cc,$(SOURCE_GLIBC),$(FLAGS_GLIBC),glibc),y)
485 LIBC_SUPPORT := 1
486 endif
487 ifeq ($(BIONIC),1)
488 LIBC_SUPPORT := 1
489 endif
490 ifeq ($(LIBC_SUPPORT),1)
491 msg := $(warning No libelf found, disables 'probe' tool, please install elfutils-libelf-devel/libelf-dev);
492
493 NO_LIBELF := 1
494 NO_DWARF := 1
495 NO_DEMANGLE := 1
496 else
497 msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]/glibc-static);
498 endif
499else
500 # for linking with debug library, run like:
501 # make DEBUG=1 LIBDW_DIR=/opt/libdw/
502 ifdef LIBDW_DIR
503 LIBDW_CFLAGS := -I$(LIBDW_DIR)/include
504 LIBDW_LDFLAGS := -L$(LIBDW_DIR)/lib
505 endif
506
507 FLAGS_DWARF=$(ALL_CFLAGS) $(LIBDW_CFLAGS) -ldw -lelf $(LIBDW_LDFLAGS) $(ALL_LDFLAGS) $(EXTLIBS)
508 ifneq ($(call try-cc,$(SOURCE_DWARF),$(FLAGS_DWARF),libdw),y)
509 msg := $(warning No libdw.h found or old libdw.h found or elfutils is older than 0.138, disables dwarf support. Please install new elfutils-devel/libdw-dev);
510 NO_DWARF := 1
511 endif # Dwarf support
512endif # SOURCE_LIBELF
513endif # NO_LIBELF
514
515# There's only x86 (both 32 and 64) support for CFI unwind so far 476# There's only x86 (both 32 and 64) support for CFI unwind so far
516ifneq ($(ARCH),x86) 477ifneq ($(ARCH),x86)
517 NO_LIBUNWIND := 1 478 NO_LIBUNWIND := 1
@@ -553,13 +514,6 @@ BUILTIN_OBJS := $(filter-out $(OUTPUT)builtin-probe.o,$(BUILTIN_OBJS))
553LIB_OBJS += $(OUTPUT)util/symbol-minimal.o 514LIB_OBJS += $(OUTPUT)util/symbol-minimal.o
554 515
555else # NO_LIBELF 516else # NO_LIBELF
556BASIC_CFLAGS += -DLIBELF_SUPPORT
557
558FLAGS_LIBELF=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS)
559ifeq ($(call try-cc,$(SOURCE_ELF_MMAP),$(FLAGS_LIBELF),-DLIBELF_MMAP),y)
560 BASIC_CFLAGS += -DLIBELF_MMAP
561endif
562
563ifndef NO_DWARF 517ifndef NO_DWARF
564ifeq ($(origin PERF_HAVE_DWARF_REGS), undefined) 518ifeq ($(origin PERF_HAVE_DWARF_REGS), undefined)
565 msg := $(warning DWARF register mappings have not been defined for architecture $(ARCH), DWARF support disabled); 519 msg := $(warning DWARF register mappings have not been defined for architecture $(ARCH), DWARF support disabled);
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 8acbcfec93f1..17614b16c7d0 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -108,3 +108,50 @@ ifeq ($(call try-cc,$(SOURCE_BIONIC),$(CFLAGS),bionic),y)
108 EXTLIBS := $(filter-out -lpthread,$(EXTLIBS)) 108 EXTLIBS := $(filter-out -lpthread,$(EXTLIBS))
109 BASIC_CFLAGS += -I. 109 BASIC_CFLAGS += -I.
110endif 110endif
111
112ifdef NO_LIBELF
113 NO_DWARF := 1
114 NO_DEMANGLE := 1
115 NO_LIBUNWIND := 1
116else
117FLAGS_LIBELF=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS)
118ifneq ($(call try-cc,$(SOURCE_LIBELF),$(FLAGS_LIBELF),libelf),y)
119 FLAGS_GLIBC=$(ALL_CFLAGS) $(ALL_LDFLAGS)
120 ifeq ($(call try-cc,$(SOURCE_GLIBC),$(FLAGS_GLIBC),glibc),y)
121 LIBC_SUPPORT := 1
122 endif
123 ifeq ($(BIONIC),1)
124 LIBC_SUPPORT := 1
125 endif
126 ifeq ($(LIBC_SUPPORT),1)
127 msg := $(warning No libelf found, disables 'probe' tool, please install elfutils-libelf-devel/libelf-dev);
128
129 NO_LIBELF := 1
130 NO_DWARF := 1
131 NO_DEMANGLE := 1
132 else
133 msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]/glibc-static);
134 endif
135else
136 # for linking with debug library, run like:
137 # make DEBUG=1 LIBDW_DIR=/opt/libdw/
138 ifdef LIBDW_DIR
139 LIBDW_CFLAGS := -I$(LIBDW_DIR)/include
140 LIBDW_LDFLAGS := -L$(LIBDW_DIR)/lib
141 endif
142
143 FLAGS_DWARF=$(ALL_CFLAGS) $(LIBDW_CFLAGS) -ldw -lelf $(LIBDW_LDFLAGS) $(ALL_LDFLAGS) $(EXTLIBS)
144 ifneq ($(call try-cc,$(SOURCE_DWARF),$(FLAGS_DWARF),libdw),y)
145 msg := $(warning No libdw.h found or old libdw.h found or elfutils is older than 0.138, disables dwarf support. Please install new elfutils-devel/libdw-dev);
146 NO_DWARF := 1
147 endif # Dwarf support
148endif # SOURCE_LIBELF
149endif # NO_LIBELF
150
151ifndef NO_LIBELF
152BASIC_CFLAGS += -DLIBELF_SUPPORT
153FLAGS_LIBELF=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS)
154ifeq ($(call try-cc,$(SOURCE_ELF_MMAP),$(FLAGS_LIBELF),-DLIBELF_MMAP),y)
155 BASIC_CFLAGS += -DLIBELF_MMAP
156endif
157endif # NO_LIBELF