aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/Makefile')
-rw-r--r--tools/perf/Makefile15
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 46a58a81c9ad..3dbb5c5bb8c6 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -337,6 +337,7 @@ LIB_FILE=libperf.a
337LIB_H += ../../include/linux/perf_event.h 337LIB_H += ../../include/linux/perf_event.h
338LIB_H += ../../include/linux/rbtree.h 338LIB_H += ../../include/linux/rbtree.h
339LIB_H += ../../include/linux/list.h 339LIB_H += ../../include/linux/list.h
340LIB_H += ../../include/linux/stringify.h
340LIB_H += util/include/linux/bitmap.h 341LIB_H += util/include/linux/bitmap.h
341LIB_H += util/include/linux/bitops.h 342LIB_H += util/include/linux/bitops.h
342LIB_H += util/include/linux/compiler.h 343LIB_H += util/include/linux/compiler.h
@@ -438,6 +439,7 @@ BUILTIN_OBJS += builtin-stat.o
438BUILTIN_OBJS += builtin-timechart.o 439BUILTIN_OBJS += builtin-timechart.o
439BUILTIN_OBJS += builtin-top.o 440BUILTIN_OBJS += builtin-top.o
440BUILTIN_OBJS += builtin-trace.o 441BUILTIN_OBJS += builtin-trace.o
442BUILTIN_OBJS += builtin-probe.o
441 443
442PERFLIBS = $(LIB_FILE) 444PERFLIBS = $(LIB_FILE)
443 445
@@ -469,6 +471,10 @@ ifeq ($(uname_S),Darwin)
469endif 471endif
470 472
471ifeq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) > /dev/null 2>&1 && echo y"), y) 473ifeq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) > /dev/null 2>&1 && echo y"), y)
474ifneq ($(shell sh -c "(echo '\#include <gnu/libc-version.h>'; echo 'int main(void) { const char * version = gnu_get_libc_version(); return (long)version; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) > /dev/null 2>&1 && echo y"), y)
475 msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]);
476endif
477
472 ifneq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ_MMAP, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) > /dev/null 2>&1 && echo y"), y) 478 ifneq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ_MMAP, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) > /dev/null 2>&1 && echo y"), y)
473 BASIC_CFLAGS += -DLIBELF_NO_MMAP 479 BASIC_CFLAGS += -DLIBELF_NO_MMAP
474 endif 480 endif
@@ -476,6 +482,15 @@ else
476 msg := $(error No libelf.h/libelf found, please install libelf-dev/elfutils-libelf-devel and glibc-dev[el]); 482 msg := $(error No libelf.h/libelf found, please install libelf-dev/elfutils-libelf-devel and glibc-dev[el]);
477endif 483endif
478 484
485ifneq ($(shell sh -c "(echo '\#include <libdwarf/dwarf.h>'; echo '\#include <libdwarf/libdwarf.h>'; echo 'int main(void) { Dwarf_Debug dbg; Dwarf_Error err; Dwarf_Ranges *rng; dwarf_init(0, DW_DLC_READ, 0, 0, &dbg, &err); dwarf_get_ranges(dbg, 0, &rng, 0, 0, &err); return (long)dbg; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -ldwarf -lelf -o /dev/null $(ALL_LDFLAGS) > /dev/null 2>&1 && echo y"), y)
486 msg := $(warning No libdwarf.h found or old libdwarf.h found, disables dwarf support. Please install libdwarf-dev/libdwarf-devel >= 20081231);
487 BASIC_CFLAGS += -DNO_LIBDWARF
488else
489 EXTLIBS += -lelf -ldwarf
490 LIB_H += util/probe-finder.h
491 LIB_OBJS += util/probe-finder.o
492endif
493
479ifdef NO_DEMANGLE 494ifdef NO_DEMANGLE
480 BASIC_CFLAGS += -DNO_DEMANGLE 495 BASIC_CFLAGS += -DNO_DEMANGLE
481else 496else