Blame view

tools/perf/Makefile.config 29.4 KB
8bd407b96   Jiri Olsa   perf tools: Move ...
1

a6cf5f392   Jiri Olsa   perf tools: Move ...
2
3
4
  ifeq ($(src-perf),)
  src-perf := $(srctree)/tools/perf
  endif
8bd407b96   Jiri Olsa   perf tools: Move ...
5

a6cf5f392   Jiri Olsa   perf tools: Move ...
6
7
  ifeq ($(obj-perf),)
  obj-perf := $(OUTPUT)
8bd407b96   Jiri Olsa   perf tools: Move ...
8
  endif
a6cf5f392   Jiri Olsa   perf tools: Move ...
9
10
11
  ifneq ($(obj-perf),)
  obj-perf := $(abspath $(obj-perf))/
  endif
52c0a18b9   Sergei Trofimovich   perf tools: Fix m...
12
  $(shell printf "" > $(OUTPUT).config-detected)
642273795   Aaro Koskinen   perf tools: Creat...
13
14
  detected     = $(shell echo "$(1)=y"       >> $(OUTPUT).config-detected)
  detected_var = $(shell echo "$(1)=$($(1))" >> $(OUTPUT).config-detected)
fcfd6611f   Jiri Olsa   tools build: Add ...
15

a6cf5f392   Jiri Olsa   perf tools: Move ...
16
  CFLAGS := $(EXTRA_CFLAGS) $(EXTRA_WARNINGS)
935e6bd31   Wang Nan   tools: Move Makef...
17
  include $(srctree)/tools/scripts/Makefile.arch
a6cf5f392   Jiri Olsa   perf tools: Move ...
18

7a759cd8e   Jiada Wang   perf tools: Fix b...
19
  $(call detected_var,SRCARCH)
f39e042a1   Jiri Olsa   perf build: Add t...
20

a6cf5f392   Jiri Olsa   perf tools: Move ...
21
  NO_PERF_REGS := 1
901bb0280   Hendrik Brueckner   perf trace: Use g...
22
  NO_SYSCALL_TABLE := 1
a6cf5f392   Jiri Olsa   perf tools: Move ...
23

dc642e838   Anju T   tools/perf: Map t...
24
  # Additional ARCH settings for ppc
7a759cd8e   Jiada Wang   perf tools: Fix b...
25
  ifeq ($(SRCARCH),powerpc)
dc642e838   Anju T   tools/perf: Map t...
26
    NO_PERF_REGS := 0
4281da235   Ravi Bangoria   perf trace powerp...
27
28
    NO_SYSCALL_TABLE := 0
    CFLAGS += -I$(OUTPUT)arch/powerpc/include/generated
c4522469e   Chandan Kumar   perf/powerpc: Add...
29
    LIBUNWIND_LIBS := -lunwind -lunwind-ppc64
dc642e838   Anju T   tools/perf: Map t...
30
  endif
a6cf5f392   Jiri Olsa   perf tools: Move ...
31
  # Additional ARCH settings for x86
7a759cd8e   Jiada Wang   perf tools: Fix b...
32
  ifeq ($(SRCARCH),x86)
f39e042a1   Jiri Olsa   perf build: Add t...
33
    $(call detected,CONFIG_X86)
c6e5e9fbc   Namhyung Kim   perf tools: Fix b...
34
    ifeq (${IS_64_BIT}, 1)
901bb0280   Hendrik Brueckner   perf trace: Use g...
35
36
      NO_SYSCALL_TABLE := 0
      CFLAGS += -DHAVE_ARCH_X86_64_SUPPORT -I$(OUTPUT)arch/x86/include/generated
8e1b3f686   Jiri Olsa   perf tools: Repla...
37
      ARCH_INCLUDE = ../../arch/x86/lib/memcpy_64.S ../../arch/x86/lib/memset_64.S
60913e005   Konstantin Khlebnikov   perf tools: Fix s...
38
      LIBUNWIND_LIBS = -lunwind-x86_64 -lunwind -llzma
72965b87c   Jiri Olsa   perf build: Add b...
39
      $(call detected,CONFIG_X86_64)
8a0c4c284   Adrian Hunter   perf tools: Fix l...
40
    else
05b41775e   Adrian Hunter   perf build: Fix l...
41
      LIBUNWIND_LIBS = -lunwind-x86 -llzma -lunwind
8e1b3f686   Jiri Olsa   perf tools: Repla...
42
43
    endif
    NO_PERF_REGS := 0
8bd407b96   Jiri Olsa   perf tools: Move ...
44
  endif
8ab596afb   Jean Pihet   perf tools ARM64:...
45

7a759cd8e   Jiada Wang   perf tools: Fix b...
46
  ifeq ($(SRCARCH),arm)
7495f3742   Will Deacon   ARM: perf: wire u...
47
48
49
    NO_PERF_REGS := 0
    LIBUNWIND_LIBS = -lunwind -lunwind-arm
  endif
8bd407b96   Jiri Olsa   perf tools: Move ...
50

7a759cd8e   Jiada Wang   perf tools: Fix b...
51
  ifeq ($(SRCARCH),arm64)
8ab596afb   Jean Pihet   perf tools ARM64:...
52
    NO_PERF_REGS := 0
a7f660d65   Kim Phillips   perf trace arm64:...
53
54
    NO_SYSCALL_TABLE := 0
    CFLAGS += -I$(OUTPUT)arch/arm64/include/generated
8ab596afb   Jean Pihet   perf tools ARM64:...
55
56
    LIBUNWIND_LIBS = -lunwind -lunwind-aarch64
  endif
f704ef446   Heiko Carstens   s390/perf: add su...
57
58
  ifeq ($(ARCH),s390)
    NO_PERF_REGS := 0
901bb0280   Hendrik Brueckner   perf trace: Use g...
59
    NO_SYSCALL_TABLE := 0
a9a3f1d18   Hendrik Brueckner   perf s390: Always...
60
    CFLAGS += -fPIC -I$(OUTPUT)arch/s390/include/generated
f704ef446   Heiko Carstens   s390/perf: add su...
61
  endif
3bc3374cc   Jiri Olsa   perf build: Add p...
62
63
64
  ifeq ($(NO_PERF_REGS),0)
    $(call detected,CONFIG_PERF_REGS)
  endif
901bb0280   Hendrik Brueckner   perf trace: Use g...
65
  ifneq ($(NO_SYSCALL_TABLE),1)
22e9af4e9   Jin Yao   perf tools: Renam...
66
    CFLAGS += -DHAVE_SYSCALL_TABLE_SUPPORT
901bb0280   Hendrik Brueckner   perf trace: Use g...
67
  endif
90fa9deb3   Jean Pihet   perf tests: Add d...
68
  # So far there's only x86 and arm libdw unwind support merged in perf.
4dc549e58   Jiri Olsa   perf tools: Disab...
69
70
71
  # Disable it on all other architectures in case libdw unwind
  # support is detected in system. Add supported architectures
  # to the check.
744e9a91c   Kim Phillips   perf tools arm64:...
72
  ifneq ($(SRCARCH),$(filter $(SRCARCH),x86 arm arm64 powerpc s390))
4dc549e58   Jiri Olsa   perf tools: Disab...
73
74
    NO_LIBDW_DWARF_UNWIND := 1
  endif
1448fef40   Jean Pihet   perf unwinding: U...
75
76
  ifeq ($(LIBUNWIND_LIBS),)
    NO_LIBUNWIND := 1
1448fef40   Jean Pihet   perf unwinding: U...
77
  endif
5a155bb77   Wang Nan   perf build: Remov...
78
79
80
81
82
  #
  # For linking with debug library, run like:
  #
  #   make DEBUG=1 LIBUNWIND_DIR=/opt/libunwind/
  #
195106b9f   He Kuang   perf unwind: Use ...
83
84
85
86
87
88
  
  libunwind_arch_set_flags = $(eval $(libunwind_arch_set_flags_code))
  define libunwind_arch_set_flags_code
    FEATURE_CHECK_CFLAGS-libunwind-$(1)  = -I$(LIBUNWIND_DIR)/include
    FEATURE_CHECK_LDFLAGS-libunwind-$(1) = -L$(LIBUNWIND_DIR)/lib
  endef
5a155bb77   Wang Nan   perf build: Remov...
89
90
91
  ifdef LIBUNWIND_DIR
    LIBUNWIND_CFLAGS  = -I$(LIBUNWIND_DIR)/include
    LIBUNWIND_LDFLAGS = -L$(LIBUNWIND_DIR)/lib
195106b9f   He Kuang   perf unwind: Use ...
92
93
    LIBUNWIND_ARCHS = x86 x86_64 arm aarch64 debug-frame-arm debug-frame-aarch64
    $(foreach libunwind_arch,$(LIBUNWIND_ARCHS),$(call libunwind_arch_set_flags,$(libunwind_arch)))
5a155bb77   Wang Nan   perf build: Remov...
94
  endif
5a155bb77   Wang Nan   perf build: Remov...
95
96
97
  
  # Set per-feature check compilation flags
  FEATURE_CHECK_CFLAGS-libunwind = $(LIBUNWIND_CFLAGS)
403cacb8a   He Kuang   perf unwind: Don'...
98
  FEATURE_CHECK_LDFLAGS-libunwind = $(LIBUNWIND_LDFLAGS) $(LIBUNWIND_LIBS)
5a155bb77   Wang Nan   perf build: Remov...
99
  FEATURE_CHECK_CFLAGS-libunwind-debug-frame = $(LIBUNWIND_CFLAGS)
403cacb8a   He Kuang   perf unwind: Don'...
100
  FEATURE_CHECK_LDFLAGS-libunwind-debug-frame = $(LIBUNWIND_LDFLAGS) $(LIBUNWIND_LIBS)
1448fef40   Jean Pihet   perf unwinding: U...
101

aa6292f48   Mathieu Poirier   perf tools: Integ...
102
103
104
105
106
107
108
109
110
  ifdef CSINCLUDES
    LIBOPENCSD_CFLAGS := -I$(CSINCLUDES)
  endif
  OPENCSDLIBS := -lopencsd_c_api -lopencsd
  ifdef CSLIBS
    LIBOPENCSD_LDFLAGS := -L$(CSLIBS)
  endif
  FEATURE_CHECK_CFLAGS-libopencsd := $(LIBOPENCSD_CFLAGS)
  FEATURE_CHECK_LDFLAGS-libopencsd := $(LIBOPENCSD_LDFLAGS) $(OPENCSDLIBS)
8bd407b96   Jiri Olsa   perf tools: Move ...
111
  ifeq ($(NO_PERF_REGS),0)
89fe808ae   Ingo Molnar   tools/perf: Stand...
112
    CFLAGS += -DHAVE_PERF_REGS_SUPPORT
8bd407b96   Jiri Olsa   perf tools: Move ...
113
  endif
a32f4936b   Jiri Olsa   perf tools: Move ...
114

5a155bb77   Wang Nan   perf build: Remov...
115
116
117
118
119
  # for linking with debug library, run like:
  # make DEBUG=1 LIBDW_DIR=/opt/libdw/
  ifdef LIBDW_DIR
    LIBDW_CFLAGS  := -I$(LIBDW_DIR)/include
    LIBDW_LDFLAGS := -L$(LIBDW_DIR)/lib
45757895c   Jiri Olsa   perf tools: Add f...
120
  endif
ba335df4e   Konstantin Khlebnikov   perf tools: Fix s...
121
122
123
124
  DWARFLIBS := -ldw
  ifeq ($(findstring -static,${LDFLAGS}),-static)
    DWARFLIBS += -lelf -lebl -ldl -lz -llzma -lbz2
  endif
5a155bb77   Wang Nan   perf build: Remov...
125
  FEATURE_CHECK_CFLAGS-libdw-dwarf-unwind := $(LIBDW_CFLAGS)
ba335df4e   Konstantin Khlebnikov   perf tools: Fix s...
126
  FEATURE_CHECK_LDFLAGS-libdw-dwarf-unwind := $(LIBDW_LDFLAGS) $(DWARFLIBS)
45757895c   Jiri Olsa   perf tools: Add f...
127

5a155bb77   Wang Nan   perf build: Remov...
128
129
130
131
132
  # for linking with debug library, run like:
  # make DEBUG=1 LIBBABELTRACE_DIR=/opt/libbabeltrace/
  ifdef LIBBABELTRACE_DIR
    LIBBABELTRACE_CFLAGS  := -I$(LIBBABELTRACE_DIR)/include
    LIBBABELTRACE_LDFLAGS := -L$(LIBBABELTRACE_DIR)/lib
53d0a5734   Jiri Olsa   perf tools: Add f...
133
  endif
5a155bb77   Wang Nan   perf build: Remov...
134
135
  FEATURE_CHECK_CFLAGS-libbabeltrace := $(LIBBABELTRACE_CFLAGS)
  FEATURE_CHECK_LDFLAGS-libbabeltrace := $(LIBBABELTRACE_LDFLAGS) -lbabeltrace-ctf
53d0a5734   Jiri Olsa   perf tools: Add f...
136

7a759cd8e   Jiada Wang   perf tools: Fix b...
137
  FEATURE_CHECK_CFLAGS-bpf = -I. -I$(srctree)/tools/include -I$(srctree)/tools/arch/$(SRCARCH)/include/uapi -I$(srctree)/tools/include/uapi
7c53746e6   Jiri Olsa   perf tools: Switc...
138
  # include ARCH specific config
7a759cd8e   Jiada Wang   perf tools: Fix b...
139
  -include $(src-perf)/arch/$(SRCARCH)/Makefile
7c53746e6   Jiri Olsa   perf tools: Switc...
140

63ab024a5   Wang Nan   perf tools: regs_...
141
142
143
  ifdef PERF_HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET
    CFLAGS += -DHAVE_ARCH_REGS_QUERY_REGISTER_OFFSET
  endif
ca70c24fb   Arnaldo Carvalho de Melo   tools: Move utili...
144
  include $(srctree)/tools/scripts/utilities.mak
a32f4936b   Jiri Olsa   perf tools: Move ...
145
146
  
  ifeq ($(call get-executable,$(FLEX)),)
8e1b3f686   Jiri Olsa   perf tools: Repla...
147
    dummy := $(error Error: $(FLEX) is missing on this system, please install it)
a32f4936b   Jiri Olsa   perf tools: Move ...
148
149
150
  endif
  
  ifeq ($(call get-executable,$(BISON)),)
8e1b3f686   Jiri Olsa   perf tools: Repla...
151
    dummy := $(error Error: $(BISON) is missing on this system, please install it)
a32f4936b   Jiri Olsa   perf tools: Move ...
152
  endif
362493f0d   Jiri Olsa   perf tools: Move ...
153
154
155
  
  # Treat warnings as errors unless directed not to
  ifneq ($(WERROR),0)
8e1b3f686   Jiri Olsa   perf tools: Repla...
156
    CFLAGS += -Werror
d58ac0bf8   Wang Nan   perf build: Add c...
157
    CXXFLAGS += -Werror
362493f0d   Jiri Olsa   perf tools: Move ...
158
  endif
74af377bc   Adrian Hunter   perf tools: Fix n...
159
160
161
  ifndef DEBUG
    DEBUG := 0
  endif
fcf925850   Ingo Molnar   tools/perf/build:...
162
  ifeq ($(DEBUG),0)
3866058ef   David Carrillo-Cisneros   perf tools: Robus...
163
  ifeq ($(CC_NO_CLANG), 0)
49b3cd306   Arnaldo Carvalho de Melo   tools: Set the ma...
164
165
    CFLAGS += -O3
  else
8e1b3f686   Jiri Olsa   perf tools: Repla...
166
    CFLAGS += -O6
362493f0d   Jiri Olsa   perf tools: Move ...
167
  endif
49b3cd306   Arnaldo Carvalho de Melo   tools: Set the ma...
168
  endif
362493f0d   Jiri Olsa   perf tools: Move ...
169
170
  
  ifdef PARSER_DEBUG
8e1b3f686   Jiri Olsa   perf tools: Repla...
171
172
173
    PARSER_DEBUG_BISON := -t
    PARSER_DEBUG_FLEX  := -d
    CFLAGS             += -DPARSER_DEBUG
9352aabad   Jiri Olsa   perf build: Add l...
174
175
    $(call detected_var,PARSER_DEBUG_BISON)
    $(call detected_var,PARSER_DEBUG_FLEX)
362493f0d   Jiri Olsa   perf tools: Move ...
176
  endif
5a155bb77   Wang Nan   perf build: Remov...
177
178
179
180
181
182
183
184
185
186
  # Try different combinations to accommodate systems that only have
  # python[2][-config] in weird combinations but always preferring
  # python2 and python2-config as per pep-0394. If we catch a
  # python[-config] in version 3, the version check will kill it.
  PYTHON2 := $(if $(call get-executable,python2),python2,python)
  override PYTHON := $(call get-executable-or-default,PYTHON,$(PYTHON2))
  PYTHON2_CONFIG := \
    $(if $(call get-executable,$(PYTHON)-config),$(PYTHON)-config,python-config)
  override PYTHON_CONFIG := \
    $(call get-executable-or-default,PYTHON_CONFIG,$(PYTHON2_CONFIG))
56c7d79e4   Namhyung Kim   perf tools: Fix m...
187

7be6b3166   David Carrillo-Cisneros   perf tools: Pass ...
188
189
  grep-libs  = $(filter -l%,$(1))
  strip-libs  = $(filter-out -l%,$(1))
56c7d79e4   Namhyung Kim   perf tools: Fix m...
190

7be6b3166   David Carrillo-Cisneros   perf tools: Pass ...
191
  PYTHON_CONFIG_SQ := $(call shell-sq,$(PYTHON_CONFIG))
56c7d79e4   Namhyung Kim   perf tools: Fix m...
192

7be6b3166   David Carrillo-Cisneros   perf tools: Pass ...
193
194
195
196
  ifdef PYTHON_CONFIG
    PYTHON_EMBED_LDOPTS := $(shell $(PYTHON_CONFIG_SQ) --ldflags 2>/dev/null)
    PYTHON_EMBED_LDFLAGS := $(call strip-libs,$(PYTHON_EMBED_LDOPTS))
    PYTHON_EMBED_LIBADD := $(call grep-libs,$(PYTHON_EMBED_LDOPTS)) -lutil
32aa928a7   Jeremy Cline   perf tools: Use p...
197
    PYTHON_EMBED_CCOPTS := $(shell $(PYTHON_CONFIG_SQ) --includes 2>/dev/null)
7be6b3166   David Carrillo-Cisneros   perf tools: Pass ...
198
    FLAGS_PYTHON_EMBED := $(PYTHON_EMBED_CCOPTS) $(PYTHON_EMBED_LDOPTS)
8bd8c6533   Arnaldo Carvalho de Melo   tools perf script...
199
  endif
5a155bb77   Wang Nan   perf build: Remov...
200
201
202
203
  FEATURE_CHECK_CFLAGS-libpython := $(PYTHON_EMBED_CCOPTS)
  FEATURE_CHECK_LDFLAGS-libpython := $(PYTHON_EMBED_LDOPTS)
  FEATURE_CHECK_CFLAGS-libpython-version := $(PYTHON_EMBED_CCOPTS)
  FEATURE_CHECK_LDFLAGS-libpython-version := $(PYTHON_EMBED_LDOPTS)
56c7d79e4   Namhyung Kim   perf tools: Fix m...
204

2fe737465   Jiri Olsa   perf tools: Repla...
205
206
207
208
209
210
  CFLAGS += -fno-omit-frame-pointer
  CFLAGS += -ggdb3
  CFLAGS += -funwind-tables
  CFLAGS += -Wall
  CFLAGS += -Wextra
  CFLAGS += -std=gnu99
9c12cf95b   Jiri Olsa   perf tools: Merge...
211

d58ac0bf8   Wang Nan   perf build: Add c...
212
213
214
215
216
217
  CXXFLAGS += -std=gnu++11 -fno-exceptions -fno-rtti
  CXXFLAGS += -Wall
  CXXFLAGS += -fno-omit-frame-pointer
  CXXFLAGS += -ggdb3
  CXXFLAGS += -funwind-tables
  CXXFLAGS += -Wno-strict-aliasing
6392b4ebd   Mathias Krause   perf x86: Fix per...
218
219
220
  # Enforce a non-executable stack, as we may regress (again) in the future by
  # adding assembler files missing the .GNU-stack linker note.
  LDFLAGS += -Wl,-z,noexecstack
5e2d4d0e8   Namhyung Kim   perf tools: Clean...
221
  EXTLIBS = -lpthread -lrt -lm -ldl
362493f0d   Jiri Olsa   perf tools: Move ...
222

96b9e70b8   Jiri Olsa   perf build: Intro...
223
  ifeq ($(FEATURES_DUMP),)
e6c76d620   Jiri Olsa   perf build: Move ...
224
  include $(srctree)/tools/build/Makefile.feature
96b9e70b8   Jiri Olsa   perf build: Intro...
225
226
227
  else
  include $(FEATURES_DUMP)
  endif
baa9c30e1   Ingo Molnar   tools/perf/build:...
228

90ac5422b   Ingo Molnar   tools/perf/build:...
229
  ifeq ($(feature-stackprotector-all), 1)
8e1b3f686   Jiri Olsa   perf tools: Repla...
230
    CFLAGS += -fstack-protector-all
362493f0d   Jiri Olsa   perf tools: Move ...
231
  endif
fcf925850   Ingo Molnar   tools/perf/build:...
232
  ifeq ($(DEBUG),0)
1ea6f99ef   Ingo Molnar   tools/perf/build:...
233
    ifeq ($(feature-fortify-source), 1)
8e1b3f686   Jiri Olsa   perf tools: Repla...
234
235
      CFLAGS += -D_FORTIFY_SOURCE=2
    endif
362493f0d   Jiri Olsa   perf tools: Move ...
236
  endif
e67d52d41   Wang Nan   perf clang: Updat...
237
  INC_FLAGS += -I$(src-perf)/util/include
7a759cd8e   Jiada Wang   perf tools: Fix b...
238
  INC_FLAGS += -I$(src-perf)/arch/$(SRCARCH)/include
e67d52d41   Wang Nan   perf clang: Updat...
239
240
  INC_FLAGS += -I$(srctree)/tools/include/uapi
  INC_FLAGS += -I$(srctree)/tools/include/
7a759cd8e   Jiada Wang   perf tools: Fix b...
241
242
243
  INC_FLAGS += -I$(srctree)/tools/arch/$(SRCARCH)/include/uapi
  INC_FLAGS += -I$(srctree)/tools/arch/$(SRCARCH)/include/
  INC_FLAGS += -I$(srctree)/tools/arch/$(SRCARCH)/
7c53746e6   Jiri Olsa   perf tools: Switc...
244
245
246
247
  
  # $(obj-perf)      for generated common-cmds.h
  # $(obj-perf)/util for generated bison/flex headers
  ifneq ($(OUTPUT),)
e67d52d41   Wang Nan   perf clang: Updat...
248
249
  INC_FLAGS += -I$(obj-perf)/util
  INC_FLAGS += -I$(obj-perf)
7c53746e6   Jiri Olsa   perf tools: Switc...
250
  endif
e67d52d41   Wang Nan   perf clang: Updat...
251
252
253
254
255
256
  INC_FLAGS += -I$(src-perf)/util
  INC_FLAGS += -I$(src-perf)
  INC_FLAGS += -I$(srctree)/tools/lib/
  
  CFLAGS   += $(INC_FLAGS)
  CXXFLAGS += $(INC_FLAGS)
7c53746e6   Jiri Olsa   perf tools: Switc...
257

2fe737465   Jiri Olsa   perf tools: Repla...
258
  CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
362493f0d   Jiri Olsa   perf tools: Move ...
259

f6d313699   Adrian Hunter   perf tools: Add f...
260
261
262
  ifeq ($(feature-sync-compare-and-swap), 1)
    CFLAGS += -DHAVE_SYNC_COMPARE_AND_SWAP_SUPPORT
  endif
459a3df76   Vineet Gupta   perf tools: Provi...
263
264
265
  ifeq ($(feature-pthread-attr-setaffinity-np), 1)
    CFLAGS += -DHAVE_PTHREAD_ATTR_SETAFFINITY_NP
  endif
25ab5abf5   Arnaldo Carvalho de Melo   tools build featu...
266
267
268
  ifeq ($(feature-pthread-barrier), 1)
    CFLAGS += -DHAVE_PTHREAD_BARRIER
  endif
4e22db464   Jiri Olsa   perf tools: Add N...
269
  ifndef NO_BIONIC
5febff006   David Ahern   tools/perf/build:...
270
    $(call feature_check,bionic)
78e9d6550   Ingo Molnar   tools/perf/build:...
271
272
    ifeq ($(feature-bionic), 1)
      BIONIC := 1
e2a1f8d69   Arnaldo Carvalho de Melo   perf tools: Add m...
273
      CFLAGS += -DLACKS_SIGQUEUE_PROTOTYPE
77f14a495   Arnaldo Carvalho de Melo   perf tools: Add m...
274
      CFLAGS += -DLACKS_OPEN_MEMSTREAM_PROTOTYPE
78e9d6550   Ingo Molnar   tools/perf/build:...
275
276
277
      EXTLIBS := $(filter-out -lrt,$(EXTLIBS))
      EXTLIBS := $(filter-out -lpthread,$(EXTLIBS))
    endif
362493f0d   Jiri Olsa   perf tools: Move ...
278
  endif
cf4cca10f   Jiri Olsa   perf tools: Move ...
279
280
  
  ifdef NO_LIBELF
8e1b3f686   Jiri Olsa   perf tools: Repla...
281
282
283
    NO_DWARF := 1
    NO_DEMANGLE := 1
    NO_LIBUNWIND := 1
5ea841540   Jiri Olsa   perf tools: Add l...
284
    NO_LIBDW_DWARF_UNWIND := 1
ed63f34c0   Wang Nan   perf tools: Make ...
285
    NO_LIBBPF := 1
e5e992a7c   David Carrillo-Cisneros   perf tools: Disab...
286
    NO_JVMTI := 1
cf4cca10f   Jiri Olsa   perf tools: Move ...
287
  else
8f7f8005f   Ingo Molnar   tools/perf/build:...
288
    ifeq ($(feature-libelf), 0)
e12762cfd   Ingo Molnar   tools/perf/build:...
289
      ifeq ($(feature-glibc), 1)
50eed7a71   Ingo Molnar   tools/perf/build:...
290
291
292
293
294
295
        LIBC_SUPPORT := 1
      endif
      ifeq ($(BIONIC),1)
        LIBC_SUPPORT := 1
      endif
      ifeq ($(LIBC_SUPPORT),1)
e5e992a7c   David Carrillo-Cisneros   perf tools: Disab...
296
        msg := $(warning No libelf found. Disables 'probe' tool, jvmti and BPF support in 'perf record'. Please install libelf-dev, libelf-devel or elfutils-libelf-devel);
50eed7a71   Ingo Molnar   tools/perf/build:...
297
298
299
300
  
        NO_LIBELF := 1
        NO_DWARF := 1
        NO_DEMANGLE := 1
945895574   Arnaldo Carvalho de Melo   perf callchains: ...
301
302
        NO_LIBUNWIND := 1
        NO_LIBDW_DWARF_UNWIND := 1
ed63f34c0   Wang Nan   perf tools: Make ...
303
        NO_LIBBPF := 1
e5e992a7c   David Carrillo-Cisneros   perf tools: Disab...
304
        NO_JVMTI := 1
50eed7a71   Ingo Molnar   tools/perf/build:...
305
      else
f9ca2d891   Arnaldo Carvalho de Melo   perf tools: Emit ...
306
307
308
309
310
        ifneq ($(filter s% -static%,$(LDFLAGS),),)
          msg := $(error No static glibc found, please install glibc-static);
        else
          msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]);
        endif
50eed7a71   Ingo Molnar   tools/perf/build:...
311
      endif
8e1b3f686   Jiri Olsa   perf tools: Repla...
312
    else
0a4f2b6a3   Jiri Olsa   perf tools: Setup...
313
314
315
316
317
318
      ifndef NO_LIBDW_DWARF_UNWIND
        ifneq ($(feature-libdw-dwarf-unwind),1)
          NO_LIBDW_DWARF_UNWIND := 1
          msg := $(warning No libdw DWARF unwind found, Please install elfutils-devel/libdw-dev >= 0.158 and/or set LIBDW_DIR);
        endif
      endif
8295d4e27   Ingo Molnar   tools/perf/build:...
319
      ifneq ($(feature-dwarf), 1)
2484c4c58   David Carrillo-Cisneros   perf tools: Remov...
320
321
322
323
        ifndef NO_DWARF
          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
        endif
bd0419e2a   Arnaldo Carvalho de Melo   perf probe: Check...
324
325
326
327
      else
        ifneq ($(feature-dwarf_getlocations), 1)
          msg := $(warning Old libdw.h, finding variables at given 'perf probe' point will not work, install elfutils-devel/libdw-dev >= 0.157);
        else
a36ebe4e2   Jin Yao   perf config: Rena...
328
          CFLAGS += -DHAVE_DWARF_GETLOCATIONS_SUPPORT
bd0419e2a   Arnaldo Carvalho de Melo   perf probe: Check...
329
        endif # dwarf_getlocations
50eed7a71   Ingo Molnar   tools/perf/build:...
330
      endif # Dwarf support
0648f839f   Ingo Molnar   tools/perf/build:...
331
    endif # libelf support
cf4cca10f   Jiri Olsa   perf tools: Move ...
332
  endif # NO_LIBELF
8e2c241f0   Jin Yao   perf config: Add ...
333
334
335
  ifeq ($(feature-glibc), 1)
    CFLAGS += -DHAVE_GLIBC_SUPPORT
  endif
76d408498   Naveen N. Rao   perf build: Disab...
336
337
338
  ifdef NO_DWARF
    NO_LIBDW_DWARF_UNWIND := 1
  endif
120010cb1   Arnaldo Carvalho de Melo   tools build: Add ...
339
340
341
  ifeq ($(feature-sched_getcpu), 1)
    CFLAGS += -DHAVE_SCHED_GETCPU_SUPPORT
  endif
86bcdb5a4   Arnaldo Carvalho de Melo   tools build: Add ...
342
343
344
345
  ifeq ($(feature-setns), 1)
    CFLAGS += -DHAVE_SETNS_SUPPORT
    $(call detected,CONFIG_SETNS)
  endif
aa6292f48   Mathieu Poirier   perf tools: Integ...
346
347
348
349
350
351
352
353
354
355
356
357
358
359
  ifndef NO_CORESIGHT
    ifeq ($(feature-libopencsd), 1)
      CFLAGS += -DHAVE_CSTRACE_SUPPORT $(LIBOPENCSD_CFLAGS)
      LDFLAGS += $(LIBOPENCSD_LDFLAGS)
      EXTLIBS += $(OPENCSDLIBS)
      $(call detected,CONFIG_LIBOPENCSD)
      ifdef CSTRACE_RAW
        CFLAGS += -DCS_DEBUG_RAW
        ifeq (${CSTRACE_RAW}, packed)
          CFLAGS += -DCS_RAW_PACKED
        endif
      endif
    endif
  endif
cf4cca10f   Jiri Olsa   perf tools: Move ...
360
  ifndef NO_LIBELF
fb3d333b3   Ingo Molnar   tools/perf/build:...
361
    CFLAGS += -DHAVE_LIBELF_SUPPORT
5e2d4d0e8   Namhyung Kim   perf tools: Clean...
362
    EXTLIBS += -lelf
709e67919   Jiri Olsa   perf build: Add p...
363
    $(call detected,CONFIG_LIBELF)
779724fd0   Jiri Olsa   perf tools: Move ...
364

8869b17ee   Ingo Molnar   tools/perf/build:...
365
    ifeq ($(feature-libelf-mmap), 1)
fb3d333b3   Ingo Molnar   tools/perf/build:...
366
367
      CFLAGS += -DHAVE_LIBELF_MMAP_SUPPORT
    endif
779724fd0   Jiri Olsa   perf tools: Move ...
368

b7bcef6f8   Ingo Molnar   tools/perf/build:...
369
    ifeq ($(feature-libelf-getphdrnum), 1)
fb3d333b3   Ingo Molnar   tools/perf/build:...
370
371
      CFLAGS += -DHAVE_ELF_GETPHDRNUM_SUPPORT
    endif
1c1a3a472   Arnaldo Carvalho de Melo   perf tools: Add f...
372
373
374
375
376
    ifeq ($(feature-libelf-gelf_getnote), 1)
      CFLAGS += -DHAVE_GELF_GETNOTE_SUPPORT
    else
      msg := $(warning gelf_getnote() not found on libelf, SDT support disabled);
    endif
2492c465a   Arnaldo Carvalho de Melo   perf build: Add f...
377
378
379
    ifeq ($(feature-libelf-getshdrstrndx), 1)
      CFLAGS += -DHAVE_ELF_GETSHDRSTRNDX_SUPPORT
    endif
fb3d333b3   Ingo Molnar   tools/perf/build:...
380
381
    ifndef NO_DWARF
      ifeq ($(origin PERF_HAVE_DWARF_REGS), undefined)
7a759cd8e   Jiada Wang   perf tools: Fix b...
382
        msg := $(warning DWARF register mappings have not been defined for architecture $(SRCARCH), DWARF support disabled);
fb3d333b3   Ingo Molnar   tools/perf/build:...
383
384
385
386
        NO_DWARF := 1
      else
        CFLAGS += -DHAVE_DWARF_SUPPORT $(LIBDW_CFLAGS)
        LDFLAGS += $(LIBDW_LDFLAGS)
7aec51cbf   Andi Kleen   perf tools: Suppo...
387
        EXTLIBS += ${DWARFLIBS}
8379fce48   Jiri Olsa   perf build: Add d...
388
        $(call detected,CONFIG_DWARF)
fb3d333b3   Ingo Molnar   tools/perf/build:...
389
390
      endif # PERF_HAVE_DWARF_REGS
    endif # NO_DWARF
ed63f34c0   Wang Nan   perf tools: Make ...
391
392
393
394
395
396
  
    ifndef NO_LIBBPF
      ifeq ($(feature-bpf), 1)
        CFLAGS += -DHAVE_LIBBPF_SUPPORT
        $(call detected,CONFIG_LIBBPF)
      endif
1c0ed6323   Wang Nan   perf bpf: Add BPF...
397
398
399
400
401
402
  
      ifndef NO_DWARF
        ifdef PERF_HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET
          CFLAGS += -DHAVE_BPF_PROLOGUE
          $(call detected,CONFIG_BPF_PROLOGUE)
        else
7a759cd8e   Jiada Wang   perf tools: Fix b...
403
          msg := $(warning BPF prologue is not supported by architecture $(SRCARCH), missing regs_query_register_offset());
1c0ed6323   Wang Nan   perf bpf: Add BPF...
404
405
406
407
        endif
      else
        msg := $(warning DWARF support is off, BPF prologue is disabled);
      endif
ed63f34c0   Wang Nan   perf tools: Make ...
408
    endif # NO_LIBBPF
cf4cca10f   Jiri Olsa   perf tools: Move ...
409
  endif # NO_LIBELF
0e433feb1   Jiri Olsa   perf tools: Move ...
410

e26e63be6   Masami Hiramatsu   perf build: Add s...
411
412
413
414
415
416
417
418
419
  ifndef NO_SDT
    ifneq ($(feature-sdt), 1)
      msg := $(warning No sys/sdt.h found, no SDT events are defined, please install systemtap-sdt-devel or systemtap-sdt-dev);
      NO_SDT := 1;
    else
      CFLAGS += -DHAVE_SDT_EVENT
      $(call detected,CONFIG_SDT_EVENT)
    endif
  endif
e12b202f8   Jiri Olsa   perf jitdump: Bui...
420
  ifdef PERF_HAVE_JITDUMP
621cb4e78   Maciej Debski   perf jit: Enable ...
421
    ifndef NO_LIBELF
e12b202f8   Jiri Olsa   perf jitdump: Bui...
422
423
424
425
      $(call detected,CONFIG_JITDUMP)
      CFLAGS += -DHAVE_JITDUMP
    endif
  endif
7a759cd8e   Jiada Wang   perf tools: Fix b...
426
  ifeq ($(SRCARCH),powerpc)
65ccb4faa   Anton Blanchard   perf tools powerp...
427
428
429
430
    ifndef NO_DWARF
      CFLAGS += -DHAVE_SKIP_CALLCHAIN_IDX
    endif
  endif
0e433feb1   Jiri Olsa   perf tools: Move ...
431
  ifndef NO_LIBUNWIND
9d8e14d30   He Kuang   perf unwind: Sepa...
432
    have_libunwind :=
52ffe0ff0   He Kuang   perf callchain: S...
433
434
435
436
437
  
    ifeq ($(feature-libunwind-x86), 1)
      $(call detected,CONFIG_LIBUNWIND_X86)
      CFLAGS += -DHAVE_LIBUNWIND_X86_SUPPORT
      LDFLAGS += -lunwind-x86
906a82764   He Kuang   perf unwind: Fix ...
438
      EXTLIBS_LIBUNWIND += -lunwind-x86
52ffe0ff0   He Kuang   perf callchain: S...
439
440
      have_libunwind = 1
    endif
057fbfb25   He Kuang   perf callchain: S...
441
442
443
444
    ifeq ($(feature-libunwind-aarch64), 1)
      $(call detected,CONFIG_LIBUNWIND_AARCH64)
      CFLAGS += -DHAVE_LIBUNWIND_AARCH64_SUPPORT
      LDFLAGS += -lunwind-aarch64
906a82764   He Kuang   perf unwind: Fix ...
445
      EXTLIBS_LIBUNWIND += -lunwind-aarch64
057fbfb25   He Kuang   perf callchain: S...
446
447
448
449
450
451
452
      have_libunwind = 1
      $(call feature_check,libunwind-debug-frame-aarch64)
      ifneq ($(feature-libunwind-debug-frame-aarch64), 1)
        msg := $(warning No debug_frame support found in libunwind-aarch64);
        CFLAGS += -DNO_LIBUNWIND_DEBUG_FRAME_AARCH64
      endif
    endif
058f952de   Ingo Molnar   tools/perf/build:...
453
    ifneq ($(feature-libunwind), 1)
0a4f2b6a3   Jiri Olsa   perf tools: Setup...
454
      msg := $(warning No libunwind found. Please install libunwind-dev[el] >= 1.1 and/or set LIBUNWIND_DIR);
9d8e14d30   He Kuang   perf unwind: Sepa...
455
456
457
458
459
460
461
      NO_LOCAL_LIBUNWIND := 1
    else
      have_libunwind := 1
      $(call detected,CONFIG_LOCAL_LIBUNWIND)
    endif
  
    ifneq ($(have_libunwind), 1)
308e1e700   Ingo Molnar   tools/perf/build:...
462
      NO_LIBUNWIND := 1
0a4f2b6a3   Jiri Olsa   perf tools: Setup...
463
    endif
9d8e14d30   He Kuang   perf unwind: Sepa...
464
465
  else
    NO_LOCAL_LIBUNWIND := 1
0a4f2b6a3   Jiri Olsa   perf tools: Setup...
466
  endif
ed63f34c0   Wang Nan   perf tools: Make ...
467
468
469
470
471
472
  ifndef NO_LIBBPF
    ifneq ($(feature-bpf), 1)
      msg := $(warning BPF API too old. Please install recent kernel headers. BPF support in 'perf record' is disabled.)
      NO_LIBBPF := 1
    endif
  endif
0a4f2b6a3   Jiri Olsa   perf tools: Setup...
473
474
475
476
477
478
479
480
  dwarf-post-unwind := 1
  dwarf-post-unwind-text := BUG
  
  # setup DWARF post unwinder
  ifdef NO_LIBUNWIND
    ifdef NO_LIBDW_DWARF_UNWIND
      msg := $(warning Disabling post unwind, no support found.);
      dwarf-post-unwind := 0
f47671e2d   Linus Torvalds   Merge branch 'for...
481
    else
0a4f2b6a3   Jiri Olsa   perf tools: Setup...
482
      dwarf-post-unwind-text := libdw
b2e45c322   Jiri Olsa   perf build: Add d...
483
      $(call detected,CONFIG_LIBDW_DWARF_UNWIND)
0a4f2b6a3   Jiri Olsa   perf tools: Setup...
484
485
486
    endif
  else
    dwarf-post-unwind-text := libunwind
b2e45c322   Jiri Olsa   perf build: Add d...
487
    $(call detected,CONFIG_LIBUNWIND)
0a4f2b6a3   Jiri Olsa   perf tools: Setup...
488
489
490
491
492
493
494
495
    # Enable libunwind support by default.
    ifndef NO_LIBDW_DWARF_UNWIND
      NO_LIBDW_DWARF_UNWIND := 1
    endif
  endif
  
  ifeq ($(dwarf-post-unwind),1)
    CFLAGS += -DHAVE_DWARF_UNWIND_SUPPORT
f39e042a1   Jiri Olsa   perf build: Add t...
496
    $(call detected,CONFIG_DWARF_UNWIND)
0a4f2b6a3   Jiri Olsa   perf tools: Setup...
497
498
499
  else
    NO_DWARF_UNWIND := 1
  endif
9d8e14d30   He Kuang   perf unwind: Sepa...
500
  ifndef NO_LOCAL_LIBUNWIND
7a759cd8e   Jiada Wang   perf tools: Fix b...
501
    ifeq ($(SRCARCH),$(filter $(SRCARCH),arm arm64))
0a4f2b6a3   Jiri Olsa   perf tools: Setup...
502
503
504
      $(call feature_check,libunwind-debug-frame)
      ifneq ($(feature-libunwind-debug-frame), 1)
        msg := $(warning No debug_frame support found in libunwind);
f47671e2d   Linus Torvalds   Merge branch 'for...
505
506
        CFLAGS += -DNO_LIBUNWIND_DEBUG_FRAME
      endif
0a4f2b6a3   Jiri Olsa   perf tools: Setup...
507
508
509
510
    else
      # non-ARM has no dwarf_find_debug_frame() function:
      CFLAGS += -DNO_LIBUNWIND_DEBUG_FRAME
    endif
0a4f2b6a3   Jiri Olsa   perf tools: Setup...
511
    EXTLIBS += $(LIBUNWIND_LIBS)
9d8e14d30   He Kuang   perf unwind: Sepa...
512
513
    LDFLAGS += $(LIBUNWIND_LIBS)
  endif
60913e005   Konstantin Khlebnikov   perf tools: Fix s...
514
515
516
517
  ifeq ($(findstring -static,${LDFLAGS}),-static)
    # gcc -static links libgcc_eh which contans piece of libunwind
    LIBUNWIND_LDFLAGS += -Wl,--allow-multiple-definition
  endif
9d8e14d30   He Kuang   perf unwind: Sepa...
518
519
520
  
  ifndef NO_LIBUNWIND
    CFLAGS  += -DHAVE_LIBUNWIND_SUPPORT
0a4f2b6a3   Jiri Olsa   perf tools: Setup...
521
522
    CFLAGS  += $(LIBUNWIND_CFLAGS)
    LDFLAGS += $(LIBUNWIND_LDFLAGS)
906a82764   He Kuang   perf unwind: Fix ...
523
    EXTLIBS += $(EXTLIBS_LIBUNWIND)
058f952de   Ingo Molnar   tools/perf/build:...
524
  endif
a8279525f   Jiri Olsa   perf tools: Move ...
525

b3fa38963   Hendrik Brueckner   perf trace: Remov...
526
527
528
529
530
531
532
533
534
535
536
537
  ifeq ($(NO_SYSCALL_TABLE),0)
    $(call detected,CONFIG_TRACE)
  else
    ifndef NO_LIBAUDIT
      ifneq ($(feature-libaudit), 1)
        msg := $(warning No libaudit.h found, disables 'trace' tool, please install audit-libs-devel or libaudit-dev);
        NO_LIBAUDIT := 1
      else
        CFLAGS += -DHAVE_LIBAUDIT_SUPPORT
        EXTLIBS += -laudit
        $(call detected,CONFIG_TRACE)
      endif
8e1b3f686   Jiri Olsa   perf tools: Repla...
538
    endif
a8279525f   Jiri Olsa   perf tools: Move ...
539
  endif
4a8f888a6   Jiri Olsa   perf tools: Move ...
540

8ee464603   Stephane Eranian   perf build: Add l...
541
542
543
544
545
546
547
548
549
550
  ifndef NO_LIBCRYPTO
    ifneq ($(feature-libcrypto), 1)
      msg := $(warning No libcrypto.h found, disables jitted code injection, please install libssl-devel or libssl-dev);
      NO_LIBCRYPTO := 1
    else
      CFLAGS += -DHAVE_LIBCRYPTO_SUPPORT
      EXTLIBS += -lcrypto
      $(call detected,CONFIG_CRYPTO)
    endif
  endif
4a8f888a6   Jiri Olsa   perf tools: Move ...
551
  ifdef NO_NEWT
8e1b3f686   Jiri Olsa   perf tools: Repla...
552
    NO_SLANG=1
4a8f888a6   Jiri Olsa   perf tools: Move ...
553
554
555
  endif
  
  ifndef NO_SLANG
b9498b508   Ingo Molnar   tools/perf/build:...
556
    ifneq ($(feature-libslang), 1)
9f776ba11   Neeraj Badlani   perf tools: Updat...
557
      msg := $(warning slang not found, disables TUI support. Please install slang-devel, libslang-dev or libslang2-dev);
8e1b3f686   Jiri Olsa   perf tools: Repla...
558
559
560
561
      NO_SLANG := 1
    else
      # Fedora has /usr/include/slang/slang.h, but ubuntu /usr/include/slang.h
      CFLAGS += -I/usr/include/slang
89fe808ae   Ingo Molnar   tools/perf: Stand...
562
      CFLAGS += -DHAVE_SLANG_SUPPORT
8e1b3f686   Jiri Olsa   perf tools: Repla...
563
      EXTLIBS += -lslang
cf15c74cb   Jiri Olsa   perf build: Add s...
564
      $(call detected,CONFIG_SLANG)
8e1b3f686   Jiri Olsa   perf tools: Repla...
565
    endif
4a8f888a6   Jiri Olsa   perf tools: Move ...
566
  endif
58cabf6ab   Jiri Olsa   perf tools: Move ...
567
568
  
  ifndef NO_GTK2
a8a5cd8b4   Mark Rutland   perf: tools: Fix ...
569
    FLAGS_GTK2=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null)
7ef9e055c   Ingo Molnar   tools/perf/build:...
570
    ifneq ($(feature-gtk2), 1)
8e1b3f686   Jiri Olsa   perf tools: Repla...
571
572
573
      msg := $(warning GTK2 not found, disables GTK2 support. Please install gtk2-devel or libgtk2.0-dev);
      NO_GTK2 := 1
    else
c7a79e96d   Ingo Molnar   tools/perf/build:...
574
      ifeq ($(feature-gtk2-infobar), 1)
fc67297b1   Namhyung Kim   perf tools: Separ...
575
        GTK_CFLAGS := -DHAVE_GTK_INFO_BAR_SUPPORT
8e1b3f686   Jiri Olsa   perf tools: Repla...
576
      endif
89fe808ae   Ingo Molnar   tools/perf: Stand...
577
      CFLAGS += -DHAVE_GTK2_SUPPORT
a8a5cd8b4   Mark Rutland   perf: tools: Fix ...
578
579
      GTK_CFLAGS += $(shell $(PKG_CONFIG) --cflags gtk+-2.0 2>/dev/null)
      GTK_LIBS := $(shell $(PKG_CONFIG) --libs gtk+-2.0 2>/dev/null)
e2137086b   Jiri Olsa   perf tools: Add m...
580
      EXTLIBS += -ldl
8e1b3f686   Jiri Olsa   perf tools: Repla...
581
    endif
58cabf6ab   Jiri Olsa   perf tools: Move ...
582
  endif
3082cb339   Jiri Olsa   perf tools: Move ...
583

3082cb339   Jiri Olsa   perf tools: Move ...
584
  ifdef NO_LIBPERL
8e1b3f686   Jiri Olsa   perf tools: Repla...
585
    CFLAGS += -DNO_LIBPERL
3082cb339   Jiri Olsa   perf tools: Move ...
586
  else
8e1b3f686   Jiri Olsa   perf tools: Repla...
587
588
589
    PERL_EMBED_LDOPTS = $(shell perl -MExtUtils::Embed -e ldopts 2>/dev/null)
    PERL_EMBED_LDFLAGS = $(call strip-libs,$(PERL_EMBED_LDOPTS))
    PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS))
86f5fe01c   Jiri Olsa   perf tools: Use s...
590
    PERL_EMBED_CCOPTS = $(shell perl -MExtUtils::Embed -e ccopts 2>/dev/null)
c6707fdef   Jiri Olsa   perf tools: Fix u...
591
592
    PERL_EMBED_CCOPTS := $(filter-out -specs=%,$(PERL_EMBED_CCOPTS))
    PERL_EMBED_LDOPTS := $(filter-out -specs=%,$(PERL_EMBED_LDOPTS))
8e1b3f686   Jiri Olsa   perf tools: Repla...
593
    FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS)
7181a6714   Ingo Molnar   tools/perf/build:...
594
    ifneq ($(feature-libperl), 1)
8e1b3f686   Jiri Olsa   perf tools: Repla...
595
596
      CFLAGS += -DNO_LIBPERL
      NO_LIBPERL := 1
a954e6840   Ingo Molnar   perf tools: Impro...
597
      msg := $(warning Missing perl devel files. Disabling perl scripting support, please install perl-ExtUtils-Embed/libperl-dev);
8e1b3f686   Jiri Olsa   perf tools: Repla...
598
599
600
    else
      LDFLAGS += $(PERL_EMBED_LDFLAGS)
      EXTLIBS += $(PERL_EMBED_LIBADD)
8e2c241f0   Jin Yao   perf config: Add ...
601
      CFLAGS += -DHAVE_LIBPERL_SUPPORT
c7355f842   Jiri Olsa   perf build: Add s...
602
      $(call detected,CONFIG_LIBPERL)
8e1b3f686   Jiri Olsa   perf tools: Repla...
603
    endif
3082cb339   Jiri Olsa   perf tools: Move ...
604
  endif
6e533cf12   Jiri Olsa   perf tools: Move ...
605

87419c9af   David Ahern   perf kvm: Disable...
606
607
608
609
610
  ifeq ($(feature-timerfd), 1)
    CFLAGS += -DHAVE_TIMERFD_SUPPORT
  else
    msg := $(warning No timerfd support. Disables 'perf kvm stat live');
  endif
6e533cf12   Jiri Olsa   perf tools: Move ...
611
612
  disable-python = $(eval $(disable-python_code))
  define disable-python_code
9c12cf95b   Jiri Olsa   perf tools: Merge...
613
    CFLAGS += -DNO_LIBPYTHON
6c5aa2370   Ingo Molnar   perf tools: Impro...
614
    $(warning $1)
6e533cf12   Jiri Olsa   perf tools: Move ...
615
616
    NO_LIBPYTHON := 1
  endef
56c7d79e4   Namhyung Kim   perf tools: Fix m...
617
  ifdef NO_LIBPYTHON
6c5aa2370   Ingo Molnar   perf tools: Impro...
618
    $(call disable-python,Python support disabled by user)
6e533cf12   Jiri Olsa   perf tools: Move ...
619
  else
56c7d79e4   Namhyung Kim   perf tools: Fix m...
620
    ifndef PYTHON
6c5aa2370   Ingo Molnar   perf tools: Impro...
621
      $(call disable-python,No python interpreter was found: disables Python support - please install python-devel/python-dev)
6e533cf12   Jiri Olsa   perf tools: Move ...
622
    else
56c7d79e4   Namhyung Kim   perf tools: Fix m...
623
      PYTHON_WORD := $(call shell-wordify,$(PYTHON))
6e533cf12   Jiri Olsa   perf tools: Move ...
624
625
  
      ifndef PYTHON_CONFIG
6c5aa2370   Ingo Molnar   perf tools: Impro...
626
        $(call disable-python,No 'python-config' tool was found: disables Python support - please install python-devel/python-dev)
6e533cf12   Jiri Olsa   perf tools: Move ...
627
      else
9734163b6   Ingo Molnar   tools/perf/build:...
628
        ifneq ($(feature-libpython), 1)
6c5aa2370   Ingo Molnar   perf tools: Impro...
629
          $(call disable-python,No 'Python.h' (for Python 2.x support) was found: disables Python support - please install python-devel/python-dev)
6e533cf12   Jiri Olsa   perf tools: Move ...
630
        else
66dfdff03   Jaroslav Å karvada   perf tools: Add P...
631
632
633
           LDFLAGS += $(PYTHON_EMBED_LDFLAGS)
           EXTLIBS += $(PYTHON_EMBED_LIBADD)
           LANG_BINDINGS += $(obj-perf)python/perf.so
8e2c241f0   Jin Yao   perf config: Add ...
634
           CFLAGS += -DHAVE_LIBPYTHON_SUPPORT
66dfdff03   Jaroslav Å karvada   perf tools: Add P...
635
           $(call detected,CONFIG_LIBPYTHON)
6e533cf12   Jiri Olsa   perf tools: Move ...
636
637
638
639
        endif
      endif
    endif
  endif
c3cf83684   Jiri Olsa   perf tools: Move ...
640

3e6a147de   Jiri Olsa   perf tools: Separ...
641
  ifeq ($(feature-libbfd), 1)
2cf904071   Jiri Olsa   perf tools: Fix b...
642
    EXTLIBS += -lbfd
303d29d8f   Stanislav Fomichev   perf build: Don't...
643
644
645
  else
    # we are on a system that requires -liberty and (maybe) -lz
    # to link against -lbfd; test each case individually here
2cf904071   Jiri Olsa   perf tools: Fix b...
646
647
648
  
    # call all detections now so we get correct
    # status in VF output
303d29d8f   Stanislav Fomichev   perf build: Don't...
649
650
    $(call feature_check,libbfd-liberty)
    $(call feature_check,libbfd-liberty-z)
2cf904071   Jiri Olsa   perf tools: Fix b...
651

303d29d8f   Stanislav Fomichev   perf build: Don't...
652
653
    ifeq ($(feature-libbfd-liberty), 1)
      EXTLIBS += -lbfd -liberty
2cf904071   Jiri Olsa   perf tools: Fix b...
654
    else
303d29d8f   Stanislav Fomichev   perf build: Don't...
655
656
      ifeq ($(feature-libbfd-liberty-z), 1)
        EXTLIBS += -lbfd -liberty -lz
2cf904071   Jiri Olsa   perf tools: Fix b...
657
658
      endif
    endif
3e6a147de   Jiri Olsa   perf tools: Separ...
659
  endif
c3cf83684   Jiri Olsa   perf tools: Move ...
660
  ifdef NO_DEMANGLE
8e1b3f686   Jiri Olsa   perf tools: Repla...
661
    CFLAGS += -DNO_DEMANGLE
c3cf83684   Jiri Olsa   perf tools: Move ...
662
  else
89fe808ae   Ingo Molnar   tools/perf: Stand...
663
    ifdef HAVE_CPLUS_DEMANGLE_SUPPORT
8e1b3f686   Jiri Olsa   perf tools: Repla...
664
      EXTLIBS += -liberty
8e1b3f686   Jiri Olsa   perf tools: Repla...
665
    else
303d29d8f   Stanislav Fomichev   perf build: Don't...
666
667
668
669
670
671
672
673
674
675
      ifeq ($(filter -liberty,$(EXTLIBS)),)
        $(call feature_check,cplus-demangle)
  
        # we dont have neither HAVE_CPLUS_DEMANGLE_SUPPORT
        # or any of 'bfd iberty z' trinity
        ifeq ($(feature-cplus-demangle), 1)
          EXTLIBS += -liberty
        else
          msg := $(warning No bfd.h/libbfd found, please install binutils-dev[el]/zlib-static/libiberty-dev to gain symbol demangling)
          CFLAGS += -DNO_DEMANGLE
8e1b3f686   Jiri Olsa   perf tools: Repla...
676
677
678
        endif
      endif
    endif
303d29d8f   Stanislav Fomichev   perf build: Don't...
679
680
681
682
  
    ifneq ($(filter -liberty,$(EXTLIBS)),)
      CFLAGS += -DHAVE_CPLUS_DEMANGLE_SUPPORT
    endif
c3cf83684   Jiri Olsa   perf tools: Move ...
683
  endif
a1c7c9e7e   Jiri Olsa   perf tools: Move ...
684

3e6a147de   Jiri Olsa   perf tools: Separ...
685
686
687
  ifneq ($(filter -lbfd,$(EXTLIBS)),)
    CFLAGS += -DHAVE_LIBBFD_SUPPORT
  endif
e92ce12ed   Namhyung Kim   perf tools: Add g...
688
689
690
691
  ifndef NO_ZLIB
    ifeq ($(feature-zlib), 1)
      CFLAGS += -DHAVE_ZLIB_SUPPORT
      EXTLIBS += -lz
1571b6950   Jiri Olsa   perf build: Add z...
692
      $(call detected,CONFIG_ZLIB)
e92ce12ed   Namhyung Kim   perf tools: Add g...
693
694
695
696
    else
      NO_ZLIB := 1
    endif
  endif
80a32e5b4   Jiri Olsa   perf tools: Add l...
697
698
699
700
701
702
703
704
705
706
  ifndef NO_LZMA
    ifeq ($(feature-lzma), 1)
      CFLAGS += -DHAVE_LZMA_SUPPORT
      EXTLIBS += -llzma
      $(call detected,CONFIG_LZMA)
    else
      msg := $(warning No liblzma found, disables xz kernel module decompression, please install xz-devel/liblzma-dev);
      NO_LZMA := 1
    endif
  endif
a1c7c9e7e   Jiri Olsa   perf tools: Move ...
707
  ifndef NO_BACKTRACE
4cc9117a3   Ingo Molnar   tools/perf/build:...
708
    ifeq ($(feature-backtrace), 1)
89fe808ae   Ingo Molnar   tools/perf: Stand...
709
      CFLAGS += -DHAVE_BACKTRACE_SUPPORT
8e1b3f686   Jiri Olsa   perf tools: Repla...
710
    endif
a1c7c9e7e   Jiri Olsa   perf tools: Move ...
711
  endif
58a0abd73   Jiri Olsa   perf tools: Move ...
712
713
  
  ifndef NO_LIBNUMA
3ae069cfd   Ingo Molnar   tools/perf/build:...
714
    ifeq ($(feature-libnuma), 0)
6305edfc4   Dongsheng Yang   perf tools: Corre...
715
      msg := $(warning No numa.h found, disables 'perf bench numa mem' benchmark, please install numactl-devel/libnuma-devel/libnuma-dev);
8e1b3f686   Jiri Olsa   perf tools: Repla...
716
717
      NO_LIBNUMA := 1
    else
f8ac8606f   Arnaldo Carvalho de Melo   tools build: Add ...
718
719
720
721
722
723
724
725
      ifeq ($(feature-numa_num_possible_cpus), 0)
        msg := $(warning Old numa library found, disables 'perf bench numa mem' benchmark, please install numactl-devel/libnuma-devel/libnuma-dev >= 2.0.8);
        NO_LIBNUMA := 1
      else
        CFLAGS += -DHAVE_LIBNUMA_SUPPORT
        EXTLIBS += -lnuma
        $(call detected,CONFIG_NUMA)
      endif
8e1b3f686   Jiri Olsa   perf tools: Repla...
726
    endif
58a0abd73   Jiri Olsa   perf tools: Move ...
727
  endif
cd1c39f2c   Jiri Olsa   perf tools: Move ...
728

da50ad697   Alexander Yarygin   perf kvm: Introdu...
729
730
731
  ifdef HAVE_KVM_STAT_SUPPORT
      CFLAGS += -DHAVE_KVM_STAT_SUPPORT
  endif
e477f3f01   Adrian Hunter   perf tools: Build...
732
733
734
  ifeq (${IS_64_BIT}, 1)
    ifndef NO_PERF_READ_VDSO32
      $(call feature_check,compile-32)
46b1fa85f   Adrian Hunter   perf tools: Do no...
735
736
737
      ifeq ($(feature-compile-32), 1)
        CFLAGS += -DHAVE_PERF_READ_VDSO32
      else
e477f3f01   Adrian Hunter   perf tools: Build...
738
739
740
        NO_PERF_READ_VDSO32 := 1
      endif
    endif
7a759cd8e   Jiada Wang   perf tools: Fix b...
741
    ifneq ($(SRCARCH), x86)
e477f3f01   Adrian Hunter   perf tools: Build...
742
743
744
745
      NO_PERF_READ_VDSOX32 := 1
    endif
    ifndef NO_PERF_READ_VDSOX32
      $(call feature_check,compile-x32)
46b1fa85f   Adrian Hunter   perf tools: Do no...
746
747
748
      ifeq ($(feature-compile-x32), 1)
        CFLAGS += -DHAVE_PERF_READ_VDSOX32
      else
e477f3f01   Adrian Hunter   perf tools: Build...
749
750
751
752
753
754
755
        NO_PERF_READ_VDSOX32 := 1
      endif
    endif
  else
    NO_PERF_READ_VDSO32 := 1
    NO_PERF_READ_VDSOX32 := 1
  endif
24787afbc   Jiri Olsa   perf tools: Enabl...
756
  ifndef NO_LIBBABELTRACE
97e7a5153   Jiri Olsa   perf build: Disab...
757
758
    $(call feature_check,libbabeltrace)
    ifeq ($(feature-libbabeltrace), 1)
53d0a5734   Jiri Olsa   perf tools: Add f...
759
760
761
      CFLAGS += -DHAVE_LIBBABELTRACE_SUPPORT $(LIBBABELTRACE_CFLAGS)
      LDFLAGS += $(LIBBABELTRACE_LDFLAGS)
      EXTLIBS += -lbabeltrace-ctf
edbe9817a   Jiri Olsa   perf data: Add pe...
762
      $(call detected,CONFIG_LIBBABELTRACE)
97e7a5153   Jiri Olsa   perf build: Disab...
763
764
    else
      msg := $(warning No libbabeltrace found, disables 'perf data' CTF format support, please install libbabeltrace-dev[el]/libbabeltrace-ctf-dev);
53d0a5734   Jiri Olsa   perf tools: Add f...
765
766
    endif
  endif
e31f0d017   Adrian Hunter   perf tools: Add b...
767
  ifndef NO_AUXTRACE
7a759cd8e   Jiada Wang   perf tools: Fix b...
768
    ifeq ($(SRCARCH),x86)
08d5204ad   Mathieu Poirier   perf tools: Confi...
769
770
771
772
773
774
      ifeq ($(feature-get_cpuid), 0)
        msg := $(warning Your gcc lacks the __get_cpuid() builtin, disables support for auxtrace/Intel PT, please install a newer gcc);
        NO_AUXTRACE := 1
      endif
    endif
    ifndef NO_AUXTRACE
b0063dbfb   Arnaldo Carvalho de Melo   tools build: Add ...
775
776
777
      $(call detected,CONFIG_AUXTRACE)
      CFLAGS += -DHAVE_AUXTRACE_SUPPORT
    endif
e31f0d017   Adrian Hunter   perf tools: Add b...
778
  endif
d4dfdf00d   Jiri Olsa   perf jvmti: Plug ...
779
780
781
782
783
  ifndef NO_JVMTI
    ifneq (,$(wildcard /usr/sbin/update-java-alternatives))
      JDIR=$(shell /usr/sbin/update-java-alternatives -l | head -1 | awk '{print $$3}')
    else
      ifneq (,$(wildcard /usr/sbin/alternatives))
36b8d4628   Jarod Wilson   perf tools: Fix u...
784
        JDIR=$(shell /usr/sbin/alternatives --display java | tail -1 | cut -d' ' -f 5 | sed 's%/jre/bin/java.%%g')
d4dfdf00d   Jiri Olsa   perf jvmti: Plug ...
785
786
787
788
789
790
791
792
793
794
795
796
797
798
      endif
    endif
    ifndef JDIR
      $(warning No alternatives command found, you need to set JDIR= to point to the root of your Java directory)
      NO_JVMTI := 1
    endif
  endif
  
  ifndef NO_JVMTI
    FEATURE_CHECK_CFLAGS-jvmti := -I$(JDIR)/include -I$(JDIR)/include/linux
    $(call feature_check,jvmti)
    ifeq ($(feature-jvmti), 1)
      $(call detected_var,JDIR)
    else
e14b733c5   Arnaldo Carvalho de Melo   perf jvmti: Give ...
799
      $(warning No openjdk development package found, please install JDK package, e.g. openjdk-8-jdk, java-1.8.0-openjdk-devel)
d4dfdf00d   Jiri Olsa   perf jvmti: Plug ...
800
801
802
      NO_JVMTI := 1
    endif
  endif
d58ac0bf8   Wang Nan   perf build: Add c...
803
804
805
806
807
808
809
810
  USE_CXX = 0
  USE_CLANGLLVM = 0
  ifdef LIBCLANGLLVM
    $(call feature_check,cxx)
    ifneq ($(feature-cxx), 1)
      msg := $(warning No g++ found, disable clang and llvm support. Please install g++)
    else
      $(call feature_check,llvm)
a940cad33   Wang Nan   perf build: Check...
811
      $(call feature_check,llvm-version)
d58ac0bf8   Wang Nan   perf build: Add c...
812
      ifneq ($(feature-llvm), 1)
a940cad33   Wang Nan   perf build: Check...
813
        msg := $(warning No suitable libLLVM found, disabling builtin clang and LLVM support. Please install llvm-dev(el) (>= 3.9.0))
d58ac0bf8   Wang Nan   perf build: Add c...
814
815
816
      else
        $(call feature_check,clang)
        ifneq ($(feature-clang), 1)
a940cad33   Wang Nan   perf build: Check...
817
          msg := $(warning No suitable libclang found, disabling builtin clang and LLVM support. Please install libclang-dev(el) (>= 3.9.0))
d58ac0bf8   Wang Nan   perf build: Add c...
818
819
820
821
822
823
824
825
        else
          CFLAGS += -DHAVE_LIBCLANGLLVM_SUPPORT
          CXXFLAGS += -DHAVE_LIBCLANGLLVM_SUPPORT -I$(shell $(LLVM_CONFIG) --includedir)
          $(call detected,CONFIG_CXX)
          $(call detected,CONFIG_CLANGLLVM)
  	USE_CXX = 1
  	USE_LLVM = 1
  	USE_CLANG = 1
a940cad33   Wang Nan   perf build: Check...
826
827
828
          ifneq ($(feature-llvm-version),1)
            msg := $(warning This version of LLVM is not tested. May cause build errors)
          endif
d58ac0bf8   Wang Nan   perf build: Add c...
829
830
831
832
        endif
      endif
    endif
  endif
cd1c39f2c   Jiri Olsa   perf tools: Move ...
833
834
  # Among the variables below, these:
  #   perfexecdir
1b16fffa3   Arnaldo Carvalho de Melo   perf llvm-utils: ...
835
  #   perf_include_dir
8f12a2ff0   Arnaldo Carvalho de Melo   perf bpf: Add 'ex...
836
  #   perf_examples_dir
cd1c39f2c   Jiri Olsa   perf tools: Move ...
837
838
839
840
841
842
843
844
845
846
847
848
  #   template_dir
  #   mandir
  #   infodir
  #   htmldir
  #   ETC_PERFCONFIG (but not sysconfdir)
  # can be specified as a relative path some/where/else;
  # this is interpreted as relative to $(prefix) and "perf" at
  # runtime figures out where they are based on the path to the executable.
  # This can help installing the suite in a relocatable way.
  
  # Make the path relative to DESTDIR, not to prefix
  ifndef DESTDIR
fc9cabeab   Jianyu Zhan   perf tools: Fix '...
849
  prefix ?= $(HOME)
cd1c39f2c   Jiri Olsa   perf tools: Move ...
850
851
  endif
  bindir_relative = bin
0927beeca   Pawel Moll   perf tools: Fix t...
852
  bindir = $(abspath $(prefix)/$(bindir_relative))
cd1c39f2c   Jiri Olsa   perf tools: Move ...
853
854
855
  mandir = share/man
  infodir = share/info
  perfexecdir = libexec/perf-core
83868bf71   Thomas Richter   perf build: Fix i...
856
857
  perf_include_dir = lib/perf/include
  perf_examples_dir = lib/perf/examples
cd1c39f2c   Jiri Olsa   perf tools: Move ...
858
859
  sharedir = $(prefix)/share
  template_dir = share/perf-core/templates
005438a8e   Arnaldo Carvalho de Melo   perf trace: Suppo...
860
  STRACE_GROUPS_DIR = share/perf-core/strace/groups
cd1c39f2c   Jiri Olsa   perf tools: Move ...
861
  htmldir = share/doc/perf-doc
14cbfbeb7   Namhyung Kim   perf report: Show...
862
  tipdir = share/doc/perf-tip
84cfac7f0   Namhyung Kim   perf tools: Set a...
863
  srcdir = $(srctree)/tools/perf
cd1c39f2c   Jiri Olsa   perf tools: Move ...
864
865
866
867
868
869
870
  ifeq ($(prefix),/usr)
  sysconfdir = /etc
  ETC_PERFCONFIG = $(sysconfdir)/perfconfig
  else
  sysconfdir = $(prefix)/etc
  ETC_PERFCONFIG = etc/perfconfig
  endif
6997af72e   Jiri Olsa   perf tools: Allow...
871
  ifndef lib
7a759cd8e   Jiada Wang   perf tools: Fix b...
872
  ifeq ($(SRCARCH)$(IS_64_BIT), x861)
fc67297b1   Namhyung Kim   perf tools: Separ...
873
874
  lib = lib64
  else
cd1c39f2c   Jiri Olsa   perf tools: Move ...
875
  lib = lib
fc67297b1   Namhyung Kim   perf tools: Separ...
876
  endif
6997af72e   Jiri Olsa   perf tools: Allow...
877
  endif # lib
fc67297b1   Namhyung Kim   perf tools: Separ...
878
  libdir = $(prefix)/$(lib)
cd1c39f2c   Jiri Olsa   perf tools: Move ...
879
880
881
  
  # Shell quote (do not use $(call) to accommodate ancient setups);
  ETC_PERFCONFIG_SQ = $(subst ','\'',$(ETC_PERFCONFIG))
005438a8e   Arnaldo Carvalho de Melo   perf trace: Suppo...
882
  STRACE_GROUPS_DIR_SQ = $(subst ','\'',$(STRACE_GROUPS_DIR))
cd1c39f2c   Jiri Olsa   perf tools: Move ...
883
884
885
886
887
  DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
  bindir_SQ = $(subst ','\'',$(bindir))
  mandir_SQ = $(subst ','\'',$(mandir))
  infodir_SQ = $(subst ','\'',$(infodir))
  perfexecdir_SQ = $(subst ','\'',$(perfexecdir))
1b16fffa3   Arnaldo Carvalho de Melo   perf llvm-utils: ...
888
  perf_include_dir_SQ = $(subst ','\'',$(perf_include_dir))
8f12a2ff0   Arnaldo Carvalho de Melo   perf bpf: Add 'ex...
889
  perf_examples_dir_SQ = $(subst ','\'',$(perf_examples_dir))
cd1c39f2c   Jiri Olsa   perf tools: Move ...
890
891
  template_dir_SQ = $(subst ','\'',$(template_dir))
  htmldir_SQ = $(subst ','\'',$(htmldir))
14cbfbeb7   Namhyung Kim   perf report: Show...
892
  tipdir_SQ = $(subst ','\'',$(tipdir))
cd1c39f2c   Jiri Olsa   perf tools: Move ...
893
894
  prefix_SQ = $(subst ','\'',$(prefix))
  sysconfdir_SQ = $(subst ','\'',$(sysconfdir))
fc67297b1   Namhyung Kim   perf tools: Separ...
895
  libdir_SQ = $(subst ','\'',$(libdir))
84cfac7f0   Namhyung Kim   perf tools: Set a...
896
  srcdir_SQ = $(subst ','\'',$(srcdir))
cd1c39f2c   Jiri Olsa   perf tools: Move ...
897
898
899
  
  ifneq ($(filter /%,$(firstword $(perfexecdir))),)
  perfexec_instdir = $(perfexecdir)
1b16fffa3   Arnaldo Carvalho de Melo   perf llvm-utils: ...
900
  perf_include_instdir = $(perf_include_dir)
8f12a2ff0   Arnaldo Carvalho de Melo   perf bpf: Add 'ex...
901
  perf_examples_instdir = $(perf_examples_dir)
005438a8e   Arnaldo Carvalho de Melo   perf trace: Suppo...
902
  STRACE_GROUPS_INSTDIR = $(STRACE_GROUPS_DIR)
14cbfbeb7   Namhyung Kim   perf report: Show...
903
  tip_instdir = $(tipdir)
cd1c39f2c   Jiri Olsa   perf tools: Move ...
904
905
  else
  perfexec_instdir = $(prefix)/$(perfexecdir)
1b16fffa3   Arnaldo Carvalho de Melo   perf llvm-utils: ...
906
  perf_include_instdir = $(prefix)/$(perf_include_dir)
8f12a2ff0   Arnaldo Carvalho de Melo   perf bpf: Add 'ex...
907
  perf_examples_instdir = $(prefix)/$(perf_examples_dir)
005438a8e   Arnaldo Carvalho de Melo   perf trace: Suppo...
908
  STRACE_GROUPS_INSTDIR = $(prefix)/$(STRACE_GROUPS_DIR)
14cbfbeb7   Namhyung Kim   perf report: Show...
909
  tip_instdir = $(prefix)/$(tipdir)
cd1c39f2c   Jiri Olsa   perf tools: Move ...
910
911
  endif
  perfexec_instdir_SQ = $(subst ','\'',$(perfexec_instdir))
1b16fffa3   Arnaldo Carvalho de Melo   perf llvm-utils: ...
912
  perf_include_instdir_SQ = $(subst ','\'',$(perf_include_instdir))
8f12a2ff0   Arnaldo Carvalho de Melo   perf bpf: Add 'ex...
913
  perf_examples_instdir_SQ = $(subst ','\'',$(perf_examples_instdir))
005438a8e   Arnaldo Carvalho de Melo   perf trace: Suppo...
914
  STRACE_GROUPS_INSTDIR_SQ = $(subst ','\'',$(STRACE_GROUPS_INSTDIR))
14cbfbeb7   Namhyung Kim   perf report: Show...
915
  tip_instdir_SQ = $(subst ','\'',$(tip_instdir))
3d7c01444   Jiri Olsa   perf tools: Add b...
916
917
918
919
920
921
  
  # If we install to $(HOME) we keep the traceevent default:
  # $(HOME)/.traceevent/plugins
  # Otherwise we install plugins into the global $(libdir).
  ifdef DESTDIR
  plugindir=$(libdir)/traceevent/plugins
b935a58db   Josh Boyer   perf tools: Fix t...
922
  plugindir_SQ= $(subst ','\'',$(plugindir))
3d7c01444   Jiri Olsa   perf tools: Add b...
923
  endif
0695e57b9   Jiri Olsa   perf tools: Facto...
924

4b20d684b   Jiri Olsa   perf build: Renam...
925
926
  print_var = $(eval $(print_var_code)) $(info $(MSG))
  define print_var_code
8d79076a3   Jiri Olsa   perf tools: Add v...
927
928
      MSG = $(shell printf '...%30s: %s' $(1) $($(1)))
  endef
0695e57b9   Jiri Olsa   perf tools: Facto...
929
  ifeq ($(VF),1)
99402e068   Jiri Olsa   perf build: Displ...
930
931
932
933
    # Display EXTRA features which are detected manualy
    # from here with feature_check call and thus cannot
    # be partof global state output.
    $(foreach feat,$(FEATURE_TESTS_EXTRA),$(call feature_print_status,$(feat),))
4b20d684b   Jiri Olsa   perf build: Renam...
934
935
936
937
938
939
    $(call print_var,prefix)
    $(call print_var,bindir)
    $(call print_var,libdir)
    $(call print_var,sysconfdir)
    $(call print_var,LIBUNWIND_DIR)
    $(call print_var,LIBDW_DIR)
d4dfdf00d   Jiri Olsa   perf jvmti: Plug ...
940
    $(call print_var,JDIR)
76ee2ff34   Jiri Olsa   tools build featu...
941
942
943
944
  
    ifeq ($(dwarf-post-unwind),1)
      $(call feature_print_text,"DWARF post unwind library", $(dwarf-post-unwind-text))
    endif
0695e57b9   Jiri Olsa   perf tools: Facto...
945
946
    $(info )
  endif
f39e042a1   Jiri Olsa   perf build: Add t...
947
948
949
950
951
952
  
  $(call detected_var,bindir_SQ)
  $(call detected_var,PYTHON_WORD)
  ifneq ($(OUTPUT),)
  $(call detected_var,OUTPUT)
  endif
285ab8bfc   Jiri Olsa   perf build: Add b...
953
954
955
  $(call detected_var,htmldir_SQ)
  $(call detected_var,infodir_SQ)
  $(call detected_var,mandir_SQ)
9352aabad   Jiri Olsa   perf build: Add l...
956
  $(call detected_var,ETC_PERFCONFIG_SQ)
005438a8e   Arnaldo Carvalho de Melo   perf trace: Suppo...
957
  $(call detected_var,STRACE_GROUPS_DIR_SQ)
9352aabad   Jiri Olsa   perf build: Add l...
958
959
  $(call detected_var,prefix_SQ)
  $(call detected_var,perfexecdir_SQ)
1b16fffa3   Arnaldo Carvalho de Melo   perf llvm-utils: ...
960
  $(call detected_var,perf_include_dir_SQ)
8f12a2ff0   Arnaldo Carvalho de Melo   perf bpf: Add 'ex...
961
  $(call detected_var,perf_examples_dir_SQ)
14cbfbeb7   Namhyung Kim   perf report: Show...
962
  $(call detected_var,tipdir_SQ)
84cfac7f0   Namhyung Kim   perf tools: Set a...
963
  $(call detected_var,srcdir_SQ)
3b939a631   Jiri Olsa   perf build: Add u...
964
  $(call detected_var,LIBDIR)
88aeea06e   Jiri Olsa   perf build: Add g...
965
  $(call detected_var,GTK_CFLAGS)
c7355f842   Jiri Olsa   perf build: Add s...
966
967
  $(call detected_var,PERL_EMBED_CCOPTS)
  $(call detected_var,PYTHON_EMBED_CCOPTS)