diff options
author | Jiri Olsa <jolsa@redhat.com> | 2013-03-24 19:40:48 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-05-28 09:24:06 -0400 |
commit | 362493f0d63e25698018f6f36b2e02201342dbee (patch) | |
tree | 1aeb6f9c1580d480cf81ccae9052bc9715708f64 /tools/perf/config | |
parent | a32f4936bc022fd82b08a350a5587bd5a7e500d1 (diff) |
perf tools: Move compiler and linker flags check into config/Makefile
Moving compiler and linker flags check 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-5-git-send-email-jolsa@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/config')
-rw-r--r-- | tools/perf/config/Makefile | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile index 04bf8aceea5a..8acbcfec93f1 100644 --- a/tools/perf/config/Makefile +++ b/tools/perf/config/Makefile | |||
@@ -42,3 +42,69 @@ endif | |||
42 | ifeq ($(call get-executable,$(BISON)),) | 42 | ifeq ($(call get-executable,$(BISON)),) |
43 | dummy := $(error Error: $(BISON) is missing on this system, please install it) | 43 | dummy := $(error Error: $(BISON) is missing on this system, please install it) |
44 | endif | 44 | endif |
45 | |||
46 | # Treat warnings as errors unless directed not to | ||
47 | ifneq ($(WERROR),0) | ||
48 | CFLAGS_WERROR := -Werror | ||
49 | endif | ||
50 | |||
51 | ifeq ("$(origin DEBUG)", "command line") | ||
52 | PERF_DEBUG = $(DEBUG) | ||
53 | endif | ||
54 | ifndef PERF_DEBUG | ||
55 | CFLAGS_OPTIMIZE = -O6 | ||
56 | endif | ||
57 | |||
58 | ifdef PARSER_DEBUG | ||
59 | PARSER_DEBUG_BISON := -t | ||
60 | PARSER_DEBUG_FLEX := -d | ||
61 | PARSER_DEBUG_CFLAGS := -DPARSER_DEBUG | ||
62 | endif | ||
63 | |||
64 | CFLAGS = -fno-omit-frame-pointer -ggdb3 -funwind-tables -Wall -Wextra -std=gnu99 $(CFLAGS_WERROR) $(CFLAGS_OPTIMIZE) $(EXTRA_WARNINGS) $(EXTRA_CFLAGS) $(PARSER_DEBUG_CFLAGS) | ||
65 | EXTLIBS = -lpthread -lrt -lelf -lm | ||
66 | ALL_CFLAGS = $(CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE | ||
67 | ALL_LDFLAGS = $(LDFLAGS) | ||
68 | |||
69 | ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -Werror -fstack-protector-all,-fstack-protector-all),y) | ||
70 | CFLAGS := $(CFLAGS) -fstack-protector-all | ||
71 | endif | ||
72 | |||
73 | ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -Werror -Wstack-protector,-Wstack-protector),y) | ||
74 | CFLAGS := $(CFLAGS) -Wstack-protector | ||
75 | endif | ||
76 | |||
77 | ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -Werror -Wvolatile-register-var,-Wvolatile-register-var),y) | ||
78 | CFLAGS := $(CFLAGS) -Wvolatile-register-var | ||
79 | endif | ||
80 | |||
81 | ifndef PERF_DEBUG | ||
82 | ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -D_FORTIFY_SOURCE=2,-D_FORTIFY_SOURCE=2),y) | ||
83 | CFLAGS := $(CFLAGS) -D_FORTIFY_SOURCE=2 | ||
84 | endif | ||
85 | endif | ||
86 | |||
87 | BASIC_CFLAGS += \ | ||
88 | -Iutil/include \ | ||
89 | -Iarch/$(ARCH)/include \ | ||
90 | $(if $(objtree),-I$(objtree)/arch/$(ARCH)/include/generated/uapi) \ | ||
91 | -I$(srctree)/arch/$(ARCH)/include/uapi \ | ||
92 | -I$(srctree)/arch/$(ARCH)/include \ | ||
93 | $(if $(objtree),-I$(objtree)/include/generated/uapi) \ | ||
94 | -I$(srctree)/include/uapi \ | ||
95 | -I$(srctree)/include \ | ||
96 | -I$(OUTPUT)util \ | ||
97 | -Iutil \ | ||
98 | -I. \ | ||
99 | -I$(TRACE_EVENT_DIR) \ | ||
100 | -I../lib/ \ | ||
101 | -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE | ||
102 | |||
103 | BASIC_LDFLAGS = | ||
104 | |||
105 | ifeq ($(call try-cc,$(SOURCE_BIONIC),$(CFLAGS),bionic),y) | ||
106 | BIONIC := 1 | ||
107 | EXTLIBS := $(filter-out -lrt,$(EXTLIBS)) | ||
108 | EXTLIBS := $(filter-out -lpthread,$(EXTLIBS)) | ||
109 | BASIC_CFLAGS += -I. | ||
110 | endif | ||