From a71123977eb3c72dd5a8bac723b13faf9cdd2828 Mon Sep 17 00:00:00 2001 From: Robert Morell Date: Tue, 16 Nov 2010 14:16:33 -0800 Subject: perf tools: Remove hardcoded include paths for elfutils This change removes the use of hardcoded absolute "/usr/include/elfutils" paths from the perf build. The problem with hardcoded paths is that it prevents them from being overridden by $prefix or by -I in CFLAGS (e.g., for cross-compiling purposes). Instead, just include the "elfutils/" subdirectory as a relative path when files are needed from that directory. Tested by building perf: - Cross-compiled for ARM on x86_64 - Built natively on x86_64 - Built on x86_64 with /usr/include/elfutils moved to another location and manually included in CFLAGS Acked-by: Masami Hiramatsu Cc: Peter Zijlstra Cc: Paul Mackerras Cc: Ingo Molnar Cc: Masami Hiramatsu LKML-Reference: <1289945793-31441-1-git-send-email-rmorell@nvidia.com> Signed-off-by: Robert Morell Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools/perf/Makefile') diff --git a/tools/perf/Makefile b/tools/perf/Makefile index d1db0f676a4b..74b684da8f13 100644 --- a/tools/perf/Makefile +++ b/tools/perf/Makefile @@ -507,7 +507,7 @@ PERFLIBS = $(LIB_FILE) -include config.mak ifndef NO_DWARF -FLAGS_DWARF=$(ALL_CFLAGS) -I/usr/include/elfutils -ldw -lelf $(ALL_LDFLAGS) $(EXTLIBS) +FLAGS_DWARF=$(ALL_CFLAGS) -ldw -lelf $(ALL_LDFLAGS) $(EXTLIBS) ifneq ($(call try-cc,$(SOURCE_DWARF),$(FLAGS_DWARF)),y) 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); NO_DWARF := 1 @@ -554,7 +554,7 @@ ifndef NO_DWARF ifeq ($(origin PERF_HAVE_DWARF_REGS), undefined) msg := $(warning DWARF register mappings have not been defined for architecture $(ARCH), DWARF support disabled); else - BASIC_CFLAGS += -I/usr/include/elfutils -DDWARF_SUPPORT + BASIC_CFLAGS += -DDWARF_SUPPORT EXTLIBS += -lelf -ldw LIB_OBJS += $(OUTPUT)util/probe-finder.o endif # PERF_HAVE_DWARF_REGS -- cgit v1.2.3-59-g8ed1b