Commit 8e1b3f68 authored by Jiri Olsa's avatar Jiri Olsa Committed by Arnaldo Carvalho de Melo

perf tools: Replace tabs with spaces for all non-commands statements

Replacing tabs with spaces for all non-commands statements
in 'Makefile' and 'config/Makefile' files.
Suggested-by: default avatarSam Ravnborg <sam@ravnborg.org>
Signed-off-by: default avatarJiri 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-23-git-send-email-jolsa@redhat.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 4e22db46
...@@ -124,14 +124,14 @@ strip-libs = $(filter-out -l%,$(1)) ...@@ -124,14 +124,14 @@ strip-libs = $(filter-out -l%,$(1))
LK_PATH=$(LK_DIR) LK_PATH=$(LK_DIR)
ifneq ($(OUTPUT),) ifneq ($(OUTPUT),)
TE_PATH=$(OUTPUT) TE_PATH=$(OUTPUT)
ifneq ($(subdir),) ifneq ($(subdir),)
LK_PATH=$(OUTPUT)$(LK_DIR) LK_PATH=$(OUTPUT)$(LK_DIR)
else else
LK_PATH=$(OUTPUT) LK_PATH=$(OUTPUT)
endif endif
else else
TE_PATH=$(TRACE_EVENT_DIR) TE_PATH=$(TRACE_EVENT_DIR)
endif endif
LIBTRACEEVENT = $(TE_PATH)libtraceevent.a LIBTRACEEVENT = $(TE_PATH)libtraceevent.a
...@@ -175,10 +175,10 @@ OTHER_PROGRAMS = $(OUTPUT)perf ...@@ -175,10 +175,10 @@ OTHER_PROGRAMS = $(OUTPUT)perf
# Set paths to tools early so that they can be used for version tests. # Set paths to tools early so that they can be used for version tests.
ifndef SHELL_PATH ifndef SHELL_PATH
SHELL_PATH = /bin/sh SHELL_PATH = /bin/sh
endif endif
ifndef PERL_PATH ifndef PERL_PATH
PERL_PATH = /usr/bin/perl PERL_PATH = /usr/bin/perl
endif endif
export PERL_PATH export PERL_PATH
...@@ -433,7 +433,7 @@ PERFLIBS = $(LIB_FILE) $(LIBLK) $(LIBTRACEEVENT) ...@@ -433,7 +433,7 @@ PERFLIBS = $(LIB_FILE) $(LIBLK) $(LIBTRACEEVENT)
-include arch/$(ARCH)/Makefile -include arch/$(ARCH)/Makefile
ifneq ($(OUTPUT),) ifneq ($(OUTPUT),)
CFLAGS += -I$(OUTPUT) CFLAGS += -I$(OUTPUT)
endif endif
ifdef NO_LIBELF ifdef NO_LIBELF
...@@ -452,67 +452,67 @@ LIB_OBJS += $(OUTPUT)util/symbol-minimal.o ...@@ -452,67 +452,67 @@ LIB_OBJS += $(OUTPUT)util/symbol-minimal.o
else # NO_LIBELF else # NO_LIBELF
ifndef NO_DWARF ifndef NO_DWARF
LIB_OBJS += $(OUTPUT)util/probe-finder.o LIB_OBJS += $(OUTPUT)util/probe-finder.o
LIB_OBJS += $(OUTPUT)util/dwarf-aux.o LIB_OBJS += $(OUTPUT)util/dwarf-aux.o
endif # NO_DWARF endif # NO_DWARF
endif # NO_LIBELF endif # NO_LIBELF
ifndef NO_LIBUNWIND ifndef NO_LIBUNWIND
LIB_OBJS += $(OUTPUT)util/unwind.o LIB_OBJS += $(OUTPUT)util/unwind.o
endif endif
ifndef NO_LIBAUDIT ifndef NO_LIBAUDIT
BUILTIN_OBJS += $(OUTPUT)builtin-trace.o BUILTIN_OBJS += $(OUTPUT)builtin-trace.o
endif endif
ifndef NO_SLANG ifndef NO_SLANG
LIB_OBJS += $(OUTPUT)ui/browser.o LIB_OBJS += $(OUTPUT)ui/browser.o
LIB_OBJS += $(OUTPUT)ui/browsers/annotate.o LIB_OBJS += $(OUTPUT)ui/browsers/annotate.o
LIB_OBJS += $(OUTPUT)ui/browsers/hists.o LIB_OBJS += $(OUTPUT)ui/browsers/hists.o
LIB_OBJS += $(OUTPUT)ui/browsers/map.o LIB_OBJS += $(OUTPUT)ui/browsers/map.o
LIB_OBJS += $(OUTPUT)ui/browsers/scripts.o LIB_OBJS += $(OUTPUT)ui/browsers/scripts.o
LIB_OBJS += $(OUTPUT)ui/tui/setup.o LIB_OBJS += $(OUTPUT)ui/tui/setup.o
LIB_OBJS += $(OUTPUT)ui/tui/util.o LIB_OBJS += $(OUTPUT)ui/tui/util.o
LIB_OBJS += $(OUTPUT)ui/tui/helpline.o LIB_OBJS += $(OUTPUT)ui/tui/helpline.o
LIB_OBJS += $(OUTPUT)ui/tui/progress.o LIB_OBJS += $(OUTPUT)ui/tui/progress.o
LIB_H += ui/browser.h LIB_H += ui/browser.h
LIB_H += ui/browsers/map.h LIB_H += ui/browsers/map.h
LIB_H += ui/keysyms.h LIB_H += ui/keysyms.h
LIB_H += ui/libslang.h LIB_H += ui/libslang.h
endif endif
ifndef NO_GTK2 ifndef NO_GTK2
LIB_OBJS += $(OUTPUT)ui/gtk/browser.o LIB_OBJS += $(OUTPUT)ui/gtk/browser.o
LIB_OBJS += $(OUTPUT)ui/gtk/hists.o LIB_OBJS += $(OUTPUT)ui/gtk/hists.o
LIB_OBJS += $(OUTPUT)ui/gtk/setup.o LIB_OBJS += $(OUTPUT)ui/gtk/setup.o
LIB_OBJS += $(OUTPUT)ui/gtk/util.o LIB_OBJS += $(OUTPUT)ui/gtk/util.o
LIB_OBJS += $(OUTPUT)ui/gtk/helpline.o LIB_OBJS += $(OUTPUT)ui/gtk/helpline.o
LIB_OBJS += $(OUTPUT)ui/gtk/progress.o LIB_OBJS += $(OUTPUT)ui/gtk/progress.o
LIB_OBJS += $(OUTPUT)ui/gtk/annotate.o LIB_OBJS += $(OUTPUT)ui/gtk/annotate.o
endif endif
ifndef NO_LIBPERL ifndef NO_LIBPERL
LIB_OBJS += $(OUTPUT)util/scripting-engines/trace-event-perl.o LIB_OBJS += $(OUTPUT)util/scripting-engines/trace-event-perl.o
LIB_OBJS += $(OUTPUT)scripts/perl/Perf-Trace-Util/Context.o LIB_OBJS += $(OUTPUT)scripts/perl/Perf-Trace-Util/Context.o
endif endif
ifndef NO_LIBPYTHON ifndef NO_LIBPYTHON
LIB_OBJS += $(OUTPUT)util/scripting-engines/trace-event-python.o LIB_OBJS += $(OUTPUT)util/scripting-engines/trace-event-python.o
LIB_OBJS += $(OUTPUT)scripts/python/Perf-Trace-Util/Context.o LIB_OBJS += $(OUTPUT)scripts/python/Perf-Trace-Util/Context.o
endif endif
ifeq ($(NO_PERF_REGS),0) ifeq ($(NO_PERF_REGS),0)
ifeq ($(ARCH),x86) ifeq ($(ARCH),x86)
LIB_H += arch/x86/include/perf_regs.h LIB_H += arch/x86/include/perf_regs.h
endif endif
endif endif
ifndef NO_LIBNUMA ifndef NO_LIBNUMA
BUILTIN_OBJS += $(OUTPUT)bench/numa.o BUILTIN_OBJS += $(OUTPUT)bench/numa.o
endif endif
ifdef ASCIIDOC8 ifdef ASCIIDOC8
export ASCIIDOC8 export ASCIIDOC8
endif endif
LIBS = -Wl,--whole-archive $(PERFLIBS) -Wl,--no-whole-archive -Wl,--start-group $(EXTLIBS) -Wl,--end-group LIBS = -Wl,--whole-archive $(PERFLIBS) -Wl,--no-whole-archive -Wl,--start-group $(EXTLIBS) -Wl,--end-group
......
uname_M := $(shell uname -m 2>/dev/null || echo not) uname_M := $(shell uname -m 2>/dev/null || echo not)
ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \ ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
-e s/arm.*/arm/ -e s/sa110/arm/ \ -e s/arm.*/arm/ -e s/sa110/arm/ \
-e s/s390x/s390/ -e s/parisc64/parisc/ \ -e s/s390x/s390/ -e s/parisc64/parisc/ \
-e s/ppc.*/powerpc/ -e s/mips.*/mips/ \ -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
-e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ ) -e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ )
NO_PERF_REGS := 1 NO_PERF_REGS := 1
CFLAGS := $(EXTRA_CFLAGS) $(EXTRA_WARNINGS) CFLAGS := $(EXTRA_CFLAGS) $(EXTRA_WARNINGS)
# Additional ARCH settings for x86 # Additional ARCH settings for x86
ifeq ($(ARCH),i386) ifeq ($(ARCH),i386)
override ARCH := x86 override ARCH := x86
NO_PERF_REGS := 0 NO_PERF_REGS := 0
LIBUNWIND_LIBS = -lunwind -lunwind-x86 LIBUNWIND_LIBS = -lunwind -lunwind-x86
endif endif
ifeq ($(ARCH),x86_64) ifeq ($(ARCH),x86_64)
override ARCH := x86 override ARCH := x86
IS_X86_64 := 0 IS_X86_64 := 0
ifeq (, $(findstring m32,$(CFLAGS))) ifeq (, $(findstring m32,$(CFLAGS)))
IS_X86_64 := $(shell echo __x86_64__ | ${CC} -E -x c - | tail -n 1) IS_X86_64 := $(shell echo __x86_64__ | ${CC} -E -x c - | tail -n 1)
endif endif
ifeq (${IS_X86_64}, 1) ifeq (${IS_X86_64}, 1)
RAW_ARCH := x86_64 RAW_ARCH := x86_64
CFLAGS += -DARCH_X86_64 CFLAGS += -DARCH_X86_64
ARCH_INCLUDE = ../../arch/x86/lib/memcpy_64.S ../../arch/x86/lib/memset_64.S ARCH_INCLUDE = ../../arch/x86/lib/memcpy_64.S ../../arch/x86/lib/memset_64.S
endif endif
NO_PERF_REGS := 0 NO_PERF_REGS := 0
LIBUNWIND_LIBS = -lunwind -lunwind-x86_64 LIBUNWIND_LIBS = -lunwind -lunwind-x86_64
endif endif
ifeq ($(NO_PERF_REGS),0) ifeq ($(NO_PERF_REGS),0)
CFLAGS += -DHAVE_PERF_REGS CFLAGS += -DHAVE_PERF_REGS
endif endif
ifeq ($(src-perf),) ifeq ($(src-perf),)
...@@ -53,128 +53,128 @@ include $(src-perf)/config/feature-tests.mak ...@@ -53,128 +53,128 @@ include $(src-perf)/config/feature-tests.mak
include $(src-perf)/config/utilities.mak include $(src-perf)/config/utilities.mak
ifeq ($(call get-executable,$(FLEX)),) ifeq ($(call get-executable,$(FLEX)),)
dummy := $(error Error: $(FLEX) is missing on this system, please install it) dummy := $(error Error: $(FLEX) is missing on this system, please install it)
endif endif
ifeq ($(call get-executable,$(BISON)),) ifeq ($(call get-executable,$(BISON)),)
dummy := $(error Error: $(BISON) is missing on this system, please install it) dummy := $(error Error: $(BISON) is missing on this system, please install it)
endif endif
# Treat warnings as errors unless directed not to # Treat warnings as errors unless directed not to
ifneq ($(WERROR),0) ifneq ($(WERROR),0)
CFLAGS += -Werror CFLAGS += -Werror
endif endif
ifeq ("$(origin DEBUG)", "command line") ifeq ("$(origin DEBUG)", "command line")
PERF_DEBUG = $(DEBUG) PERF_DEBUG = $(DEBUG)
endif endif
ifndef PERF_DEBUG ifndef PERF_DEBUG
CFLAGS += -O6 CFLAGS += -O6
endif endif
ifdef PARSER_DEBUG ifdef PARSER_DEBUG
PARSER_DEBUG_BISON := -t PARSER_DEBUG_BISON := -t
PARSER_DEBUG_FLEX := -d PARSER_DEBUG_FLEX := -d
CFLAGS += -DPARSER_DEBUG CFLAGS += -DPARSER_DEBUG
endif endif
CFLAGS += \ CFLAGS += \
-fno-omit-frame-pointer \ -fno-omit-frame-pointer \
-ggdb3 \ -ggdb3 \
-funwind-tables \ -funwind-tables \
-Wall \ -Wall \
-Wextra \ -Wextra \
-std=gnu99 -std=gnu99
EXTLIBS = -lpthread -lrt -lelf -lm EXTLIBS = -lpthread -lrt -lelf -lm
ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -Werror -fstack-protector-all,-fstack-protector-all),y) ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -Werror -fstack-protector-all,-fstack-protector-all),y)
CFLAGS += -fstack-protector-all CFLAGS += -fstack-protector-all
endif endif
ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -Werror -Wstack-protector,-Wstack-protector),y) ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -Werror -Wstack-protector,-Wstack-protector),y)
CFLAGS += -Wstack-protector CFLAGS += -Wstack-protector
endif endif
ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -Werror -Wvolatile-register-var,-Wvolatile-register-var),y) ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -Werror -Wvolatile-register-var,-Wvolatile-register-var),y)
CFLAGS += -Wvolatile-register-var CFLAGS += -Wvolatile-register-var
endif endif
ifndef PERF_DEBUG ifndef PERF_DEBUG
ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -D_FORTIFY_SOURCE=2,-D_FORTIFY_SOURCE=2),y) ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -D_FORTIFY_SOURCE=2,-D_FORTIFY_SOURCE=2),y)
CFLAGS += -D_FORTIFY_SOURCE=2 CFLAGS += -D_FORTIFY_SOURCE=2
endif endif
endif endif
CFLAGS += \ CFLAGS += \
-I$(src-perf)/util/include \ -I$(src-perf)/util/include \
-I$(src-perf)/arch/$(ARCH)/include \ -I$(src-perf)/arch/$(ARCH)/include \
-I$(srctree)/arch/$(ARCH)/include/uapi \ -I$(srctree)/arch/$(ARCH)/include/uapi \
-I$(srctree)/arch/$(ARCH)/include \ -I$(srctree)/arch/$(ARCH)/include \
-I$(srctree)/include/uapi \ -I$(srctree)/include/uapi \
-I$(srctree)/include -I$(srctree)/include
# $(obj-perf) for generated common-cmds.h # $(obj-perf) for generated common-cmds.h
# $(obj-perf)/util for generated bison/flex headers # $(obj-perf)/util for generated bison/flex headers
ifneq ($(OUTPUT),) ifneq ($(OUTPUT),)
CFLAGS += \ CFLAGS += \
-I$(obj-perf)/util \ -I$(obj-perf)/util \
-I$(obj-perf) -I$(obj-perf)
endif endif
CFLAGS += \ CFLAGS += \
-I$(src-perf)/util \ -I$(src-perf)/util \
-I$(src-perf) \ -I$(src-perf) \
-I$(TRACE_EVENT_DIR) \ -I$(TRACE_EVENT_DIR) \
-I$(srctree)/tools/lib/ -I$(srctree)/tools/lib/
CFLAGS += \ CFLAGS += \
-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
ifndef NO_BIONIC ifndef NO_BIONIC
ifeq ($(call try-cc,$(SOURCE_BIONIC),$(CFLAGS),bionic),y) ifeq ($(call try-cc,$(SOURCE_BIONIC),$(CFLAGS),bionic),y)
BIONIC := 1 BIONIC := 1
EXTLIBS := $(filter-out -lrt,$(EXTLIBS)) EXTLIBS := $(filter-out -lrt,$(EXTLIBS))
EXTLIBS := $(filter-out -lpthread,$(EXTLIBS)) EXTLIBS := $(filter-out -lpthread,$(EXTLIBS))
endif endif
endif # NO_BIONIC endif # NO_BIONIC
ifdef NO_LIBELF ifdef NO_LIBELF
NO_DWARF := 1 NO_DWARF := 1
NO_DEMANGLE := 1 NO_DEMANGLE := 1
NO_LIBUNWIND := 1 NO_LIBUNWIND := 1
else else
FLAGS_LIBELF=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) FLAGS_LIBELF=$(CFLAGS) $(LDFLAGS) $(EXTLIBS)
ifneq ($(call try-cc,$(SOURCE_LIBELF),$(FLAGS_LIBELF),libelf),y) ifneq ($(call try-cc,$(SOURCE_LIBELF),$(FLAGS_LIBELF),libelf),y)
FLAGS_GLIBC=$(CFLAGS) $(LDFLAGS) FLAGS_GLIBC=$(CFLAGS) $(LDFLAGS)
ifeq ($(call try-cc,$(SOURCE_GLIBC),$(FLAGS_GLIBC),glibc),y) ifeq ($(call try-cc,$(SOURCE_GLIBC),$(FLAGS_GLIBC),glibc),y)
LIBC_SUPPORT := 1 LIBC_SUPPORT := 1
endif endif
ifeq ($(BIONIC),1) ifeq ($(BIONIC),1)
LIBC_SUPPORT := 1 LIBC_SUPPORT := 1
endif endif
ifeq ($(LIBC_SUPPORT),1) ifeq ($(LIBC_SUPPORT),1)
msg := $(warning No libelf found, disables 'probe' tool, please install elfutils-libelf-devel/libelf-dev); msg := $(warning No libelf found, disables 'probe' tool, please install elfutils-libelf-devel/libelf-dev);
NO_LIBELF := 1 NO_LIBELF := 1
NO_DWARF := 1 NO_DWARF := 1
NO_DEMANGLE := 1 NO_DEMANGLE := 1
else else
msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]/glibc-static); msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]/glibc-static);
endif endif
else else
# for linking with debug library, run like: # for linking with debug library, run like:
# make DEBUG=1 LIBDW_DIR=/opt/libdw/ # make DEBUG=1 LIBDW_DIR=/opt/libdw/
ifdef LIBDW_DIR ifdef LIBDW_DIR
LIBDW_CFLAGS := -I$(LIBDW_DIR)/include LIBDW_CFLAGS := -I$(LIBDW_DIR)/include
LIBDW_LDFLAGS := -L$(LIBDW_DIR)/lib LIBDW_LDFLAGS := -L$(LIBDW_DIR)/lib
endif endif
FLAGS_DWARF=$(CFLAGS) $(LIBDW_CFLAGS) -ldw -lelf $(LIBDW_LDFLAGS) $(LDFLAGS) $(EXTLIBS) FLAGS_DWARF=$(CFLAGS) $(LIBDW_CFLAGS) -ldw -lelf $(LIBDW_LDFLAGS) $(LDFLAGS) $(EXTLIBS)
ifneq ($(call try-cc,$(SOURCE_DWARF),$(FLAGS_DWARF),libdw),y) ifneq ($(call try-cc,$(SOURCE_DWARF),$(FLAGS_DWARF),libdw),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); 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 NO_DWARF := 1
endif # Dwarf support endif # Dwarf support
endif # SOURCE_LIBELF endif # SOURCE_LIBELF
endif # NO_LIBELF endif # NO_LIBELF
...@@ -182,7 +182,7 @@ ifndef NO_LIBELF ...@@ -182,7 +182,7 @@ ifndef NO_LIBELF
CFLAGS += -DLIBELF_SUPPORT CFLAGS += -DLIBELF_SUPPORT
FLAGS_LIBELF=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) FLAGS_LIBELF=$(CFLAGS) $(LDFLAGS) $(EXTLIBS)
ifeq ($(call try-cc,$(SOURCE_ELF_MMAP),$(FLAGS_LIBELF),-DLIBELF_MMAP),y) ifeq ($(call try-cc,$(SOURCE_ELF_MMAP),$(FLAGS_LIBELF),-DLIBELF_MMAP),y)
CFLAGS += -DLIBELF_MMAP CFLAGS += -DLIBELF_MMAP
endif endif
# include ARCH specific config # include ARCH specific config
...@@ -190,12 +190,12 @@ endif ...@@ -190,12 +190,12 @@ endif
ifndef NO_DWARF ifndef NO_DWARF
ifeq ($(origin PERF_HAVE_DWARF_REGS), undefined) ifeq ($(origin PERF_HAVE_DWARF_REGS), undefined)
msg := $(warning DWARF register mappings have not been defined for architecture $(ARCH), DWARF support disabled); msg := $(warning DWARF register mappings have not been defined for architecture $(ARCH), DWARF support disabled);
NO_DWARF := 1 NO_DWARF := 1
else else
CFLAGS += -DDWARF_SUPPORT $(LIBDW_CFLAGS) CFLAGS += -DDWARF_SUPPORT $(LIBDW_CFLAGS)
LDFLAGS += $(LIBDW_LDFLAGS) LDFLAGS += $(LIBDW_LDFLAGS)
EXTLIBS += -lelf -ldw EXTLIBS += -lelf -ldw
endif # PERF_HAVE_DWARF_REGS endif # PERF_HAVE_DWARF_REGS
endif # NO_DWARF endif # NO_DWARF
...@@ -205,99 +205,99 @@ ifndef NO_LIBELF ...@@ -205,99 +205,99 @@ ifndef NO_LIBELF
CFLAGS += -DLIBELF_SUPPORT CFLAGS += -DLIBELF_SUPPORT
FLAGS_LIBELF=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) FLAGS_LIBELF=$(CFLAGS) $(LDFLAGS) $(EXTLIBS)
ifeq ($(call try-cc,$(SOURCE_ELF_MMAP),$(FLAGS_LIBELF),-DLIBELF_MMAP),y) ifeq ($(call try-cc,$(SOURCE_ELF_MMAP),$(FLAGS_LIBELF),-DLIBELF_MMAP),y)
CFLAGS += -DLIBELF_MMAP CFLAGS += -DLIBELF_MMAP
endif # try-cc endif # try-cc
endif # NO_LIBELF endif # NO_LIBELF
# There's only x86 (both 32 and 64) support for CFI unwind so far # There's only x86 (both 32 and 64) support for CFI unwind so far
ifneq ($(ARCH),x86) ifneq ($(ARCH),x86)
NO_LIBUNWIND := 1 NO_LIBUNWIND := 1
endif endif
ifndef NO_LIBUNWIND ifndef NO_LIBUNWIND
# for linking with debug library, run like: # for linking with debug library, run like:
# make DEBUG=1 LIBUNWIND_DIR=/opt/libunwind/ # make DEBUG=1 LIBUNWIND_DIR=/opt/libunwind/
ifdef LIBUNWIND_DIR ifdef LIBUNWIND_DIR
LIBUNWIND_CFLAGS := -I$(LIBUNWIND_DIR)/include LIBUNWIND_CFLAGS := -I$(LIBUNWIND_DIR)/include
LIBUNWIND_LDFLAGS := -L$(LIBUNWIND_DIR)/lib LIBUNWIND_LDFLAGS := -L$(LIBUNWIND_DIR)/lib
endif endif
FLAGS_UNWIND=$(LIBUNWIND_CFLAGS) $(CFLAGS) $(LIBUNWIND_LDFLAGS) $(LDFLAGS) $(EXTLIBS) $(LIBUNWIND_LIBS) FLAGS_UNWIND=$(LIBUNWIND_CFLAGS) $(CFLAGS) $(LIBUNWIND_LDFLAGS) $(LDFLAGS) $(EXTLIBS) $(LIBUNWIND_LIBS)
ifneq ($(call try-cc,$(SOURCE_LIBUNWIND),$(FLAGS_UNWIND),libunwind),y) ifneq ($(call try-cc,$(SOURCE_LIBUNWIND),$(FLAGS_UNWIND),libunwind),y)
msg := $(warning No libunwind found, disabling post unwind support. Please install libunwind-dev[el] >= 0.99); msg := $(warning No libunwind found, disabling post unwind support. Please install libunwind-dev[el] >= 0.99);
NO_LIBUNWIND := 1 NO_LIBUNWIND := 1
endif # Libunwind support endif # Libunwind support
endif # NO_LIBUNWIND endif # NO_LIBUNWIND
ifndef NO_LIBUNWIND ifndef NO_LIBUNWIND
CFLAGS += -DLIBUNWIND_SUPPORT CFLAGS += -DLIBUNWIND_SUPPORT
EXTLIBS += $(LIBUNWIND_LIBS) EXTLIBS += $(LIBUNWIND_LIBS)
CFLAGS += $(LIBUNWIND_CFLAGS) CFLAGS += $(LIBUNWIND_CFLAGS)
LDFLAGS += $(LIBUNWIND_LDFLAGS) LDFLAGS += $(LIBUNWIND_LDFLAGS)
endif # NO_LIBUNWIND endif # NO_LIBUNWIND
ifndef NO_LIBAUDIT ifndef NO_LIBAUDIT
FLAGS_LIBAUDIT = $(CFLAGS) $(LDFLAGS) -laudit FLAGS_LIBAUDIT = $(CFLAGS) $(LDFLAGS) -laudit
ifneq ($(call try-cc,$(SOURCE_LIBAUDIT),$(FLAGS_LIBAUDIT),libaudit),y) ifneq ($(call try-cc,$(SOURCE_LIBAUDIT),$(FLAGS_LIBAUDIT),libaudit),y)
msg := $(warning No libaudit.h found, disables 'trace' tool, please install audit-libs-devel or libaudit-dev); msg := $(warning No libaudit.h found, disables 'trace' tool, please install audit-libs-devel or libaudit-dev);
NO_LIBAUDIT := 1 NO_LIBAUDIT := 1
else else
CFLAGS += -DLIBAUDIT_SUPPORT CFLAGS += -DLIBAUDIT_SUPPORT
EXTLIBS += -laudit EXTLIBS += -laudit
endif endif
endif endif
ifdef NO_NEWT ifdef NO_NEWT
NO_SLANG=1 NO_SLANG=1
endif endif
ifndef NO_SLANG ifndef NO_SLANG
FLAGS_SLANG=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) -I/usr/include/slang -lslang FLAGS_SLANG=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) -I/usr/include/slang -lslang
ifneq ($(call try-cc,$(SOURCE_SLANG),$(FLAGS_SLANG),libslang),y) ifneq ($(call try-cc,$(SOURCE_SLANG),$(FLAGS_SLANG),libslang),y)
msg := $(warning slang not found, disables TUI support. Please install slang-devel or libslang-dev); msg := $(warning slang not found, disables TUI support. Please install slang-devel or libslang-dev);
NO_SLANG := 1 NO_SLANG := 1
else else
# Fedora has /usr/include/slang/slang.h, but ubuntu /usr/include/slang.h # Fedora has /usr/include/slang/slang.h, but ubuntu /usr/include/slang.h
CFLAGS += -I/usr/include/slang CFLAGS += -I/usr/include/slang
CFLAGS += -DSLANG_SUPPORT CFLAGS += -DSLANG_SUPPORT
EXTLIBS += -lslang EXTLIBS += -lslang
endif endif
endif endif
ifndef NO_GTK2 ifndef NO_GTK2
FLAGS_GTK2=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null) FLAGS_GTK2=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null)
ifneq ($(call try-cc,$(SOURCE_GTK2),$(FLAGS_GTK2),gtk2),y) ifneq ($(call try-cc,$(SOURCE_GTK2),$(FLAGS_GTK2),gtk2),y)
msg := $(warning GTK2 not found, disables GTK2 support. Please install gtk2-devel or libgtk2.0-dev); msg := $(warning GTK2 not found, disables GTK2 support. Please install gtk2-devel or libgtk2.0-dev);
NO_GTK2 := 1 NO_GTK2 := 1
else else
ifeq ($(call try-cc,$(SOURCE_GTK2_INFOBAR),$(FLAGS_GTK2),-DHAVE_GTK_INFO_BAR),y) ifeq ($(call try-cc,$(SOURCE_GTK2_INFOBAR),$(FLAGS_GTK2),-DHAVE_GTK_INFO_BAR),y)
CFLAGS += -DHAVE_GTK_INFO_BAR CFLAGS += -DHAVE_GTK_INFO_BAR
endif endif
CFLAGS += -DGTK2_SUPPORT CFLAGS += -DGTK2_SUPPORT
CFLAGS += $(shell pkg-config --cflags gtk+-2.0 2>/dev/null) CFLAGS += $(shell pkg-config --cflags gtk+-2.0 2>/dev/null)
EXTLIBS += $(shell pkg-config --libs gtk+-2.0 2>/dev/null) EXTLIBS += $(shell pkg-config --libs gtk+-2.0 2>/dev/null)
endif endif
endif endif
grep-libs = $(filter -l%,$(1)) grep-libs = $(filter -l%,$(1))
strip-libs = $(filter-out -l%,$(1)) strip-libs = $(filter-out -l%,$(1))
ifdef NO_LIBPERL ifdef NO_LIBPERL
CFLAGS += -DNO_LIBPERL CFLAGS += -DNO_LIBPERL
else else
PERL_EMBED_LDOPTS = $(shell perl -MExtUtils::Embed -e ldopts 2>/dev/null) PERL_EMBED_LDOPTS = $(shell perl -MExtUtils::Embed -e ldopts 2>/dev/null)
PERL_EMBED_LDFLAGS = $(call strip-libs,$(PERL_EMBED_LDOPTS)) PERL_EMBED_LDFLAGS = $(call strip-libs,$(PERL_EMBED_LDOPTS))
PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS)) PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS))
PERL_EMBED_CCOPTS = `perl -MExtUtils::Embed -e ccopts 2>/dev/null` PERL_EMBED_CCOPTS = `perl -MExtUtils::Embed -e ccopts 2>/dev/null`
FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS) FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS)
ifneq ($(call try-cc,$(SOURCE_PERL_EMBED),$(FLAGS_PERL_EMBED),perl),y) ifneq ($(call try-cc,$(SOURCE_PERL_EMBED),$(FLAGS_PERL_EMBED),perl),y)
CFLAGS += -DNO_LIBPERL CFLAGS += -DNO_LIBPERL
NO_LIBPERL := 1 NO_LIBPERL := 1
else else
LDFLAGS += $(PERL_EMBED_LDFLAGS) LDFLAGS += $(PERL_EMBED_LDFLAGS)
EXTLIBS += $(PERL_EMBED_LIBADD) EXTLIBS += $(PERL_EMBED_LIBADD)
endif endif
endif endif
disable-python = $(eval $(disable-python_code)) disable-python = $(eval $(disable-python_code))
...@@ -364,69 +364,69 @@ else ...@@ -364,69 +364,69 @@ else
endif endif
ifdef NO_DEMANGLE ifdef NO_DEMANGLE
CFLAGS += -DNO_DEMANGLE CFLAGS += -DNO_DEMANGLE
else else
ifdef HAVE_CPLUS_DEMANGLE ifdef HAVE_CPLUS_DEMANGLE
EXTLIBS += -liberty EXTLIBS += -liberty
CFLAGS += -DHAVE_CPLUS_DEMANGLE CFLAGS += -DHAVE_CPLUS_DEMANGLE
else else
FLAGS_BFD=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) -DPACKAGE='perf' -lbfd FLAGS_BFD=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) -DPACKAGE='perf' -lbfd
has_bfd := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD),libbfd) has_bfd := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD),libbfd)
ifeq ($(has_bfd),y) ifeq ($(has_bfd),y)
EXTLIBS += -lbfd EXTLIBS += -lbfd
else else
FLAGS_BFD_IBERTY=$(FLAGS_BFD) -liberty FLAGS_BFD_IBERTY=$(FLAGS_BFD) -liberty
has_bfd_iberty := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD_IBERTY),liberty) has_bfd_iberty := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD_IBERTY),liberty)
ifeq ($(has_bfd_iberty),y) ifeq ($(has_bfd_iberty),y)
EXTLIBS += -lbfd -liberty EXTLIBS += -lbfd -liberty
else else
FLAGS_BFD_IBERTY_Z=$(FLAGS_BFD_IBERTY) -lz FLAGS_BFD_IBERTY_Z=$(FLAGS_BFD_IBERTY) -lz
has_bfd_iberty_z := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD_IBERTY_Z),libz) has_bfd_iberty_z := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD_IBERTY_Z),libz)
ifeq ($(has_bfd_iberty_z),y) ifeq ($(has_bfd_iberty_z),y)
EXTLIBS += -lbfd -liberty -lz EXTLIBS += -lbfd -liberty -lz
else else
FLAGS_CPLUS_DEMANGLE=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) -liberty FLAGS_CPLUS_DEMANGLE=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) -liberty
has_cplus_demangle := $(call try-cc,$(SOURCE_CPLUS_DEMANGLE),$(FLAGS_CPLUS_DEMANGLE),demangle) has_cplus_demangle := $(call try-cc,$(SOURCE_CPLUS_DEMANGLE),$(FLAGS_CPLUS_DEMANGLE),demangle)
ifeq ($(has_cplus_demangle),y) ifeq ($(has_cplus_demangle),y)
EXTLIBS += -liberty EXTLIBS += -liberty
CFLAGS += -DHAVE_CPLUS_DEMANGLE CFLAGS += -DHAVE_CPLUS_DEMANGLE
else else
msg := $(warning No bfd.h/libbfd found, install binutils-dev[el]/zlib-static to gain symbol demangling) msg := $(warning No bfd.h/libbfd found, install binutils-dev[el]/zlib-static to gain symbol demangling)
CFLAGS += -DNO_DEMANGLE CFLAGS += -DNO_DEMANGLE
endif endif
endif endif
endif endif
endif endif
endif endif
endif endif
ifndef NO_STRLCPY ifndef NO_STRLCPY
ifeq ($(call try-cc,$(SOURCE_STRLCPY),,-DHAVE_STRLCPY),y) ifeq ($(call try-cc,$(SOURCE_STRLCPY),,-DHAVE_STRLCPY),y)
CFLAGS += -DHAVE_STRLCPY CFLAGS += -DHAVE_STRLCPY
endif endif
endif endif
ifndef NO_ON_EXIT ifndef NO_ON_EXIT
ifeq ($(call try-cc,$(SOURCE_ON_EXIT),,-DHAVE_ON_EXIT),y) ifeq ($(call try-cc,$(SOURCE_ON_EXIT),,-DHAVE_ON_EXIT),y)
CFLAGS += -DHAVE_ON_EXIT CFLAGS += -DHAVE_ON_EXIT
endif endif
endif endif
ifndef NO_BACKTRACE ifndef NO_BACKTRACE
ifeq ($(call try-cc,$(SOURCE_BACKTRACE),,-DBACKTRACE_SUPPORT),y) ifeq ($(call try-cc,$(SOURCE_BACKTRACE),,-DBACKTRACE_SUPPORT),y)
CFLAGS += -DBACKTRACE_SUPPORT CFLAGS += -DBACKTRACE_SUPPORT
endif endif
endif endif
ifndef NO_LIBNUMA ifndef NO_LIBNUMA
FLAGS_LIBNUMA = $(CFLAGS) $(LDFLAGS) -lnuma FLAGS_LIBNUMA = $(CFLAGS) $(LDFLAGS) -lnuma
ifneq ($(call try-cc,$(SOURCE_LIBNUMA),$(FLAGS_LIBNUMA),libnuma),y) ifneq ($(call try-cc,$(SOURCE_LIBNUMA),$(FLAGS_LIBNUMA),libnuma),y)
msg := $(warning No numa.h found, disables 'perf bench numa mem' benchmark, please install numa-libs-devel or libnuma-dev); msg := $(warning No numa.h found, disables 'perf bench numa mem' benchmark, please install numa-libs-devel or libnuma-dev);
NO_LIBNUMA := 1 NO_LIBNUMA := 1
else else
CFLAGS += -DLIBNUMA_SUPPORT CFLAGS += -DLIBNUMA_SUPPORT
EXTLIBS += -lnuma EXTLIBS += -lnuma
endif endif
endif endif
# Among the variables below, these: # Among the variables below, these:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment