diff options
author | Jiri Olsa <jolsa@redhat.com> | 2012-11-03 14:27:57 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-11-08 14:01:37 -0500 |
commit | 1fa0bc3f8d4f9bbcde5b1f962b006906cc80b2dc (patch) | |
tree | 6f1b2fb4ee89039484198ed6591ffd517356bec4 /tools | |
parent | d4fcf0a8b96b23a245a21065c9424e09c8080819 (diff) |
perf tools: Add LIBDW_DIR Makefile variable to for alternate libdw
Adding LIBDW_DIR Makefile variable to be able to specify
alternate libdw library location.
To use it run make like:
$ make LIBDW_DIR=/opt/libdw/
Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/n/tip-n2uv8c9ti6b26fioaw2rq5yv@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/Makefile | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tools/perf/Makefile b/tools/perf/Makefile index 4ffcd02404f8..cca5bb8334ad 100644 --- a/tools/perf/Makefile +++ b/tools/perf/Makefile | |||
@@ -501,7 +501,14 @@ ifneq ($(call try-cc,$(SOURCE_LIBELF),$(FLAGS_LIBELF),libelf),y) | |||
501 | msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]/glibc-static); | 501 | msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]/glibc-static); |
502 | endif | 502 | endif |
503 | else | 503 | else |
504 | FLAGS_DWARF=$(ALL_CFLAGS) -ldw -lelf $(ALL_LDFLAGS) $(EXTLIBS) | 504 | # for linking with debug library, run like: |
505 | # make DEBUG=1 LIBDW_DIR=/opt/libdw/ | ||
506 | ifdef LIBDW_DIR | ||
507 | LIBDW_CFLAGS := -I$(LIBDW_DIR)/include | ||
508 | LIBDW_LDFLAGS := -L$(LIBDW_DIR)/lib | ||
509 | endif | ||
510 | |||
511 | FLAGS_DWARF=$(ALL_CFLAGS) $(LIBDW_CFLAGS) -ldw -lelf $(LIBDW_LDFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) | ||
505 | ifneq ($(call try-cc,$(SOURCE_DWARF),$(FLAGS_DWARF),libdw),y) | 512 | ifneq ($(call try-cc,$(SOURCE_DWARF),$(FLAGS_DWARF),libdw),y) |
506 | 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); | 513 | 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); |
507 | NO_DWARF := 1 | 514 | NO_DWARF := 1 |
@@ -556,7 +563,8 @@ ifndef NO_DWARF | |||
556 | ifeq ($(origin PERF_HAVE_DWARF_REGS), undefined) | 563 | ifeq ($(origin PERF_HAVE_DWARF_REGS), undefined) |
557 | msg := $(warning DWARF register mappings have not been defined for architecture $(ARCH), DWARF support disabled); | 564 | msg := $(warning DWARF register mappings have not been defined for architecture $(ARCH), DWARF support disabled); |
558 | else | 565 | else |
559 | BASIC_CFLAGS += -DDWARF_SUPPORT | 566 | BASIC_CFLAGS := -DDWARF_SUPPORT $(LIBDW_CFLAGS) $(BASIC_CFLAGS) |
567 | BASIC_LDFLAGS := $(LIBDW_LDFLAGS) $(BASIC_LDFLAGS) | ||
560 | EXTLIBS += -lelf -ldw | 568 | EXTLIBS += -lelf -ldw |
561 | LIB_OBJS += $(OUTPUT)util/probe-finder.o | 569 | LIB_OBJS += $(OUTPUT)util/probe-finder.o |
562 | LIB_OBJS += $(OUTPUT)util/dwarf-aux.o | 570 | LIB_OBJS += $(OUTPUT)util/dwarf-aux.o |