]> git.ipfire.org Git - thirdparty/linux.git/blame - tools/perf/Makefile.config
perf build: Disable BPF skeletons if clang version is < 12.0.1
[thirdparty/linux.git] / tools / perf / Makefile.config
CommitLineData
ec8f24b7 1# SPDX-License-Identifier: GPL-2.0-only
8bd407b9 2
a6cf5f39
JO
3ifeq ($(src-perf),)
4src-perf := $(srctree)/tools/perf
5endif
8bd407b9 6
a6cf5f39
JO
7ifeq ($(obj-perf),)
8obj-perf := $(OUTPUT)
8bd407b9
JO
9endif
10
a6cf5f39
JO
11ifneq ($(obj-perf),)
12obj-perf := $(abspath $(obj-perf))/
13endif
14
52c0a18b 15$(shell printf "" > $(OUTPUT).config-detected)
64227379
AK
16detected = $(shell echo "$(1)=y" >> $(OUTPUT).config-detected)
17detected_var = $(shell echo "$(1)=$($(1))" >> $(OUTPUT).config-detected)
fcfd6611 18
ab0a40ea 19CFLAGS := $(EXTRA_CFLAGS) $(filter-out -Wnested-externs,$(EXTRA_WARNINGS))
c77a78c2 20HOSTCFLAGS := $(filter-out -Wnested-externs,$(EXTRA_WARNINGS))
a6cf5f39 21
dca571ed
IR
22# Enabled Wthread-safety analysis for clang builds.
23ifeq ($(CC_NO_CLANG), 0)
24 CFLAGS += -Wthread-safety
25endif
26
935e6bd3 27include $(srctree)/tools/scripts/Makefile.arch
a6cf5f39 28
7a759cd8 29$(call detected_var,SRCARCH)
f39e042a 30
a6cf5f39 31NO_PERF_REGS := 1
9b90d973 32
43de3869
ACM
33ifneq ($(NO_SYSCALL_TABLE),1)
34 NO_SYSCALL_TABLE := 1
35
36 ifeq ($(SRCARCH),x86)
37 ifeq (${IS_64_BIT}, 1)
38 NO_SYSCALL_TABLE := 0
39 endif
40 else
2fa5ebe3 41 ifeq ($(SRCARCH),$(filter $(SRCARCH),powerpc arm64 s390 mips loongarch))
43de3869
ACM
42 NO_SYSCALL_TABLE := 0
43 endif
9b90d973 44 endif
9b90d973 45
43de3869
ACM
46 ifneq ($(NO_SYSCALL_TABLE),1)
47 CFLAGS += -DHAVE_SYSCALL_TABLE_SUPPORT
48 endif
9b90d973
ACM
49endif
50
dc642e83 51# Additional ARCH settings for ppc
7a759cd8 52ifeq ($(SRCARCH),powerpc)
dc642e83 53 NO_PERF_REGS := 0
4281da23 54 CFLAGS += -I$(OUTPUT)arch/powerpc/include/generated
c4522469 55 LIBUNWIND_LIBS := -lunwind -lunwind-ppc64
dc642e83
A
56endif
57
a6cf5f39 58# Additional ARCH settings for x86
7a759cd8 59ifeq ($(SRCARCH),x86)
f39e042a 60 $(call detected,CONFIG_X86)
c6e5e9fb 61 ifeq (${IS_64_BIT}, 1)
901bb028 62 CFLAGS += -DHAVE_ARCH_X86_64_SUPPORT -I$(OUTPUT)arch/x86/include/generated
8e1b3f68 63 ARCH_INCLUDE = ../../arch/x86/lib/memcpy_64.S ../../arch/x86/lib/memset_64.S
60913e00 64 LIBUNWIND_LIBS = -lunwind-x86_64 -lunwind -llzma
72965b87 65 $(call detected,CONFIG_X86_64)
8a0c4c28 66 else
05b41775 67 LIBUNWIND_LIBS = -lunwind-x86 -llzma -lunwind
8e1b3f68
JO
68 endif
69 NO_PERF_REGS := 0
8bd407b9 70endif
8ab596af 71
7a759cd8 72ifeq ($(SRCARCH),arm)
7495f374
WD
73 NO_PERF_REGS := 0
74 LIBUNWIND_LIBS = -lunwind -lunwind-arm
75endif
8bd407b9 76
7a759cd8 77ifeq ($(SRCARCH),arm64)
8ab596af 78 NO_PERF_REGS := 0
a7f660d6 79 CFLAGS += -I$(OUTPUT)arch/arm64/include/generated
8ab596af
JP
80 LIBUNWIND_LIBS = -lunwind -lunwind-aarch64
81endif
82
2fa5ebe3
HC
83ifeq ($(SRCARCH),loongarch)
84 NO_PERF_REGS := 0
85 CFLAGS += -I$(OUTPUT)arch/loongarch/include/generated
86 LIBUNWIND_LIBS = -lunwind -lunwind-loongarch64
87endif
88
51bc620b
MH
89ifeq ($(SRCARCH),riscv)
90 NO_PERF_REGS := 0
91endif
92
3213486f
MH
93ifeq ($(SRCARCH),csky)
94 NO_PERF_REGS := 0
95endif
96
f704ef44
HC
97ifeq ($(ARCH),s390)
98 NO_PERF_REGS := 0
a9a3f1d1 99 CFLAGS += -fPIC -I$(OUTPUT)arch/s390/include/generated
f704ef44
HC
100endif
101
b5f184fb
TY
102ifeq ($(ARCH),mips)
103 NO_PERF_REGS := 0
d9fd5a71 104 CFLAGS += -I$(OUTPUT)arch/mips/include/generated
b5f184fb
TY
105 LIBUNWIND_LIBS = -lunwind -lunwind-mips
106endif
107
3bc3374c
JO
108ifeq ($(NO_PERF_REGS),0)
109 $(call detected,CONFIG_PERF_REGS)
110endif
111
90fa9deb 112# So far there's only x86 and arm libdw unwind support merged in perf.
4dc549e5
JO
113# Disable it on all other architectures in case libdw unwind
114# support is detected in system. Add supported architectures
115# to the check.
2fa5ebe3 116ifneq ($(SRCARCH),$(filter $(SRCARCH),x86 arm arm64 powerpc s390 csky riscv loongarch))
4dc549e5
JO
117 NO_LIBDW_DWARF_UNWIND := 1
118endif
119
1448fef4
JP
120ifeq ($(LIBUNWIND_LIBS),)
121 NO_LIBUNWIND := 1
1448fef4 122endif
5a155bb7
WN
123#
124# For linking with debug library, run like:
125#
126# make DEBUG=1 LIBUNWIND_DIR=/opt/libunwind/
127#
195106b9
HK
128
129libunwind_arch_set_flags = $(eval $(libunwind_arch_set_flags_code))
130define libunwind_arch_set_flags_code
131 FEATURE_CHECK_CFLAGS-libunwind-$(1) = -I$(LIBUNWIND_DIR)/include
132 FEATURE_CHECK_LDFLAGS-libunwind-$(1) = -L$(LIBUNWIND_DIR)/lib
133endef
134
5a155bb7
WN
135ifdef LIBUNWIND_DIR
136 LIBUNWIND_CFLAGS = -I$(LIBUNWIND_DIR)/include
137 LIBUNWIND_LDFLAGS = -L$(LIBUNWIND_DIR)/lib
2fa5ebe3 138 LIBUNWIND_ARCHS = x86 x86_64 arm aarch64 debug-frame-arm debug-frame-aarch64 loongarch
195106b9 139 $(foreach libunwind_arch,$(LIBUNWIND_ARCHS),$(call libunwind_arch_set_flags,$(libunwind_arch)))
5a155bb7 140endif
5a155bb7
WN
141
142# Set per-feature check compilation flags
143FEATURE_CHECK_CFLAGS-libunwind = $(LIBUNWIND_CFLAGS)
403cacb8 144FEATURE_CHECK_LDFLAGS-libunwind = $(LIBUNWIND_LDFLAGS) $(LIBUNWIND_LIBS)
5a155bb7 145FEATURE_CHECK_CFLAGS-libunwind-debug-frame = $(LIBUNWIND_CFLAGS)
403cacb8 146FEATURE_CHECK_LDFLAGS-libunwind-debug-frame = $(LIBUNWIND_LDFLAGS) $(LIBUNWIND_LIBS)
1448fef4 147
cdf32b44
LH
148FEATURE_CHECK_LDFLAGS-libunwind-arm += -lunwind -lunwind-arm
149FEATURE_CHECK_LDFLAGS-libunwind-aarch64 += -lunwind -lunwind-aarch64
150FEATURE_CHECK_LDFLAGS-libunwind-x86 += -lunwind -llzma -lunwind-x86
151FEATURE_CHECK_LDFLAGS-libunwind-x86_64 += -lunwind -llzma -lunwind-x86_64
5c4d7c82 152
271402a3
ACM
153FEATURE_CHECK_LDFLAGS-libcrypto = -lcrypto
154
aa6292f4
MP
155ifdef CSINCLUDES
156 LIBOPENCSD_CFLAGS := -I$(CSINCLUDES)
157endif
1feece27 158OPENCSDLIBS := -lopencsd_c_api -lopencsd
ed17b191 159ifeq ($(findstring -static,${LDFLAGS}),-static)
1feece27 160 OPENCSDLIBS += -lstdc++
ed17b191 161endif
aa6292f4
MP
162ifdef CSLIBS
163 LIBOPENCSD_LDFLAGS := -L$(CSLIBS)
164endif
165FEATURE_CHECK_CFLAGS-libopencsd := $(LIBOPENCSD_CFLAGS)
166FEATURE_CHECK_LDFLAGS-libopencsd := $(LIBOPENCSD_LDFLAGS) $(OPENCSDLIBS)
167
8bd407b9 168ifeq ($(NO_PERF_REGS),0)
89fe808a 169 CFLAGS += -DHAVE_PERF_REGS_SUPPORT
8bd407b9 170endif
a32f4936 171
5a155bb7
WN
172# for linking with debug library, run like:
173# make DEBUG=1 LIBDW_DIR=/opt/libdw/
174ifdef LIBDW_DIR
175 LIBDW_CFLAGS := -I$(LIBDW_DIR)/include
176 LIBDW_LDFLAGS := -L$(LIBDW_DIR)/lib
45757895 177endif
ba335df4
KK
178DWARFLIBS := -ldw
179ifeq ($(findstring -static,${LDFLAGS}),-static)
180 DWARFLIBS += -lelf -lebl -ldl -lz -llzma -lbz2
181endif
5a155bb7 182FEATURE_CHECK_CFLAGS-libdw-dwarf-unwind := $(LIBDW_CFLAGS)
ba335df4 183FEATURE_CHECK_LDFLAGS-libdw-dwarf-unwind := $(LIBDW_LDFLAGS) $(DWARFLIBS)
45757895 184
5a155bb7
WN
185# for linking with debug library, run like:
186# make DEBUG=1 LIBBABELTRACE_DIR=/opt/libbabeltrace/
187ifdef LIBBABELTRACE_DIR
188 LIBBABELTRACE_CFLAGS := -I$(LIBBABELTRACE_DIR)/include
189 LIBBABELTRACE_LDFLAGS := -L$(LIBBABELTRACE_DIR)/lib
53d0a573 190endif
5a155bb7
WN
191FEATURE_CHECK_CFLAGS-libbabeltrace := $(LIBBABELTRACE_CFLAGS)
192FEATURE_CHECK_LDFLAGS-libbabeltrace := $(LIBBABELTRACE_LDFLAGS) -lbabeltrace-ctf
53d0a573 193
3b1c5d96
AB
194ifdef LIBZSTD_DIR
195 LIBZSTD_CFLAGS := -I$(LIBZSTD_DIR)/lib
196 LIBZSTD_LDFLAGS := -L$(LIBZSTD_DIR)/lib
197endif
198FEATURE_CHECK_CFLAGS-libzstd := $(LIBZSTD_CFLAGS)
199FEATURE_CHECK_LDFLAGS-libzstd := $(LIBZSTD_LDFLAGS)
200
7a759cd8 201FEATURE_CHECK_CFLAGS-bpf = -I. -I$(srctree)/tools/include -I$(srctree)/tools/arch/$(SRCARCH)/include/uapi -I$(srctree)/tools/include/uapi
7c53746e 202# include ARCH specific config
7a759cd8 203-include $(src-perf)/arch/$(SRCARCH)/Makefile
7c53746e 204
63ab024a
WN
205ifdef PERF_HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET
206 CFLAGS += -DHAVE_ARCH_REGS_QUERY_REGISTER_OFFSET
207endif
208
ca70c24f 209include $(srctree)/tools/scripts/utilities.mak
a32f4936
JO
210
211ifeq ($(call get-executable,$(FLEX)),)
8e1b3f68 212 dummy := $(error Error: $(FLEX) is missing on this system, please install it)
a32f4936
JO
213endif
214
215ifeq ($(call get-executable,$(BISON)),)
8e1b3f68 216 dummy := $(error Error: $(BISON) is missing on this system, please install it)
a32f4936 217endif
362493f0 218
6793672a
DZ
219ifneq ($(OUTPUT),)
220 ifeq ($(shell expr $(shell $(BISON) --version | grep bison | sed -e 's/.\+ \([0-9]\+\).\([0-9]\+\).\([0-9]\+\)/\1\2\3/g') \>\= 371), 1)
221 BISON_FILE_PREFIX_MAP := --file-prefix-map=$(OUTPUT)=
222 endif
223endif
224
362493f0
JO
225# Treat warnings as errors unless directed not to
226ifneq ($(WERROR),0)
55542113 227 CORE_CFLAGS += -Werror
d58ac0bf 228 CXXFLAGS += -Werror
c77a78c2 229 HOSTCFLAGS += -Werror
362493f0
JO
230endif
231
74af377b
AH
232ifndef DEBUG
233 DEBUG := 0
234endif
235
fcf92585 236ifeq ($(DEBUG),0)
616b14b4 237CORE_CFLAGS += -DNDEBUG=1
3866058e 238ifeq ($(CC_NO_CLANG), 0)
55542113 239 CORE_CFLAGS += -O3
49b3cd30 240else
55542113 241 CORE_CFLAGS += -O6
362493f0 242endif
435bea0a
IR
243else
244 CORE_CFLAGS += -g
245 CXXFLAGS += -g
49b3cd30 246endif
362493f0
JO
247
248ifdef PARSER_DEBUG
8e1b3f68
JO
249 PARSER_DEBUG_BISON := -t
250 PARSER_DEBUG_FLEX := -d
251 CFLAGS += -DPARSER_DEBUG
9352aaba
JO
252 $(call detected_var,PARSER_DEBUG_BISON)
253 $(call detected_var,PARSER_DEBUG_FLEX)
362493f0
JO
254endif
255
c126ac4a
IR
256ifdef LTO
257 CORE_CFLAGS += -flto
258 CXXFLAGS += -flto
259endif
260
5a155bb7 261# Try different combinations to accommodate systems that only have
630af16e
JC
262# python[2][3]-config in weird combinations in the following order of
263# priority from lowest to highest:
630af16e 264# * python2-config as per pep-0394.
4c41cb46
IR
265# * python-config
266# * python3-config
630af16e
JC
267# * $(PYTHON)-config (If PYTHON is user supplied but PYTHON_CONFIG isn't)
268#
269PYTHON_AUTO := python-config
630af16e 270PYTHON_AUTO := $(if $(call get-executable,python2-config),python2-config,$(PYTHON_AUTO))
4c41cb46
IR
271PYTHON_AUTO := $(if $(call get-executable,python-config),python-config,$(PYTHON_AUTO))
272PYTHON_AUTO := $(if $(call get-executable,python3-config),python3-config,$(PYTHON_AUTO))
630af16e
JC
273
274# If PYTHON is defined but PYTHON_CONFIG isn't, then take $(PYTHON)-config as if it was the user
275# supplied value for PYTHON_CONFIG. Because it's "user supplied", error out if it doesn't exist.
276ifdef PYTHON
277 ifndef PYTHON_CONFIG
278 PYTHON_CONFIG_AUTO := $(call get-executable,$(PYTHON)-config)
279 PYTHON_CONFIG := $(if $(PYTHON_CONFIG_AUTO),$(PYTHON_CONFIG_AUTO),\
280 $(call $(error $(PYTHON)-config not found)))
281 endif
282endif
283
284# Select either auto detected python and python-config or use user supplied values if they are
285# defined. get-executable-or-default fails with an error if the first argument is supplied but
286# doesn't exist.
287override PYTHON_CONFIG := $(call get-executable-or-default,PYTHON_CONFIG,$(PYTHON_AUTO))
bc9e7fe3 288override PYTHON := $(call get-executable-or-default,PYTHON,$(subst -config,,$(PYTHON_CONFIG)))
56c7d79e 289
7be6b316
DCC
290grep-libs = $(filter -l%,$(1))
291strip-libs = $(filter-out -l%,$(1))
56c7d79e 292
7be6b316 293PYTHON_CONFIG_SQ := $(call shell-sq,$(PYTHON_CONFIG))
56c7d79e 294
b9c9ce4e
SL
295# Python 3.8 changed the output of `python-config --ldflags` to not include the
296# '-lpythonX.Y' flag unless '--embed' is also passed. The feature check for
297# libpython fails if that flag is not included in LDFLAGS
298ifeq ($(shell $(PYTHON_CONFIG_SQ) --ldflags --embed 2>&1 1>/dev/null; echo $$?), 0)
299 PYTHON_CONFIG_LDFLAGS := --ldflags --embed
300else
301 PYTHON_CONFIG_LDFLAGS := --ldflags
302endif
303
7be6b316 304ifdef PYTHON_CONFIG
b9c9ce4e 305 PYTHON_EMBED_LDOPTS := $(shell $(PYTHON_CONFIG_SQ) $(PYTHON_CONFIG_LDFLAGS) 2>/dev/null)
7be6b316
DCC
306 PYTHON_EMBED_LDFLAGS := $(call strip-libs,$(PYTHON_EMBED_LDOPTS))
307 PYTHON_EMBED_LIBADD := $(call grep-libs,$(PYTHON_EMBED_LDOPTS)) -lutil
32aa928a 308 PYTHON_EMBED_CCOPTS := $(shell $(PYTHON_CONFIG_SQ) --includes 2>/dev/null)
7be6b316 309 FLAGS_PYTHON_EMBED := $(PYTHON_EMBED_CCOPTS) $(PYTHON_EMBED_LDOPTS)
3a8a0475
ACM
310 ifeq ($(CC_NO_CLANG), 0)
311 PYTHON_EMBED_CCOPTS := $(filter-out -ffat-lto-objects, $(PYTHON_EMBED_CCOPTS))
312 endif
8bd8c653
ACM
313endif
314
5a155bb7
WN
315FEATURE_CHECK_CFLAGS-libpython := $(PYTHON_EMBED_CCOPTS)
316FEATURE_CHECK_LDFLAGS-libpython := $(PYTHON_EMBED_LDOPTS)
56c7d79e 317
aa8f9c51
ACM
318FEATURE_CHECK_LDFLAGS-libaio = -lrt
319
ad5f604e
NK
320FEATURE_CHECK_LDFLAGS-disassembler-four-args = -lbfd -lopcodes -ldl
321FEATURE_CHECK_LDFLAGS-disassembler-init-styled = -lbfd -lopcodes -ldl
322
55542113 323CORE_CFLAGS += -fno-omit-frame-pointer
55542113
JO
324CORE_CFLAGS += -Wall
325CORE_CFLAGS += -Wextra
f3c9bd4e 326CORE_CFLAGS += -std=gnu11
9c12cf95 327
8fcaea9f 328CXXFLAGS += -std=gnu++17 -fno-exceptions -fno-rtti
d58ac0bf 329CXXFLAGS += -Wall
e5764ae4 330CXXFLAGS += -Wextra
d58ac0bf 331CXXFLAGS += -fno-omit-frame-pointer
d58ac0bf 332
c77a78c2
JG
333HOSTCFLAGS += -Wall
334HOSTCFLAGS += -Wextra
335
6392b4eb
MK
336# Enforce a non-executable stack, as we may regress (again) in the future by
337# adding assembler files missing the .GNU-stack linker note.
338LDFLAGS += -Wl,-z,noexecstack
339
5e2d4d0e 340EXTLIBS = -lpthread -lrt -lm -ldl
362493f0 341
bb91a073
JO
342ifneq ($(TCMALLOC),)
343 CFLAGS += -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free
344 EXTLIBS += -ltcmalloc
345endif
346
96b9e70b 347ifeq ($(FEATURES_DUMP),)
ad5f604e
NK
348# We will display at the end of this Makefile.config, using $(call feature_display_entries)
349# As we may retry some feature detection here, see the disassembler-four-args case, for instance
c6e3bf43 350 FEATURE_DISPLAY_DEFERRED := 1
e6c76d62 351include $(srctree)/tools/build/Makefile.feature
96b9e70b
JO
352else
353include $(FEATURES_DUMP)
354endif
baa9c30e 355
90ac5422 356ifeq ($(feature-stackprotector-all), 1)
55542113 357 CORE_CFLAGS += -fstack-protector-all
362493f0
JO
358endif
359
fcf92585 360ifeq ($(DEBUG),0)
1ea6f99e 361 ifeq ($(feature-fortify-source), 1)
f077c776 362 CORE_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
8e1b3f68 363 endif
362493f0
JO
364endif
365
e67d52d4 366INC_FLAGS += -I$(src-perf)/util/include
7a759cd8 367INC_FLAGS += -I$(src-perf)/arch/$(SRCARCH)/include
e67d52d4 368INC_FLAGS += -I$(srctree)/tools/include/
7a759cd8 369INC_FLAGS += -I$(srctree)/tools/arch/$(SRCARCH)/include/uapi
146dc303 370INC_FLAGS += -I$(srctree)/tools/include/uapi
7a759cd8
JW
371INC_FLAGS += -I$(srctree)/tools/arch/$(SRCARCH)/include/
372INC_FLAGS += -I$(srctree)/tools/arch/$(SRCARCH)/
7c53746e
JO
373
374# $(obj-perf) for generated common-cmds.h
375# $(obj-perf)/util for generated bison/flex headers
376ifneq ($(OUTPUT),)
e67d52d4
WN
377INC_FLAGS += -I$(obj-perf)/util
378INC_FLAGS += -I$(obj-perf)
7c53746e
JO
379endif
380
e67d52d4
WN
381INC_FLAGS += -I$(src-perf)/util
382INC_FLAGS += -I$(src-perf)
e67d52d4 383
55542113
JO
384CORE_CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
385
386CFLAGS += $(CORE_CFLAGS) $(INC_FLAGS)
e67d52d4 387CXXFLAGS += $(INC_FLAGS)
7c53746e 388
55542113 389LIBPERF_CFLAGS := $(CORE_CFLAGS) $(EXTRA_CFLAGS)
362493f0 390
459a3df7
VG
391ifeq ($(feature-pthread-attr-setaffinity-np), 1)
392 CFLAGS += -DHAVE_PTHREAD_ATTR_SETAFFINITY_NP
393endif
394
25ab5abf
ACM
395ifeq ($(feature-pthread-barrier), 1)
396 CFLAGS += -DHAVE_PTHREAD_BARRIER
397endif
398
4e22db46 399ifndef NO_BIONIC
5febff00 400 $(call feature_check,bionic)
78e9d655
IM
401 ifeq ($(feature-bionic), 1)
402 BIONIC := 1
748fe088 403 CFLAGS += -DLACKS_SIGQUEUE_PROTOTYPE
d7a8c4a6 404 CFLAGS += -DLACKS_OPEN_MEMSTREAM_PROTOTYPE
78e9d655
IM
405 EXTLIBS := $(filter-out -lrt,$(EXTLIBS))
406 EXTLIBS := $(filter-out -lpthread,$(EXTLIBS))
407 endif
362493f0 408endif
cf4cca10 409
11c6cbe7 410ifeq ($(feature-eventfd), 1)
ba35fe93 411 CFLAGS += -DHAVE_EVENTFD_SUPPORT
11c6cbe7
ACM
412endif
413
8feb8efe
ACM
414ifeq ($(feature-get_current_dir_name), 1)
415 CFLAGS += -DHAVE_GET_CURRENT_DIR_NAME
416endif
417
4541a8bb
ACM
418ifeq ($(feature-gettid), 1)
419 CFLAGS += -DHAVE_GETTID
420endif
421
49f550ea
NK
422ifeq ($(feature-file-handle), 1)
423 CFLAGS += -DHAVE_FILE_HANDLE
424endif
425
cf4cca10 426ifdef NO_LIBELF
8e1b3f68 427 NO_DWARF := 1
8e1b3f68 428 NO_LIBUNWIND := 1
5ea84154 429 NO_LIBDW_DWARF_UNWIND := 1
ed63f34c 430 NO_LIBBPF := 1
e5e992a7 431 NO_JVMTI := 1
cf4cca10 432else
8f7f8005 433 ifeq ($(feature-libelf), 0)
e12762cf 434 ifeq ($(feature-glibc), 1)
50eed7a7
IM
435 LIBC_SUPPORT := 1
436 endif
437 ifeq ($(BIONIC),1)
438 LIBC_SUPPORT := 1
439 endif
440 ifeq ($(LIBC_SUPPORT),1)
8d98ca5c 441 msg := $(error ERROR: No libelf found. Disables 'probe' tool, jvmti and BPF support. Please install libelf-dev, libelf-devel, elfutils-libelf-devel or build with NO_LIBELF=1.)
50eed7a7 442 else
6a1515c9
TY
443 ifneq ($(filter s% -fsanitize=address%,$(EXTRA_CFLAGS),),)
444 ifneq ($(shell ldconfig -p | grep libasan >/dev/null 2>&1; echo $$?), 0)
445 msg := $(error No libasan found, please install libasan);
446 endif
447 endif
448
449 ifneq ($(filter s% -fsanitize=undefined%,$(EXTRA_CFLAGS),),)
450 ifneq ($(shell ldconfig -p | grep libubsan >/dev/null 2>&1; echo $$?), 0)
451 msg := $(error No libubsan found, please install libubsan);
452 endif
453 endif
454
f9ca2d89
ACM
455 ifneq ($(filter s% -static%,$(LDFLAGS),),)
456 msg := $(error No static glibc found, please install glibc-static);
457 else
458 msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]);
459 endif
50eed7a7 460 endif
8e1b3f68 461 else
0a4f2b6a
JO
462 ifndef NO_LIBDW_DWARF_UNWIND
463 ifneq ($(feature-libdw-dwarf-unwind),1)
464 NO_LIBDW_DWARF_UNWIND := 1
465 msg := $(warning No libdw DWARF unwind found, Please install elfutils-devel/libdw-dev >= 0.158 and/or set LIBDW_DIR);
466 endif
467 endif
8295d4e2 468 ifneq ($(feature-dwarf), 1)
2484c4c5
DCC
469 ifndef NO_DWARF
470 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);
471 NO_DWARF := 1
472 endif
bd0419e2
ACM
473 else
474 ifneq ($(feature-dwarf_getlocations), 1)
475 msg := $(warning Old libdw.h, finding variables at given 'perf probe' point will not work, install elfutils-devel/libdw-dev >= 0.157);
476 else
a36ebe4e 477 CFLAGS += -DHAVE_DWARF_GETLOCATIONS_SUPPORT
bd0419e2 478 endif # dwarf_getlocations
50eed7a7 479 endif # Dwarf support
0648f839 480 endif # libelf support
cf4cca10
JO
481endif # NO_LIBELF
482
2a07d814
AB
483ifeq ($(feature-libaio), 1)
484 ifndef NO_AIO
485 CFLAGS += -DHAVE_AIO_SUPPORT
486 endif
487endif
488
76d40849
NR
489ifdef NO_DWARF
490 NO_LIBDW_DWARF_UNWIND := 1
491endif
492
9e03608e
ACM
493ifeq ($(feature-scandirat), 1)
494 CFLAGS += -DHAVE_SCANDIRAT_SUPPORT
495endif
496
120010cb
ACM
497ifeq ($(feature-sched_getcpu), 1)
498 CFLAGS += -DHAVE_SCHED_GETCPU_SUPPORT
499endif
500
86bcdb5a
ACM
501ifeq ($(feature-setns), 1)
502 CFLAGS += -DHAVE_SETNS_SUPPORT
503 $(call detected,CONFIG_SETNS)
504endif
505
1c3b28fd
ACM
506ifdef CORESIGHT
507 $(call feature_check,libopencsd)
aa6292f4
MP
508 ifeq ($(feature-libopencsd), 1)
509 CFLAGS += -DHAVE_CSTRACE_SUPPORT $(LIBOPENCSD_CFLAGS)
c152d4d4
MP
510 ifeq ($(feature-reallocarray), 0)
511 CFLAGS += -DCOMPAT_NEED_REALLOCARRAY
512 endif
aa6292f4
MP
513 LDFLAGS += $(LIBOPENCSD_LDFLAGS)
514 EXTLIBS += $(OPENCSDLIBS)
515 $(call detected,CONFIG_LIBOPENCSD)
516 ifdef CSTRACE_RAW
517 CFLAGS += -DCS_DEBUG_RAW
518 ifeq (${CSTRACE_RAW}, packed)
519 CFLAGS += -DCS_RAW_PACKED
520 endif
521 endif
71f7f897
LY
522 else
523 dummy := $(error Error: No libopencsd library found or the version is not up-to-date. Please install recent libopencsd to build with CORESIGHT=1)
aa6292f4
MP
524 endif
525endif
526
9925495d
IR
527ifndef NO_ZLIB
528 ifeq ($(feature-zlib), 1)
529 CFLAGS += -DHAVE_ZLIB_SUPPORT
530 EXTLIBS += -lz
531 $(call detected,CONFIG_ZLIB)
532 else
533 NO_ZLIB := 1
534 endif
535endif
536
cf4cca10 537ifndef NO_LIBELF
fb3d333b 538 CFLAGS += -DHAVE_LIBELF_SUPPORT
5e2d4d0e 539 EXTLIBS += -lelf
709e6791 540 $(call detected,CONFIG_LIBELF)
779724fd 541
b7bcef6f 542 ifeq ($(feature-libelf-getphdrnum), 1)
fb3d333b
IM
543 CFLAGS += -DHAVE_ELF_GETPHDRNUM_SUPPORT
544 endif
545
1c1a3a47
ACM
546 ifeq ($(feature-libelf-gelf_getnote), 1)
547 CFLAGS += -DHAVE_GELF_GETNOTE_SUPPORT
548 else
549 msg := $(warning gelf_getnote() not found on libelf, SDT support disabled);
550 endif
551
2492c465
ACM
552 ifeq ($(feature-libelf-getshdrstrndx), 1)
553 CFLAGS += -DHAVE_ELF_GETSHDRSTRNDX_SUPPORT
554 endif
555
c7a14fdc
FCE
556 ifndef NO_LIBDEBUGINFOD
557 $(call feature_check,libdebuginfod)
558 ifeq ($(feature-libdebuginfod), 1)
559 CFLAGS += -DHAVE_DEBUGINFOD_SUPPORT
560 EXTLIBS += -ldebuginfod
561 endif
562 endif
563
fb3d333b
IM
564 ifndef NO_DWARF
565 ifeq ($(origin PERF_HAVE_DWARF_REGS), undefined)
7a759cd8 566 msg := $(warning DWARF register mappings have not been defined for architecture $(SRCARCH), DWARF support disabled);
fb3d333b
IM
567 NO_DWARF := 1
568 else
569 CFLAGS += -DHAVE_DWARF_SUPPORT $(LIBDW_CFLAGS)
570 LDFLAGS += $(LIBDW_LDFLAGS)
7aec51cb 571 EXTLIBS += ${DWARFLIBS}
8379fce4 572 $(call detected,CONFIG_DWARF)
fb3d333b
IM
573 endif # PERF_HAVE_DWARF_REGS
574 endif # NO_DWARF
ed63f34c
WN
575
576 ifndef NO_LIBBPF
577 ifeq ($(feature-bpf), 1)
7b65e203
JO
578 # detecting libbpf without LIBBPF_DYNAMIC, so make VF=1 shows libbpf detection status
579 $(call feature_check,libbpf)
76a97cf2 580
7b65e203
JO
581 ifdef LIBBPF_DYNAMIC
582 ifeq ($(feature-libbpf), 1)
583 EXTLIBS += -lbpf
9925495d
IR
584 CFLAGS += -DHAVE_LIBBPF_SUPPORT
585 $(call detected,CONFIG_LIBBPF)
ad1237c3 586 $(call detected,CONFIG_LIBBPF_DYNAMIC)
7b65e203 587 else
76a97cf2 588 dummy := $(error Error: No libbpf devel library found or older than v1.0, please install/update libbpf-devel);
7b65e203 589 endif
0ae065a5 590 else
9925495d
IR
591 ifeq ($(NO_ZLIB), 1)
592 dummy := $(warning Warning: Statically building libbpf not possible as zlib is missing)
593 NO_LIBBPF := 1
594 else
595 # Libbpf will be built as a static library from tools/lib/bpf.
596 LIBBPF_STATIC := 1
597 $(call detected,CONFIG_LIBBPF)
598 CFLAGS += -DHAVE_LIBBPF_SUPPORT
599 endif
7b65e203 600 endif
ed63f34c
WN
601 endif
602 endif # NO_LIBBPF
cf4cca10 603endif # NO_LIBELF
0e433feb 604
e26e63be
MH
605ifndef NO_SDT
606 ifneq ($(feature-sdt), 1)
607 msg := $(warning No sys/sdt.h found, no SDT events are defined, please install systemtap-sdt-devel or systemtap-sdt-dev);
608 NO_SDT := 1;
609 else
610 CFLAGS += -DHAVE_SDT_EVENT
611 $(call detected,CONFIG_SDT_EVENT)
612 endif
613endif
614
e12b202f 615ifdef PERF_HAVE_JITDUMP
621cb4e7 616 ifndef NO_LIBELF
e12b202f
JO
617 $(call detected,CONFIG_JITDUMP)
618 CFLAGS += -DHAVE_JITDUMP
619 endif
620endif
621
7a759cd8 622ifeq ($(SRCARCH),powerpc)
65ccb4fa
AB
623 ifndef NO_DWARF
624 CFLAGS += -DHAVE_SKIP_CALLCHAIN_IDX
625 endif
626endif
627
0e433feb 628ifndef NO_LIBUNWIND
9d8e14d3 629 have_libunwind :=
52ffe0ff 630
5c4d7c82 631 $(call feature_check,libunwind-x86)
52ffe0ff
HK
632 ifeq ($(feature-libunwind-x86), 1)
633 $(call detected,CONFIG_LIBUNWIND_X86)
634 CFLAGS += -DHAVE_LIBUNWIND_X86_SUPPORT
635 LDFLAGS += -lunwind-x86
906a8276 636 EXTLIBS_LIBUNWIND += -lunwind-x86
52ffe0ff
HK
637 have_libunwind = 1
638 endif
639
5c4d7c82 640 $(call feature_check,libunwind-aarch64)
057fbfb2
HK
641 ifeq ($(feature-libunwind-aarch64), 1)
642 $(call detected,CONFIG_LIBUNWIND_AARCH64)
643 CFLAGS += -DHAVE_LIBUNWIND_AARCH64_SUPPORT
644 LDFLAGS += -lunwind-aarch64
906a8276 645 EXTLIBS_LIBUNWIND += -lunwind-aarch64
057fbfb2
HK
646 have_libunwind = 1
647 $(call feature_check,libunwind-debug-frame-aarch64)
648 ifneq ($(feature-libunwind-debug-frame-aarch64), 1)
649 msg := $(warning No debug_frame support found in libunwind-aarch64);
650 CFLAGS += -DNO_LIBUNWIND_DEBUG_FRAME_AARCH64
651 endif
652 endif
653
058f952d 654 ifneq ($(feature-libunwind), 1)
0a4f2b6a 655 msg := $(warning No libunwind found. Please install libunwind-dev[el] >= 1.1 and/or set LIBUNWIND_DIR);
9d8e14d3
HK
656 NO_LOCAL_LIBUNWIND := 1
657 else
658 have_libunwind := 1
659 $(call detected,CONFIG_LOCAL_LIBUNWIND)
660 endif
661
662 ifneq ($(have_libunwind), 1)
308e1e70 663 NO_LIBUNWIND := 1
0a4f2b6a 664 endif
9d8e14d3
HK
665else
666 NO_LOCAL_LIBUNWIND := 1
0a4f2b6a
JO
667endif
668
ed63f34c
WN
669ifndef NO_LIBBPF
670 ifneq ($(feature-bpf), 1)
671 msg := $(warning BPF API too old. Please install recent kernel headers. BPF support in 'perf record' is disabled.)
672 NO_LIBBPF := 1
673 endif
674endif
675
9925495d
IR
676ifndef BUILD_BPF_SKEL
677 # BPF skeletons control a large number of perf features, by default
678 # they are enabled.
679 BUILD_BPF_SKEL := 1
680endif
681
682ifeq ($(BUILD_BPF_SKEL),1)
508c9fbc 683 ifeq ($(filter -DHAVE_LIBBPF_SUPPORT, $(CFLAGS)),)
9925495d
IR
684 dummy := $(warning Warning: Disabled BPF skeletons as libbpf is required)
685 BUILD_BPF_SKEL := 0
686 else ifeq ($(filter -DHAVE_LIBELF_SUPPORT, $(CFLAGS)),)
687 dummy := $(warning Warning: Disabled BPF skeletons as libelf is required by bpftool)
688 BUILD_BPF_SKEL := 0
689 else ifeq ($(filter -DHAVE_ZLIB_SUPPORT, $(CFLAGS)),)
690 dummy := $(warning Warning: Disabled BPF skeletons as zlib is required by bpftool)
691 BUILD_BPF_SKEL := 0
692 else ifeq ($(call get-executable,$(CLANG)),)
693 dummy := $(warning Warning: Disabled BPF skeletons as clang ($(CLANG)) is missing)
694 BUILD_BPF_SKEL := 0
695 else
1768d3a0
ACM
696 CLANG_VERSION := $(shell $(CLANG) --version | head -1 | sed 's/.*clang version \([[:digit:]]\+.[[:digit:]]\+.[[:digit:]]\+\).*/\1/g')
697 ifeq ($(call version-lt3,$(CLANG_VERSION),12.0.1),1)
698 dummy := $(warning Warning: Disabled BPF skeletons as reliable BTF generation needs at least $(CLANG) version 12.0.1)
699 BUILD_BPF_SKEL := 0
700 endif
701 endif
702 ifeq ($(BUILD_BPF_SKEL),1)
9925495d
IR
703 $(call feature_check,clang-bpf-co-re)
704 ifeq ($(feature-clang-bpf-co-re), 0)
705 dummy := $(warning Warning: Disabled BPF skeletons as clang is too old)
706 BUILD_BPF_SKEL := 0
707 endif
708 endif
709 ifeq ($(BUILD_BPF_SKEL),1)
710 $(call detected,CONFIG_PERF_BPF_SKEL)
711 CFLAGS += -DHAVE_BPF_SKEL
508c9fbc 712 endif
fbcdaa19
SL
713endif
714
b7a2d774
IR
715ifndef GEN_VMLINUX_H
716 VMLINUX_H=$(src-perf)/util/bpf_skel/vmlinux/vmlinux.h
717endif
718
0a4f2b6a
JO
719dwarf-post-unwind := 1
720dwarf-post-unwind-text := BUG
721
722# setup DWARF post unwinder
723ifdef NO_LIBUNWIND
724 ifdef NO_LIBDW_DWARF_UNWIND
725 msg := $(warning Disabling post unwind, no support found.);
726 dwarf-post-unwind := 0
f47671e2 727 else
0a4f2b6a 728 dwarf-post-unwind-text := libdw
b2e45c32 729 $(call detected,CONFIG_LIBDW_DWARF_UNWIND)
0a4f2b6a
JO
730 endif
731else
732 dwarf-post-unwind-text := libunwind
b2e45c32 733 $(call detected,CONFIG_LIBUNWIND)
0a4f2b6a
JO
734 # Enable libunwind support by default.
735 ifndef NO_LIBDW_DWARF_UNWIND
736 NO_LIBDW_DWARF_UNWIND := 1
737 endif
738endif
739
740ifeq ($(dwarf-post-unwind),1)
741 CFLAGS += -DHAVE_DWARF_UNWIND_SUPPORT
f39e042a 742 $(call detected,CONFIG_DWARF_UNWIND)
0a4f2b6a
JO
743else
744 NO_DWARF_UNWIND := 1
745endif
746
9d8e14d3 747ifndef NO_LOCAL_LIBUNWIND
7a759cd8 748 ifeq ($(SRCARCH),$(filter $(SRCARCH),arm arm64))
0a4f2b6a
JO
749 $(call feature_check,libunwind-debug-frame)
750 ifneq ($(feature-libunwind-debug-frame), 1)
751 msg := $(warning No debug_frame support found in libunwind);
f47671e2
LT
752 CFLAGS += -DNO_LIBUNWIND_DEBUG_FRAME
753 endif
0a4f2b6a
JO
754 else
755 # non-ARM has no dwarf_find_debug_frame() function:
756 CFLAGS += -DNO_LIBUNWIND_DEBUG_FRAME
757 endif
0a4f2b6a 758 EXTLIBS += $(LIBUNWIND_LIBS)
9d8e14d3
HK
759 LDFLAGS += $(LIBUNWIND_LIBS)
760endif
60913e00
KK
761ifeq ($(findstring -static,${LDFLAGS}),-static)
762 # gcc -static links libgcc_eh which contans piece of libunwind
763 LIBUNWIND_LDFLAGS += -Wl,--allow-multiple-definition
764endif
9d8e14d3
HK
765
766ifndef NO_LIBUNWIND
767 CFLAGS += -DHAVE_LIBUNWIND_SUPPORT
0a4f2b6a
JO
768 CFLAGS += $(LIBUNWIND_CFLAGS)
769 LDFLAGS += $(LIBUNWIND_LDFLAGS)
906a8276 770 EXTLIBS += $(EXTLIBS_LIBUNWIND)
058f952d 771endif
a8279525 772
378ef0f5
IR
773ifneq ($(NO_LIBTRACEEVENT),1)
774 ifeq ($(NO_SYSCALL_TABLE),0)
775 $(call detected,CONFIG_TRACE)
776 else
777 ifndef NO_LIBAUDIT
778 $(call feature_check,libaudit)
779 ifneq ($(feature-libaudit), 1)
780 msg := $(warning No libaudit.h found, disables 'trace' tool, please install audit-libs-devel or libaudit-dev);
781 NO_LIBAUDIT := 1
782 else
783 CFLAGS += -DHAVE_LIBAUDIT_SUPPORT
784 EXTLIBS += -laudit
785 $(call detected,CONFIG_TRACE)
786 endif
b3fa3896 787 endif
8e1b3f68 788 endif
a8279525 789endif
4a8f888a 790
8ee46460
SE
791ifndef NO_LIBCRYPTO
792 ifneq ($(feature-libcrypto), 1)
54fceb0b 793 msg := $(warning No libcrypto.h found, disables jitted code injection, please install openssl-devel or libssl-dev);
8ee46460
SE
794 NO_LIBCRYPTO := 1
795 else
796 CFLAGS += -DHAVE_LIBCRYPTO_SUPPORT
797 EXTLIBS += -lcrypto
798 $(call detected,CONFIG_CRYPTO)
799 endif
800endif
801
4a8f888a 802ifndef NO_SLANG
b9498b50 803 ifneq ($(feature-libslang), 1)
78d6ccce
ACM
804 ifneq ($(feature-libslang-include-subdir), 1)
805 msg := $(warning slang not found, disables TUI support. Please install slang-devel, libslang-dev or libslang2-dev);
806 NO_SLANG := 1
807 else
808 CFLAGS += -DHAVE_SLANG_INCLUDE_SUBDIR
809 endif
810 endif
811 ifndef NO_SLANG
8e1b3f68 812 # Fedora has /usr/include/slang/slang.h, but ubuntu /usr/include/slang.h
89fe808a 813 CFLAGS += -DHAVE_SLANG_SUPPORT
8e1b3f68 814 EXTLIBS += -lslang
cf15c74c 815 $(call detected,CONFIG_SLANG)
8e1b3f68 816 endif
4a8f888a 817endif
58cabf6a 818
4751bddd 819ifdef GTK2
a8a5cd8b 820 FLAGS_GTK2=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null)
4751bddd 821 $(call feature_check,gtk2)
7ef9e055 822 ifneq ($(feature-gtk2), 1)
8e1b3f68
JO
823 msg := $(warning GTK2 not found, disables GTK2 support. Please install gtk2-devel or libgtk2.0-dev);
824 NO_GTK2 := 1
825 else
4751bddd 826 $(call feature_check,gtk2-infobar)
c7a79e96 827 ifeq ($(feature-gtk2-infobar), 1)
fc67297b 828 GTK_CFLAGS := -DHAVE_GTK_INFO_BAR_SUPPORT
8e1b3f68 829 endif
89fe808a 830 CFLAGS += -DHAVE_GTK2_SUPPORT
a8a5cd8b
MR
831 GTK_CFLAGS += $(shell $(PKG_CONFIG) --cflags gtk+-2.0 2>/dev/null)
832 GTK_LIBS := $(shell $(PKG_CONFIG) --libs gtk+-2.0 2>/dev/null)
e2137086 833 EXTLIBS += -ldl
8e1b3f68 834 endif
58cabf6a 835endif
3082cb33 836
3082cb33 837ifdef NO_LIBPERL
8e1b3f68 838 CFLAGS += -DNO_LIBPERL
3082cb33 839else
8e1b3f68
JO
840 PERL_EMBED_LDOPTS = $(shell perl -MExtUtils::Embed -e ldopts 2>/dev/null)
841 PERL_EMBED_LDFLAGS = $(call strip-libs,$(PERL_EMBED_LDOPTS))
842 PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS))
86f5fe01 843 PERL_EMBED_CCOPTS = $(shell perl -MExtUtils::Embed -e ccopts 2>/dev/null)
c6707fde 844 PERL_EMBED_CCOPTS := $(filter-out -specs=%,$(PERL_EMBED_CCOPTS))
b773ea65 845 PERL_EMBED_CCOPTS := $(filter-out -flto=auto -ffat-lto-objects, $(PERL_EMBED_CCOPTS))
c6707fde 846 PERL_EMBED_LDOPTS := $(filter-out -specs=%,$(PERL_EMBED_LDOPTS))
8e1b3f68
JO
847 FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS)
848
7181a671 849 ifneq ($(feature-libperl), 1)
8e1b3f68
JO
850 CFLAGS += -DNO_LIBPERL
851 NO_LIBPERL := 1
a954e684 852 msg := $(warning Missing perl devel files. Disabling perl scripting support, please install perl-ExtUtils-Embed/libperl-dev);
8e1b3f68
JO
853 else
854 LDFLAGS += $(PERL_EMBED_LDFLAGS)
855 EXTLIBS += $(PERL_EMBED_LIBADD)
8e2c241f 856 CFLAGS += -DHAVE_LIBPERL_SUPPORT
41caff45
ACM
857 ifeq ($(CC_NO_CLANG), 0)
858 CFLAGS += -Wno-compound-token-split-by-macro
859 endif
c7355f84 860 $(call detected,CONFIG_LIBPERL)
8e1b3f68 861 endif
3082cb33 862endif
6e533cf1 863
87419c9a
DA
864ifeq ($(feature-timerfd), 1)
865 CFLAGS += -DHAVE_TIMERFD_SUPPORT
866else
867 msg := $(warning No timerfd support. Disables 'perf kvm stat live');
868endif
869
6e533cf1
JO
870disable-python = $(eval $(disable-python_code))
871define disable-python_code
9c12cf95 872 CFLAGS += -DNO_LIBPYTHON
6c5aa237 873 $(warning $1)
6e533cf1
JO
874 NO_LIBPYTHON := 1
875endef
876
caec5470 877PYTHON_EXTENSION_SUFFIX := '.so'
56c7d79e 878ifdef NO_LIBPYTHON
6c5aa237 879 $(call disable-python,Python support disabled by user)
6e533cf1
JO
880else
881
56c7d79e 882 ifndef PYTHON
6c5aa237 883 $(call disable-python,No python interpreter was found: disables Python support - please install python-devel/python-dev)
6e533cf1 884 else
56c7d79e 885 PYTHON_WORD := $(call shell-wordify,$(PYTHON))
6e533cf1
JO
886
887 ifndef PYTHON_CONFIG
6c5aa237 888 $(call disable-python,No 'python-config' tool was found: disables Python support - please install python-devel/python-dev)
6e533cf1
JO
889 else
890
9734163b 891 ifneq ($(feature-libpython), 1)
c3c2e8eb 892 $(call disable-python,No 'Python.h' was found: disables Python support - please install python-devel/python-dev)
6e533cf1 893 else
66dfdff0
894 LDFLAGS += $(PYTHON_EMBED_LDFLAGS)
895 EXTLIBS += $(PYTHON_EMBED_LIBADD)
66dfc517
ACM
896 PYTHON_SETUPTOOLS_INSTALLED := $(shell $(PYTHON) -c 'import setuptools;' 2> /dev/null && echo "yes" || echo "no")
897 ifeq ($(PYTHON_SETUPTOOLS_INSTALLED), yes)
898 PYTHON_EXTENSION_SUFFIX := $(shell $(PYTHON) -c 'from importlib import machinery; print(machinery.EXTENSION_SUFFIXES[0])')
899 LANG_BINDINGS += $(obj-perf)python/perf$(PYTHON_EXTENSION_SUFFIX)
900 else
901 msg := $(warning Missing python setuptools, the python binding won't be built, please install python3-setuptools or equivalent);
902 endif
8e2c241f 903 CFLAGS += -DHAVE_LIBPYTHON_SUPPORT
66dfdff0 904 $(call detected,CONFIG_LIBPYTHON)
6e533cf1
JO
905 endif
906 endif
907 endif
908endif
c3cf8368 909
00facc76
IR
910ifneq ($(NO_JEVENTS),1)
911 ifeq ($(wildcard pmu-events/arch/$(SRCARCH)/mapfile.csv),)
912 NO_JEVENTS := 1
913 endif
914endif
915ifneq ($(NO_JEVENTS),1)
916 NO_JEVENTS := 0
917 ifndef PYTHON
175f9315 918 $(error ERROR: No python interpreter needed for jevents generation. Install python or build with NO_JEVENTS=1.)
00facc76
IR
919 else
920 # jevents.py uses f-strings present in Python 3.6 released in Dec. 2016.
921 JEVENTS_PYTHON_GOOD := $(shell $(PYTHON) -c 'import sys;print("1" if(sys.version_info.major >= 3 and sys.version_info.minor >= 6) else "0")' 2> /dev/null)
922 ifneq ($(JEVENTS_PYTHON_GOOD), 1)
175f9315 923 $(error ERROR: Python interpreter needed for jevents generation too old (older than 3.6). Install a newer python or build with NO_JEVENTS=1.)
00facc76
IR
924 endif
925 endif
926endif
2cf90407 927
dd317df0 928ifdef BUILD_NONDISTRO
0d1c50ac
IR
929 ifeq ($(feature-libbfd), 1)
930 EXTLIBS += -lbfd -lopcodes
2cf90407 931 else
0d1c50ac
IR
932 # we are on a system that requires -liberty and (maybe) -lz
933 # to link against -lbfd; test each case individually here
934
935 # call all detections now so we get correct
936 # status in VF output
937 $(call feature_check,libbfd-liberty)
938 $(call feature_check,libbfd-liberty-z)
939
940 ifeq ($(feature-libbfd-liberty), 1)
941 EXTLIBS += -lbfd -lopcodes -liberty
ad5f604e
NK
942 FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -ldl
943 FEATURE_CHECK_LDFLAGS-disassembler-init-styled += -liberty -ldl
0d1c50ac
IR
944 else
945 ifeq ($(feature-libbfd-liberty-z), 1)
946 EXTLIBS += -lbfd -lopcodes -liberty -lz
ad5f604e
NK
947 FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -lz -ldl
948 FEATURE_CHECK_LDFLAGS-disassembler-init-styled += -liberty -lz -ldl
0d1c50ac 949 endif
2cf90407 950 endif
0d1c50ac 951 $(call feature_check,disassembler-four-args)
83aa0120 952 $(call feature_check,disassembler-init-styled)
2cf90407 953 endif
3e6a147d 954
dd317df0 955 CFLAGS += -DHAVE_LIBBFD_SUPPORT
3b4e4efe 956 CXXFLAGS += -DHAVE_LIBBFD_SUPPORT
0d1c50ac
IR
957 ifeq ($(feature-libbfd-buildid), 1)
958 CFLAGS += -DHAVE_LIBBFD_BUILDID_SUPPORT
959 else
960 msg := $(warning Old version of libbfd/binutils things like PE executable profiling will not be available);
961 endif
e71e19a9
ACM
962endif
963
3b4e4efe
IR
964ifndef NO_DEMANGLE
965 $(call feature_check,cxa-demangle)
966 ifeq ($(feature-cxa-demangle), 1)
967 EXTLIBS += -lstdc++
968 CFLAGS += -DHAVE_CXA_DEMANGLE_SUPPORT
969 CXXFLAGS += -DHAVE_CXA_DEMANGLE_SUPPORT
65cd8e55 970 $(call detected,CONFIG_CXX_DEMANGLE)
3b4e4efe 971 endif
dd317df0 972 ifdef BUILD_NONDISTRO
14541b1e
SF
973 ifeq ($(filter -liberty,$(EXTLIBS)),)
974 $(call feature_check,cplus-demangle)
14541b1e
SF
975 ifeq ($(feature-cplus-demangle), 1)
976 EXTLIBS += -liberty
8e1b3f68
JO
977 endif
978 endif
3b4e4efe
IR
979 ifneq ($(filter -liberty,$(EXTLIBS)),)
980 CFLAGS += -DHAVE_CPLUS_DEMANGLE_SUPPORT
981 CXXFLAGS += -DHAVE_CPLUS_DEMANGLE_SUPPORT
982 endif
8e1b3f68 983 endif
3e6a147d
JO
984endif
985
80a32e5b
JO
986ifndef NO_LZMA
987 ifeq ($(feature-lzma), 1)
988 CFLAGS += -DHAVE_LZMA_SUPPORT
989 EXTLIBS += -llzma
990 $(call detected,CONFIG_LZMA)
991 else
992 msg := $(warning No liblzma found, disables xz kernel module decompression, please install xz-devel/liblzma-dev);
993 NO_LZMA := 1
994 endif
995endif
996
3b1c5d96
AB
997ifndef NO_LIBZSTD
998 ifeq ($(feature-libzstd), 1)
999 CFLAGS += -DHAVE_ZSTD_SUPPORT
1000 CFLAGS += $(LIBZSTD_CFLAGS)
1001 LDFLAGS += $(LIBZSTD_LDFLAGS)
1002 EXTLIBS += -lzstd
1003 $(call detected,CONFIG_ZSTD)
1004 else
1005 msg := $(warning No libzstd found, disables trace compression, please install libzstd-dev[el] and/or set LIBZSTD_DIR);
1006 NO_LIBZSTD := 1
1007 endif
1008endif
1009
74d5f3d0
IL
1010ifndef NO_LIBCAP
1011 ifeq ($(feature-libcap), 1)
1012 CFLAGS += -DHAVE_LIBCAP_SUPPORT
1013 EXTLIBS += -lcap
1014 $(call detected,CONFIG_LIBCAP)
1015 else
1016 msg := $(warning No libcap found, disables capability support, please install libcap-devel/libcap-dev);
1017 NO_LIBCAP := 1
1018 endif
1019endif
1020
a1c7c9e7 1021ifndef NO_BACKTRACE
4cc9117a 1022 ifeq ($(feature-backtrace), 1)
89fe808a 1023 CFLAGS += -DHAVE_BACKTRACE_SUPPORT
8e1b3f68 1024 endif
a1c7c9e7 1025endif
58a0abd7
JO
1026
1027ifndef NO_LIBNUMA
3ae069cf 1028 ifeq ($(feature-libnuma), 0)
6305edfc 1029 msg := $(warning No numa.h found, disables 'perf bench numa mem' benchmark, please install numactl-devel/libnuma-devel/libnuma-dev);
8e1b3f68
JO
1030 NO_LIBNUMA := 1
1031 else
f8ac8606
ACM
1032 ifeq ($(feature-numa_num_possible_cpus), 0)
1033 msg := $(warning Old numa library found, disables 'perf bench numa mem' benchmark, please install numactl-devel/libnuma-devel/libnuma-dev >= 2.0.8);
1034 NO_LIBNUMA := 1
1035 else
1036 CFLAGS += -DHAVE_LIBNUMA_SUPPORT
1037 EXTLIBS += -lnuma
1038 $(call detected,CONFIG_NUMA)
1039 endif
8e1b3f68 1040 endif
58a0abd7 1041endif
cd1c39f2 1042
da50ad69
AY
1043ifdef HAVE_KVM_STAT_SUPPORT
1044 CFLAGS += -DHAVE_KVM_STAT_SUPPORT
1045endif
1046
8a1b1718
SL
1047ifeq ($(feature-disassembler-four-args), 1)
1048 CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
1049endif
1050
83aa0120
AF
1051ifeq ($(feature-disassembler-init-styled), 1)
1052 CFLAGS += -DDISASM_INIT_STYLED
1053endif
1054
e477f3f0
AH
1055ifeq (${IS_64_BIT}, 1)
1056 ifndef NO_PERF_READ_VDSO32
1057 $(call feature_check,compile-32)
46b1fa85
AH
1058 ifeq ($(feature-compile-32), 1)
1059 CFLAGS += -DHAVE_PERF_READ_VDSO32
1060 else
e477f3f0
AH
1061 NO_PERF_READ_VDSO32 := 1
1062 endif
1063 endif
7a759cd8 1064 ifneq ($(SRCARCH), x86)
e477f3f0
AH
1065 NO_PERF_READ_VDSOX32 := 1
1066 endif
1067 ifndef NO_PERF_READ_VDSOX32
1068 $(call feature_check,compile-x32)
46b1fa85
AH
1069 ifeq ($(feature-compile-x32), 1)
1070 CFLAGS += -DHAVE_PERF_READ_VDSOX32
1071 else
e477f3f0
AH
1072 NO_PERF_READ_VDSOX32 := 1
1073 endif
1074 endif
1075else
1076 NO_PERF_READ_VDSO32 := 1
1077 NO_PERF_READ_VDSOX32 := 1
1078endif
1079
24787afb 1080ifndef NO_LIBBABELTRACE
97e7a515
JO
1081 $(call feature_check,libbabeltrace)
1082 ifeq ($(feature-libbabeltrace), 1)
53d0a573
JO
1083 CFLAGS += -DHAVE_LIBBABELTRACE_SUPPORT $(LIBBABELTRACE_CFLAGS)
1084 LDFLAGS += $(LIBBABELTRACE_LDFLAGS)
1085 EXTLIBS += -lbabeltrace-ctf
edbe9817 1086 $(call detected,CONFIG_LIBBABELTRACE)
97e7a515
JO
1087 else
1088 msg := $(warning No libbabeltrace found, disables 'perf data' CTF format support, please install libbabeltrace-dev[el]/libbabeltrace-ctf-dev);
53d0a573
JO
1089 endif
1090endif
1091
e31f0d01 1092ifndef NO_AUXTRACE
7a759cd8 1093 ifeq ($(SRCARCH),x86)
08d5204a
MP
1094 ifeq ($(feature-get_cpuid), 0)
1095 msg := $(warning Your gcc lacks the __get_cpuid() builtin, disables support for auxtrace/Intel PT, please install a newer gcc);
1096 NO_AUXTRACE := 1
1097 endif
1098 endif
1099 ifndef NO_AUXTRACE
b0063dbf
ACM
1100 $(call detected,CONFIG_AUXTRACE)
1101 CFLAGS += -DHAVE_AUXTRACE_SUPPORT
70f9c9b2
ACM
1102 ifeq ($(feature-reallocarray), 0)
1103 CFLAGS += -DCOMPAT_NEED_REALLOCARRAY
1104 endif
b0063dbf 1105 endif
e31f0d01
AH
1106endif
1107
d436373a
AH
1108ifdef EXTRA_TESTS
1109 $(call detected,CONFIG_EXTRA_TESTS)
1110 CFLAGS += -DHAVE_EXTRA_TESTS
1111endif
1112
d4dfdf00
JO
1113ifndef NO_JVMTI
1114 ifneq (,$(wildcard /usr/sbin/update-java-alternatives))
1115 JDIR=$(shell /usr/sbin/update-java-alternatives -l | head -1 | awk '{print $$3}')
1116 else
1117 ifneq (,$(wildcard /usr/sbin/alternatives))
815c1560 1118 JDIR=$(shell /usr/sbin/alternatives --display java | tail -1 | cut -d' ' -f 5 | sed -e 's%/jre/bin/java.%%g' -e 's%/bin/java.%%g')
d4dfdf00
JO
1119 endif
1120 endif
1121 ifndef JDIR
1122 $(warning No alternatives command found, you need to set JDIR= to point to the root of your Java directory)
1123 NO_JVMTI := 1
1124 endif
1125endif
1126
1127ifndef NO_JVMTI
1128 FEATURE_CHECK_CFLAGS-jvmti := -I$(JDIR)/include -I$(JDIR)/include/linux
1129 $(call feature_check,jvmti)
1130 ifeq ($(feature-jvmti), 1)
1131 $(call detected_var,JDIR)
dd1d0044
JO
1132 ifndef NO_JVMTI_CMLR
1133 FEATURE_CHECK_CFLAGS-jvmti-cmlr := $(FEATURE_CHECK_CFLAGS-jvmti)
1134 $(call feature_check,jvmti-cmlr)
1135 ifeq ($(feature-jvmti-cmlr), 1)
1136 CFLAGS += -DHAVE_JVMTI_CMLR
1137 endif
1138 endif # NO_JVMTI_CMLR
d4dfdf00 1139 else
e14b733c 1140 $(warning No openjdk development package found, please install JDK package, e.g. openjdk-8-jdk, java-1.8.0-openjdk-devel)
d4dfdf00
JO
1141 NO_JVMTI := 1
1142 endif
1143endif
1144
d7c4f89a 1145ifndef NO_LIBPFM4
70943490
SE
1146 $(call feature_check,libpfm4)
1147 ifeq ($(feature-libpfm4), 1)
1148 CFLAGS += -DHAVE_LIBPFM
1149 EXTLIBS += -lpfm
1150 ASCIIDOC_EXTRA = -aHAVE_LIBPFM=1
1151 $(call detected,CONFIG_LIBPFM4)
1152 else
1153 msg := $(warning libpfm4 not found, disables libpfm4 support. Please install libpfm4-dev);
70943490
SE
1154 endif
1155endif
1156
378ef0f5
IR
1157# libtraceevent is a recommended dependency picked up from the system.
1158ifneq ($(NO_LIBTRACEEVENT),1)
56d32d4c
MP
1159 $(call feature_check,libtraceevent)
1160 ifeq ($(feature-libtraceevent), 1)
378ef0f5 1161 CFLAGS += -DHAVE_LIBTRACEEVENT
56d32d4c 1162 EXTLIBS += -ltraceevent
56971516
IR
1163 LIBTRACEEVENT_VERSION := $(shell $(PKG_CONFIG) --modversion libtraceevent)
1164 LIBTRACEEVENT_VERSION_1 := $(word 1, $(subst ., ,$(LIBTRACEEVENT_VERSION)))
1165 LIBTRACEEVENT_VERSION_2 := $(word 2, $(subst ., ,$(LIBTRACEEVENT_VERSION)))
1166 LIBTRACEEVENT_VERSION_3 := $(word 3, $(subst ., ,$(LIBTRACEEVENT_VERSION)))
1167 LIBTRACEEVENT_VERSION_CPP := $(shell expr $(LIBTRACEEVENT_VERSION_1) \* 255 \* 255 + $(LIBTRACEEVENT_VERSION_2) \* 255 + $(LIBTRACEEVENT_VERSION_3))
1168 CFLAGS += -DLIBTRACEEVENT_VERSION=$(LIBTRACEEVENT_VERSION_CPP)
378ef0f5 1169 $(call detected,CONFIG_LIBTRACEEVENT)
56d32d4c 1170 else
6898e60f 1171 dummy := $(error ERROR: libtraceevent is missing. Please install libtraceevent-dev/libtraceevent-devel or build with NO_LIBTRACEEVENT=1)
56d32d4c 1172 endif
56d32d4c 1173
b758a61b
IR
1174 $(call feature_check,libtracefs)
1175 ifeq ($(feature-libtracefs), 1)
1176 EXTLIBS += -ltracefs
359cad09
IR
1177 LIBTRACEFS_VERSION := $(shell $(PKG_CONFIG) --modversion libtracefs)
1178 LIBTRACEFS_VERSION_1 := $(word 1, $(subst ., ,$(LIBTRACEFS_VERSION)))
1179 LIBTRACEFS_VERSION_2 := $(word 2, $(subst ., ,$(LIBTRACEFS_VERSION)))
1180 LIBTRACEFS_VERSION_3 := $(word 3, $(subst ., ,$(LIBTRACEFS_VERSION)))
1181 LIBTRACEFS_VERSION_CPP := $(shell expr $(LIBTRACEFS_VERSION_1) \* 255 \* 255 + $(LIBTRACEFS_VERSION_2) \* 255 + $(LIBTRACEFS_VERSION_3))
1182 CFLAGS += -DLIBTRACEFS_VERSION=$(LIBTRACEFS_VERSION_CPP)
b758a61b
IR
1183 endif
1184endif
1185
cd1c39f2
JO
1186# Among the variables below, these:
1187# perfexecdir
b018899e 1188# libbpf_include_dir
8f12a2ff 1189# perf_examples_dir
cd1c39f2
JO
1190# template_dir
1191# mandir
1192# infodir
1193# htmldir
1194# ETC_PERFCONFIG (but not sysconfdir)
1195# can be specified as a relative path some/where/else;
1196# this is interpreted as relative to $(prefix) and "perf" at
1197# runtime figures out where they are based on the path to the executable.
1198# This can help installing the suite in a relocatable way.
1199
1200# Make the path relative to DESTDIR, not to prefix
1201ifndef DESTDIR
fc9cabea 1202prefix ?= $(HOME)
cd1c39f2
JO
1203endif
1204bindir_relative = bin
0927beec 1205bindir = $(abspath $(prefix)/$(bindir_relative))
0beb2183
AH
1206includedir_relative = include
1207includedir = $(abspath $(prefix)/$(includedir_relative))
cd1c39f2
JO
1208mandir = share/man
1209infodir = share/info
1210perfexecdir = libexec/perf-core
14e4b9f4 1211# FIXME: system's libbpf header directory, where we expect to find bpf/bpf_helpers.h, for instance
b018899e 1212libbpf_include_dir = /usr/include
83868bf7 1213perf_examples_dir = lib/perf/examples
cd1c39f2
JO
1214sharedir = $(prefix)/share
1215template_dir = share/perf-core/templates
005438a8 1216STRACE_GROUPS_DIR = share/perf-core/strace/groups
cd1c39f2 1217htmldir = share/doc/perf-doc
14cbfbeb 1218tipdir = share/doc/perf-tip
84cfac7f 1219srcdir = $(srctree)/tools/perf
cd1c39f2
JO
1220ifeq ($(prefix),/usr)
1221sysconfdir = /etc
1222ETC_PERFCONFIG = $(sysconfdir)/perfconfig
1223else
1224sysconfdir = $(prefix)/etc
1225ETC_PERFCONFIG = etc/perfconfig
1226endif
6997af72 1227ifndef lib
7a759cd8 1228ifeq ($(SRCARCH)$(IS_64_BIT), x861)
fc67297b
NK
1229lib = lib64
1230else
cd1c39f2 1231lib = lib
fc67297b 1232endif
6997af72 1233endif # lib
fc67297b 1234libdir = $(prefix)/$(lib)
cd1c39f2
JO
1235
1236# Shell quote (do not use $(call) to accommodate ancient setups);
1237ETC_PERFCONFIG_SQ = $(subst ','\'',$(ETC_PERFCONFIG))
005438a8 1238STRACE_GROUPS_DIR_SQ = $(subst ','\'',$(STRACE_GROUPS_DIR))
cd1c39f2
JO
1239DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
1240bindir_SQ = $(subst ','\'',$(bindir))
0beb2183 1241includedir_SQ = $(subst ','\'',$(includedir))
cd1c39f2
JO
1242mandir_SQ = $(subst ','\'',$(mandir))
1243infodir_SQ = $(subst ','\'',$(infodir))
1244perfexecdir_SQ = $(subst ','\'',$(perfexecdir))
b018899e 1245libbpf_include_dir_SQ = $(subst ','\'',$(libbpf_include_dir))
8f12a2ff 1246perf_examples_dir_SQ = $(subst ','\'',$(perf_examples_dir))
cd1c39f2
JO
1247template_dir_SQ = $(subst ','\'',$(template_dir))
1248htmldir_SQ = $(subst ','\'',$(htmldir))
14cbfbeb 1249tipdir_SQ = $(subst ','\'',$(tipdir))
cd1c39f2
JO
1250prefix_SQ = $(subst ','\'',$(prefix))
1251sysconfdir_SQ = $(subst ','\'',$(sysconfdir))
fc67297b 1252libdir_SQ = $(subst ','\'',$(libdir))
84cfac7f 1253srcdir_SQ = $(subst ','\'',$(srcdir))
cd1c39f2
JO
1254
1255ifneq ($(filter /%,$(firstword $(perfexecdir))),)
1256perfexec_instdir = $(perfexecdir)
b018899e 1257perf_include_instdir = $(libbpf_include_dir)
8f12a2ff 1258perf_examples_instdir = $(perf_examples_dir)
005438a8 1259STRACE_GROUPS_INSTDIR = $(STRACE_GROUPS_DIR)
14cbfbeb 1260tip_instdir = $(tipdir)
cd1c39f2
JO
1261else
1262perfexec_instdir = $(prefix)/$(perfexecdir)
b018899e 1263perf_include_instdir = $(prefix)/$(libbpf_include_dir)
8f12a2ff 1264perf_examples_instdir = $(prefix)/$(perf_examples_dir)
005438a8 1265STRACE_GROUPS_INSTDIR = $(prefix)/$(STRACE_GROUPS_DIR)
14cbfbeb 1266tip_instdir = $(prefix)/$(tipdir)
cd1c39f2
JO
1267endif
1268perfexec_instdir_SQ = $(subst ','\'',$(perfexec_instdir))
1b16fffa 1269perf_include_instdir_SQ = $(subst ','\'',$(perf_include_instdir))
8f12a2ff 1270perf_examples_instdir_SQ = $(subst ','\'',$(perf_examples_instdir))
005438a8 1271STRACE_GROUPS_INSTDIR_SQ = $(subst ','\'',$(STRACE_GROUPS_INSTDIR))
14cbfbeb 1272tip_instdir_SQ = $(subst ','\'',$(tip_instdir))
3d7c0144 1273
34bec35c
CH
1274export perfexec_instdir_SQ
1275
4b20d684
JO
1276print_var = $(eval $(print_var_code)) $(info $(MSG))
1277define print_var_code
74da7697 1278 MSG = $(shell printf '...%40s: %s' $(1) $($(1)))
8d79076a
JO
1279endef
1280
709533e5
RS
1281ifeq ($(feature_display),1)
1282 $(call feature_display_entries)
1283endif
1284
0695e57b 1285ifeq ($(VF),1)
99402e06
JO
1286 # Display EXTRA features which are detected manualy
1287 # from here with feature_check call and thus cannot
1288 # be partof global state output.
709533e5 1289 $(foreach feat,$(FEATURE_TESTS_EXTRA),$(call feature_print_status,$(feat),) $(info $(MSG)))
4b20d684
JO
1290 $(call print_var,prefix)
1291 $(call print_var,bindir)
1292 $(call print_var,libdir)
1293 $(call print_var,sysconfdir)
1294 $(call print_var,LIBUNWIND_DIR)
1295 $(call print_var,LIBDW_DIR)
d4dfdf00 1296 $(call print_var,JDIR)
76ee2ff3
JO
1297
1298 ifeq ($(dwarf-post-unwind),1)
709533e5 1299 $(call feature_print_text,"DWARF post unwind library", $(dwarf-post-unwind-text)) $(info $(MSG))
76ee2ff3 1300 endif
0695e57b 1301endif
f39e042a 1302
709533e5
RS
1303$(info )
1304
f39e042a
JO
1305$(call detected_var,bindir_SQ)
1306$(call detected_var,PYTHON_WORD)
1307ifneq ($(OUTPUT),)
1308$(call detected_var,OUTPUT)
1309endif
285ab8bf
JO
1310$(call detected_var,htmldir_SQ)
1311$(call detected_var,infodir_SQ)
1312$(call detected_var,mandir_SQ)
9352aaba 1313$(call detected_var,ETC_PERFCONFIG_SQ)
005438a8 1314$(call detected_var,STRACE_GROUPS_DIR_SQ)
9352aaba
JO
1315$(call detected_var,prefix_SQ)
1316$(call detected_var,perfexecdir_SQ)
b018899e 1317$(call detected_var,libbpf_include_dir_SQ)
8f12a2ff 1318$(call detected_var,perf_examples_dir_SQ)
14cbfbeb 1319$(call detected_var,tipdir_SQ)
84cfac7f 1320$(call detected_var,srcdir_SQ)
3b939a63 1321$(call detected_var,LIBDIR)
88aeea06 1322$(call detected_var,GTK_CFLAGS)
c7355f84
JO
1323$(call detected_var,PERL_EMBED_CCOPTS)
1324$(call detected_var,PYTHON_EMBED_CCOPTS)
6793672a
DZ
1325ifneq ($(BISON_FILE_PREFIX_MAP),)
1326$(call detected_var,BISON_FILE_PREFIX_MAP)
1327endif
fbed59f8
JO
1328
1329# re-generate FEATURE-DUMP as we may have called feature_check, found out
1330# extra libraries to add to LDFLAGS of some other test and then redo those
ad5f604e 1331# tests, see the block about libbfd, disassembler-four-args, for instance.
fbed59f8
JO
1332$(shell rm -f $(FEATURE_DUMP_FILENAME))
1333$(foreach feat,$(FEATURE_TESTS),$(shell echo "$(call feature_assign,$(feat))" >> $(FEATURE_DUMP_FILENAME)))