1 # SPDX-License-Identifier: GPL-2.0-only
4 src-perf := $(srctree)/tools/perf
12 obj-perf := $(abspath $(obj-perf))/
15 $(shell printf "" > $(OUTPUT).config-detected)
16 detected = $(shell echo "$(1)=y" >> $(OUTPUT).config-detected)
17 detected_var = $(shell echo "$(1)=$($(1))" >> $(OUTPUT).config-detected)
19 CFLAGS := $(EXTRA_CFLAGS) $(filter-out -Wnested-externs,$(EXTRA_WARNINGS))
20 HOSTCFLAGS := $(filter-out -Wnested-externs,$(EXTRA_WARNINGS))
22 # Enabled Wthread-safety analysis for clang builds.
23 ifeq ($(CC_NO_CLANG), 0)
24 CFLAGS += -Wthread-safety
27 include $(srctree)/tools/scripts/Makefile.arch
29 $(call detected_var,SRCARCH)
33 ifneq ($(NO_SYSCALL_TABLE),1)
37 ifeq (${IS_64_BIT}, 1)
41 ifeq ($(SRCARCH),$(filter $(SRCARCH),powerpc arm64 s390 mips loongarch))
46 ifneq ($(NO_SYSCALL_TABLE),1)
47 CFLAGS += -DHAVE_SYSCALL_TABLE_SUPPORT
51 # Additional ARCH settings for ppc
52 ifeq ($(SRCARCH),powerpc)
54 CFLAGS += -I$(OUTPUT)arch/powerpc/include/generated
55 LIBUNWIND_LIBS := -lunwind -lunwind-ppc64
58 # Additional ARCH settings for x86
60 $(call detected,CONFIG_X86)
61 ifeq (${IS_64_BIT}, 1)
62 CFLAGS += -DHAVE_ARCH_X86_64_SUPPORT -I$(OUTPUT)arch/x86/include/generated
63 ARCH_INCLUDE = ../../arch/x86/lib/memcpy_64.S ../../arch/x86/lib/memset_64.S
64 LIBUNWIND_LIBS = -lunwind-x86_64 -lunwind -llzma
65 $(call detected,CONFIG_X86_64)
67 LIBUNWIND_LIBS = -lunwind-x86 -llzma -lunwind
74 LIBUNWIND_LIBS = -lunwind -lunwind-arm
77 ifeq ($(SRCARCH),arm64)
79 CFLAGS += -I$(OUTPUT)arch/arm64/include/generated
80 LIBUNWIND_LIBS = -lunwind -lunwind-aarch64
83 ifeq ($(SRCARCH),loongarch)
85 CFLAGS += -I$(OUTPUT)arch/loongarch/include/generated
86 LIBUNWIND_LIBS = -lunwind -lunwind-loongarch64
89 ifeq ($(SRCARCH),riscv)
93 ifeq ($(SRCARCH),csky)
99 CFLAGS += -fPIC -I$(OUTPUT)arch/s390/include/generated
104 CFLAGS += -I$(OUTPUT)arch/mips/include/generated
105 LIBUNWIND_LIBS = -lunwind -lunwind-mips
108 ifeq ($(NO_PERF_REGS),0)
109 $(call detected,CONFIG_PERF_REGS)
112 # So far there's only x86 and arm libdw unwind support merged in perf.
113 # Disable it on all other architectures in case libdw unwind
114 # support is detected in system. Add supported architectures
116 ifneq ($(SRCARCH),$(filter $(SRCARCH),x86 arm arm64 powerpc s390 csky riscv loongarch))
117 NO_LIBDW_DWARF_UNWIND := 1
120 ifeq ($(LIBUNWIND_LIBS),)
124 # For linking with debug library, run like:
126 # make DEBUG=1 LIBUNWIND_DIR=/opt/libunwind/
129 libunwind_arch_set_flags = $(eval $(libunwind_arch_set_flags_code))
130 define 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
136 LIBUNWIND_CFLAGS = -I$(LIBUNWIND_DIR)/include
137 LIBUNWIND_LDFLAGS = -L$(LIBUNWIND_DIR)/lib
138 LIBUNWIND_ARCHS = x86 x86_64 arm aarch64 debug-frame-arm debug-frame-aarch64 loongarch
139 $(foreach libunwind_arch,$(LIBUNWIND_ARCHS),$(call libunwind_arch_set_flags,$(libunwind_arch)))
142 # Set per-feature check compilation flags
143 FEATURE_CHECK_CFLAGS-libunwind = $(LIBUNWIND_CFLAGS)
144 FEATURE_CHECK_LDFLAGS-libunwind = $(LIBUNWIND_LDFLAGS) $(LIBUNWIND_LIBS)
145 FEATURE_CHECK_CFLAGS-libunwind-debug-frame = $(LIBUNWIND_CFLAGS)
146 FEATURE_CHECK_LDFLAGS-libunwind-debug-frame = $(LIBUNWIND_LDFLAGS) $(LIBUNWIND_LIBS)
148 FEATURE_CHECK_LDFLAGS-libunwind-arm += -lunwind -lunwind-arm
149 FEATURE_CHECK_LDFLAGS-libunwind-aarch64 += -lunwind -lunwind-aarch64
150 FEATURE_CHECK_LDFLAGS-libunwind-x86 += -lunwind -llzma -lunwind-x86
151 FEATURE_CHECK_LDFLAGS-libunwind-x86_64 += -lunwind -llzma -lunwind-x86_64
153 FEATURE_CHECK_LDFLAGS-libcrypto = -lcrypto
156 LIBOPENCSD_CFLAGS := -I$(CSINCLUDES)
158 OPENCSDLIBS := -lopencsd_c_api
159 ifeq ($(findstring -static,${LDFLAGS}),-static)
160 OPENCSDLIBS += -lopencsd -lstdc++
163 LIBOPENCSD_LDFLAGS := -L$(CSLIBS)
165 FEATURE_CHECK_CFLAGS-libopencsd := $(LIBOPENCSD_CFLAGS)
166 FEATURE_CHECK_LDFLAGS-libopencsd := $(LIBOPENCSD_LDFLAGS) $(OPENCSDLIBS)
168 ifeq ($(NO_PERF_REGS),0)
169 CFLAGS += -DHAVE_PERF_REGS_SUPPORT
172 # for linking with debug library, run like:
173 # make DEBUG=1 LIBDW_DIR=/opt/libdw/
175 LIBDW_CFLAGS := -I$(LIBDW_DIR)/include
176 LIBDW_LDFLAGS := -L$(LIBDW_DIR)/lib
179 ifeq ($(findstring -static,${LDFLAGS}),-static)
180 DWARFLIBS += -lelf -lebl -ldl -lz -llzma -lbz2
182 FEATURE_CHECK_CFLAGS-libdw-dwarf-unwind := $(LIBDW_CFLAGS)
183 FEATURE_CHECK_LDFLAGS-libdw-dwarf-unwind := $(LIBDW_LDFLAGS) $(DWARFLIBS)
185 # for linking with debug library, run like:
186 # make DEBUG=1 LIBBABELTRACE_DIR=/opt/libbabeltrace/
187 ifdef LIBBABELTRACE_DIR
188 LIBBABELTRACE_CFLAGS := -I$(LIBBABELTRACE_DIR)/include
189 LIBBABELTRACE_LDFLAGS := -L$(LIBBABELTRACE_DIR)/lib
191 FEATURE_CHECK_CFLAGS-libbabeltrace := $(LIBBABELTRACE_CFLAGS)
192 FEATURE_CHECK_LDFLAGS-libbabeltrace := $(LIBBABELTRACE_LDFLAGS) -lbabeltrace-ctf
195 LIBZSTD_CFLAGS := -I$(LIBZSTD_DIR)/lib
196 LIBZSTD_LDFLAGS := -L$(LIBZSTD_DIR)/lib
198 FEATURE_CHECK_CFLAGS-libzstd := $(LIBZSTD_CFLAGS)
199 FEATURE_CHECK_LDFLAGS-libzstd := $(LIBZSTD_LDFLAGS)
201 FEATURE_CHECK_CFLAGS-bpf = -I. -I$(srctree)/tools/include -I$(srctree)/tools/arch/$(SRCARCH)/include/uapi -I$(srctree)/tools/include/uapi
202 # include ARCH specific config
203 -include $(src-perf)/arch/$(SRCARCH)/Makefile
205 ifdef PERF_HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET
206 CFLAGS += -DHAVE_ARCH_REGS_QUERY_REGISTER_OFFSET
209 include $(srctree)/tools/scripts/utilities.mak
211 ifeq ($(call get-executable,$(FLEX)),)
212 dummy := $(error Error: $(FLEX) is missing on this system, please install it)
215 ifeq ($(call get-executable,$(BISON)),)
216 dummy := $(error Error: $(BISON) is missing on this system, please install it)
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)=
225 # Treat warnings as errors unless directed not to
227 CORE_CFLAGS += -Werror
229 HOSTCFLAGS += -Werror
237 CORE_CFLAGS += -DNDEBUG=1
238 ifeq ($(CC_NO_CLANG), 0)
246 PARSER_DEBUG_BISON := -t
247 PARSER_DEBUG_FLEX := -d
248 CFLAGS += -DPARSER_DEBUG
249 $(call detected_var,PARSER_DEBUG_BISON)
250 $(call detected_var,PARSER_DEBUG_FLEX)
253 # Try different combinations to accommodate systems that only have
254 # python[2][3]-config in weird combinations in the following order of
255 # priority from lowest to highest:
256 # * python2-config as per pep-0394.
259 # * $(PYTHON)-config (If PYTHON is user supplied but PYTHON_CONFIG isn't)
261 PYTHON_AUTO := python-config
262 PYTHON_AUTO := $(if $(call get-executable,python2-config),python2-config,$(PYTHON_AUTO))
263 PYTHON_AUTO := $(if $(call get-executable,python-config),python-config,$(PYTHON_AUTO))
264 PYTHON_AUTO := $(if $(call get-executable,python3-config),python3-config,$(PYTHON_AUTO))
266 # If PYTHON is defined but PYTHON_CONFIG isn't, then take $(PYTHON)-config as if it was the user
267 # supplied value for PYTHON_CONFIG. Because it's "user supplied", error out if it doesn't exist.
270 PYTHON_CONFIG_AUTO := $(call get-executable,$(PYTHON)-config)
271 PYTHON_CONFIG := $(if $(PYTHON_CONFIG_AUTO),$(PYTHON_CONFIG_AUTO),\
272 $(call $(error $(PYTHON)-config not found)))
276 # Select either auto detected python and python-config or use user supplied values if they are
277 # defined. get-executable-or-default fails with an error if the first argument is supplied but
279 override PYTHON_CONFIG := $(call get-executable-or-default,PYTHON_CONFIG,$(PYTHON_AUTO))
280 override PYTHON := $(call get-executable-or-default,PYTHON,$(subst -config,,$(PYTHON_CONFIG)))
282 grep-libs = $(filter -l%,$(1))
283 strip-libs = $(filter-out -l%,$(1))
285 PYTHON_CONFIG_SQ := $(call shell-sq,$(PYTHON_CONFIG))
287 # Python 3.8 changed the output of `python-config --ldflags` to not include the
288 # '-lpythonX.Y' flag unless '--embed' is also passed. The feature check for
289 # libpython fails if that flag is not included in LDFLAGS
290 ifeq ($(shell $(PYTHON_CONFIG_SQ) --ldflags --embed 2>&1 1>/dev/null; echo $$?), 0)
291 PYTHON_CONFIG_LDFLAGS := --ldflags --embed
293 PYTHON_CONFIG_LDFLAGS := --ldflags
297 PYTHON_EMBED_LDOPTS := $(shell $(PYTHON_CONFIG_SQ) $(PYTHON_CONFIG_LDFLAGS) 2>/dev/null)
298 PYTHON_EMBED_LDFLAGS := $(call strip-libs,$(PYTHON_EMBED_LDOPTS))
299 PYTHON_EMBED_LIBADD := $(call grep-libs,$(PYTHON_EMBED_LDOPTS)) -lutil
300 PYTHON_EMBED_CCOPTS := $(shell $(PYTHON_CONFIG_SQ) --includes 2>/dev/null)
301 FLAGS_PYTHON_EMBED := $(PYTHON_EMBED_CCOPTS) $(PYTHON_EMBED_LDOPTS)
302 ifeq ($(CC_NO_CLANG), 0)
303 PYTHON_EMBED_CCOPTS := $(filter-out -ffat-lto-objects, $(PYTHON_EMBED_CCOPTS))
307 FEATURE_CHECK_CFLAGS-libpython := $(PYTHON_EMBED_CCOPTS)
308 FEATURE_CHECK_LDFLAGS-libpython := $(PYTHON_EMBED_LDOPTS)
310 FEATURE_CHECK_LDFLAGS-libaio = -lrt
312 CORE_CFLAGS += -fno-omit-frame-pointer
313 CORE_CFLAGS += -ggdb3
314 CORE_CFLAGS += -funwind-tables
316 CORE_CFLAGS += -Wextra
317 CORE_CFLAGS += -std=gnu11
319 CXXFLAGS += -std=gnu++14 -fno-exceptions -fno-rtti
321 CXXFLAGS += -fno-omit-frame-pointer
323 CXXFLAGS += -funwind-tables
324 CXXFLAGS += -Wno-strict-aliasing
327 HOSTCFLAGS += -Wextra
329 # Enforce a non-executable stack, as we may regress (again) in the future by
330 # adding assembler files missing the .GNU-stack linker note.
331 LDFLAGS += -Wl,-z,noexecstack
333 EXTLIBS = -lpthread -lrt -lm -ldl
336 CFLAGS += -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free
337 EXTLIBS += -ltcmalloc
340 ifeq ($(FEATURES_DUMP),)
341 # We will display at the end of this Makefile.config, using $(call feature_display_entries),
342 # as we may retry some feature detection here.
343 FEATURE_DISPLAY_DEFERRED := 1
344 include $(srctree)/tools/build/Makefile.feature
346 include $(FEATURES_DUMP)
349 ifeq ($(feature-stackprotector-all), 1)
350 CORE_CFLAGS += -fstack-protector-all
354 ifeq ($(feature-fortify-source), 1)
355 CORE_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
359 INC_FLAGS += -I$(src-perf)/util/include
360 INC_FLAGS += -I$(src-perf)/arch/$(SRCARCH)/include
361 INC_FLAGS += -I$(srctree)/tools/include/
362 INC_FLAGS += -I$(srctree)/tools/arch/$(SRCARCH)/include/uapi
363 INC_FLAGS += -I$(srctree)/tools/include/uapi
364 INC_FLAGS += -I$(srctree)/tools/arch/$(SRCARCH)/include/
365 INC_FLAGS += -I$(srctree)/tools/arch/$(SRCARCH)/
367 # $(obj-perf) for generated common-cmds.h
368 # $(obj-perf)/util for generated bison/flex headers
370 INC_FLAGS += -I$(obj-perf)/util
371 INC_FLAGS += -I$(obj-perf)
374 INC_FLAGS += -I$(src-perf)/util
375 INC_FLAGS += -I$(src-perf)
377 CORE_CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
379 CFLAGS += $(CORE_CFLAGS) $(INC_FLAGS)
380 CXXFLAGS += $(INC_FLAGS)
382 LIBPERF_CFLAGS := $(CORE_CFLAGS) $(EXTRA_CFLAGS)
384 ifeq ($(feature-pthread-attr-setaffinity-np), 1)
385 CFLAGS += -DHAVE_PTHREAD_ATTR_SETAFFINITY_NP
388 ifeq ($(feature-pthread-barrier), 1)
389 CFLAGS += -DHAVE_PTHREAD_BARRIER
393 $(call feature_check,bionic)
394 ifeq ($(feature-bionic), 1)
396 CFLAGS += -DLACKS_SIGQUEUE_PROTOTYPE
397 CFLAGS += -DLACKS_OPEN_MEMSTREAM_PROTOTYPE
398 EXTLIBS := $(filter-out -lrt,$(EXTLIBS))
399 EXTLIBS := $(filter-out -lpthread,$(EXTLIBS))
403 ifeq ($(feature-eventfd), 1)
404 CFLAGS += -DHAVE_EVENTFD_SUPPORT
407 ifeq ($(feature-get_current_dir_name), 1)
408 CFLAGS += -DHAVE_GET_CURRENT_DIR_NAME
411 ifeq ($(feature-gettid), 1)
412 CFLAGS += -DHAVE_GETTID
415 ifeq ($(feature-file-handle), 1)
416 CFLAGS += -DHAVE_FILE_HANDLE
422 NO_LIBDW_DWARF_UNWIND := 1
426 ifeq ($(feature-libelf), 0)
427 ifeq ($(feature-glibc), 1)
433 ifeq ($(LIBC_SUPPORT),1)
434 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.)
436 ifneq ($(filter s% -fsanitize=address%,$(EXTRA_CFLAGS),),)
437 ifneq ($(shell ldconfig -p | grep libasan >/dev/null 2>&1; echo $$?), 0)
438 msg := $(error No libasan found, please install libasan);
442 ifneq ($(filter s% -fsanitize=undefined%,$(EXTRA_CFLAGS),),)
443 ifneq ($(shell ldconfig -p | grep libubsan >/dev/null 2>&1; echo $$?), 0)
444 msg := $(error No libubsan found, please install libubsan);
448 ifneq ($(filter s% -static%,$(LDFLAGS),),)
449 msg := $(error No static glibc found, please install glibc-static);
451 msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]);
455 ifndef NO_LIBDW_DWARF_UNWIND
456 ifneq ($(feature-libdw-dwarf-unwind),1)
457 NO_LIBDW_DWARF_UNWIND := 1
458 msg := $(warning No libdw DWARF unwind found, Please install elfutils-devel/libdw-dev >= 0.158 and/or set LIBDW_DIR);
461 ifneq ($(feature-dwarf), 1)
463 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);
467 ifneq ($(feature-dwarf_getlocations), 1)
468 msg := $(warning Old libdw.h, finding variables at given 'perf probe' point will not work, install elfutils-devel/libdw-dev >= 0.157);
470 CFLAGS += -DHAVE_DWARF_GETLOCATIONS_SUPPORT
471 endif # dwarf_getlocations
472 endif # Dwarf support
473 endif # libelf support
476 ifeq ($(feature-libaio), 1)
478 CFLAGS += -DHAVE_AIO_SUPPORT
483 NO_LIBDW_DWARF_UNWIND := 1
486 ifeq ($(feature-scandirat), 1)
487 CFLAGS += -DHAVE_SCANDIRAT_SUPPORT
490 ifeq ($(feature-sched_getcpu), 1)
491 CFLAGS += -DHAVE_SCHED_GETCPU_SUPPORT
494 ifeq ($(feature-setns), 1)
495 CFLAGS += -DHAVE_SETNS_SUPPORT
496 $(call detected,CONFIG_SETNS)
500 $(call feature_check,libopencsd)
501 ifeq ($(feature-libopencsd), 1)
502 CFLAGS += -DHAVE_CSTRACE_SUPPORT $(LIBOPENCSD_CFLAGS)
503 ifeq ($(feature-reallocarray), 0)
504 CFLAGS += -DCOMPAT_NEED_REALLOCARRAY
506 LDFLAGS += $(LIBOPENCSD_LDFLAGS)
507 EXTLIBS += $(OPENCSDLIBS)
508 $(call detected,CONFIG_LIBOPENCSD)
510 CFLAGS += -DCS_DEBUG_RAW
511 ifeq (${CSTRACE_RAW}, packed)
512 CFLAGS += -DCS_RAW_PACKED
516 dummy := $(error Error: No libopencsd library found or the version is not up-to-date. Please install recent libopencsd to build with CORESIGHT=1)
521 CFLAGS += -DHAVE_LIBELF_SUPPORT
523 $(call detected,CONFIG_LIBELF)
525 ifeq ($(feature-libelf-getphdrnum), 1)
526 CFLAGS += -DHAVE_ELF_GETPHDRNUM_SUPPORT
529 ifeq ($(feature-libelf-gelf_getnote), 1)
530 CFLAGS += -DHAVE_GELF_GETNOTE_SUPPORT
532 msg := $(warning gelf_getnote() not found on libelf, SDT support disabled);
535 ifeq ($(feature-libelf-getshdrstrndx), 1)
536 CFLAGS += -DHAVE_ELF_GETSHDRSTRNDX_SUPPORT
539 ifndef NO_LIBDEBUGINFOD
540 $(call feature_check,libdebuginfod)
541 ifeq ($(feature-libdebuginfod), 1)
542 CFLAGS += -DHAVE_DEBUGINFOD_SUPPORT
543 EXTLIBS += -ldebuginfod
548 ifeq ($(origin PERF_HAVE_DWARF_REGS), undefined)
549 msg := $(warning DWARF register mappings have not been defined for architecture $(SRCARCH), DWARF support disabled);
552 CFLAGS += -DHAVE_DWARF_SUPPORT $(LIBDW_CFLAGS)
553 LDFLAGS += $(LIBDW_LDFLAGS)
554 EXTLIBS += ${DWARFLIBS}
555 $(call detected,CONFIG_DWARF)
556 endif # PERF_HAVE_DWARF_REGS
560 ifeq ($(feature-bpf), 1)
561 CFLAGS += -DHAVE_LIBBPF_SUPPORT
562 $(call detected,CONFIG_LIBBPF)
564 # detecting libbpf without LIBBPF_DYNAMIC, so make VF=1 shows libbpf detection status
565 $(call feature_check,libbpf)
568 ifeq ($(feature-libbpf), 1)
570 $(call detected,CONFIG_LIBBPF_DYNAMIC)
572 dummy := $(error Error: No libbpf devel library found or older than v1.0, please install/update libbpf-devel);
575 # Libbpf will be built as a static library from tools/lib/bpf.
581 ifdef PERF_HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET
582 CFLAGS += -DHAVE_BPF_PROLOGUE
583 $(call detected,CONFIG_BPF_PROLOGUE)
585 msg := $(warning BPF prologue is not supported by architecture $(SRCARCH), missing regs_query_register_offset());
588 msg := $(warning DWARF support is off, BPF prologue is disabled);
595 ifneq ($(feature-sdt), 1)
596 msg := $(warning No sys/sdt.h found, no SDT events are defined, please install systemtap-sdt-devel or systemtap-sdt-dev);
599 CFLAGS += -DHAVE_SDT_EVENT
600 $(call detected,CONFIG_SDT_EVENT)
604 ifdef PERF_HAVE_JITDUMP
606 $(call detected,CONFIG_JITDUMP)
607 CFLAGS += -DHAVE_JITDUMP
611 ifeq ($(SRCARCH),powerpc)
613 CFLAGS += -DHAVE_SKIP_CALLCHAIN_IDX
620 $(call feature_check,libunwind-x86)
621 ifeq ($(feature-libunwind-x86), 1)
622 $(call detected,CONFIG_LIBUNWIND_X86)
623 CFLAGS += -DHAVE_LIBUNWIND_X86_SUPPORT
624 LDFLAGS += -lunwind-x86
625 EXTLIBS_LIBUNWIND += -lunwind-x86
629 $(call feature_check,libunwind-aarch64)
630 ifeq ($(feature-libunwind-aarch64), 1)
631 $(call detected,CONFIG_LIBUNWIND_AARCH64)
632 CFLAGS += -DHAVE_LIBUNWIND_AARCH64_SUPPORT
633 LDFLAGS += -lunwind-aarch64
634 EXTLIBS_LIBUNWIND += -lunwind-aarch64
636 $(call feature_check,libunwind-debug-frame-aarch64)
637 ifneq ($(feature-libunwind-debug-frame-aarch64), 1)
638 msg := $(warning No debug_frame support found in libunwind-aarch64);
639 CFLAGS += -DNO_LIBUNWIND_DEBUG_FRAME_AARCH64
643 ifneq ($(feature-libunwind), 1)
644 msg := $(warning No libunwind found. Please install libunwind-dev[el] >= 1.1 and/or set LIBUNWIND_DIR);
645 NO_LOCAL_LIBUNWIND := 1
648 $(call detected,CONFIG_LOCAL_LIBUNWIND)
651 ifneq ($(have_libunwind), 1)
655 NO_LOCAL_LIBUNWIND := 1
659 ifneq ($(feature-bpf), 1)
660 msg := $(warning BPF API too old. Please install recent kernel headers. BPF support in 'perf record' is disabled.)
666 $(call feature_check,clang-bpf-co-re)
667 ifeq ($(feature-clang-bpf-co-re), 0)
668 dummy := $(error Error: clang too old/not installed. Please install recent clang to build with BUILD_BPF_SKEL)
670 ifeq ($(filter -DHAVE_LIBBPF_SUPPORT, $(CFLAGS)),)
671 dummy := $(error Error: BPF skeleton support requires libbpf)
673 $(call detected,CONFIG_PERF_BPF_SKEL)
674 CFLAGS += -DHAVE_BPF_SKEL
677 dwarf-post-unwind := 1
678 dwarf-post-unwind-text := BUG
680 # setup DWARF post unwinder
682 ifdef NO_LIBDW_DWARF_UNWIND
683 msg := $(warning Disabling post unwind, no support found.);
684 dwarf-post-unwind := 0
686 dwarf-post-unwind-text := libdw
687 $(call detected,CONFIG_LIBDW_DWARF_UNWIND)
690 dwarf-post-unwind-text := libunwind
691 $(call detected,CONFIG_LIBUNWIND)
692 # Enable libunwind support by default.
693 ifndef NO_LIBDW_DWARF_UNWIND
694 NO_LIBDW_DWARF_UNWIND := 1
698 ifeq ($(dwarf-post-unwind),1)
699 CFLAGS += -DHAVE_DWARF_UNWIND_SUPPORT
700 $(call detected,CONFIG_DWARF_UNWIND)
705 ifndef NO_LOCAL_LIBUNWIND
706 ifeq ($(SRCARCH),$(filter $(SRCARCH),arm arm64))
707 $(call feature_check,libunwind-debug-frame)
708 ifneq ($(feature-libunwind-debug-frame), 1)
709 msg := $(warning No debug_frame support found in libunwind);
710 CFLAGS += -DNO_LIBUNWIND_DEBUG_FRAME
713 # non-ARM has no dwarf_find_debug_frame() function:
714 CFLAGS += -DNO_LIBUNWIND_DEBUG_FRAME
716 EXTLIBS += $(LIBUNWIND_LIBS)
717 LDFLAGS += $(LIBUNWIND_LIBS)
719 ifeq ($(findstring -static,${LDFLAGS}),-static)
720 # gcc -static links libgcc_eh which contans piece of libunwind
721 LIBUNWIND_LDFLAGS += -Wl,--allow-multiple-definition
725 CFLAGS += -DHAVE_LIBUNWIND_SUPPORT
726 CFLAGS += $(LIBUNWIND_CFLAGS)
727 LDFLAGS += $(LIBUNWIND_LDFLAGS)
728 EXTLIBS += $(EXTLIBS_LIBUNWIND)
731 ifneq ($(NO_LIBTRACEEVENT),1)
732 ifeq ($(NO_SYSCALL_TABLE),0)
733 $(call detected,CONFIG_TRACE)
736 $(call feature_check,libaudit)
737 ifneq ($(feature-libaudit), 1)
738 msg := $(warning No libaudit.h found, disables 'trace' tool, please install audit-libs-devel or libaudit-dev);
741 CFLAGS += -DHAVE_LIBAUDIT_SUPPORT
743 $(call detected,CONFIG_TRACE)
750 ifneq ($(feature-libcrypto), 1)
751 msg := $(warning No libcrypto.h found, disables jitted code injection, please install openssl-devel or libssl-dev);
754 CFLAGS += -DHAVE_LIBCRYPTO_SUPPORT
756 $(call detected,CONFIG_CRYPTO)
761 ifneq ($(feature-libslang), 1)
762 ifneq ($(feature-libslang-include-subdir), 1)
763 msg := $(warning slang not found, disables TUI support. Please install slang-devel, libslang-dev or libslang2-dev);
766 CFLAGS += -DHAVE_SLANG_INCLUDE_SUBDIR
770 # Fedora has /usr/include/slang/slang.h, but ubuntu /usr/include/slang.h
771 CFLAGS += -DHAVE_SLANG_SUPPORT
773 $(call detected,CONFIG_SLANG)
778 FLAGS_GTK2=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null)
779 $(call feature_check,gtk2)
780 ifneq ($(feature-gtk2), 1)
781 msg := $(warning GTK2 not found, disables GTK2 support. Please install gtk2-devel or libgtk2.0-dev);
784 $(call feature_check,gtk2-infobar)
785 ifeq ($(feature-gtk2-infobar), 1)
786 GTK_CFLAGS := -DHAVE_GTK_INFO_BAR_SUPPORT
788 CFLAGS += -DHAVE_GTK2_SUPPORT
789 GTK_CFLAGS += $(shell $(PKG_CONFIG) --cflags gtk+-2.0 2>/dev/null)
790 GTK_LIBS := $(shell $(PKG_CONFIG) --libs gtk+-2.0 2>/dev/null)
796 CFLAGS += -DNO_LIBPERL
798 PERL_EMBED_LDOPTS = $(shell perl -MExtUtils::Embed -e ldopts 2>/dev/null)
799 PERL_EMBED_LDFLAGS = $(call strip-libs,$(PERL_EMBED_LDOPTS))
800 PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS))
801 PERL_EMBED_CCOPTS = $(shell perl -MExtUtils::Embed -e ccopts 2>/dev/null)
802 PERL_EMBED_CCOPTS := $(filter-out -specs=%,$(PERL_EMBED_CCOPTS))
803 PERL_EMBED_CCOPTS := $(filter-out -flto=auto -ffat-lto-objects, $(PERL_EMBED_CCOPTS))
804 PERL_EMBED_LDOPTS := $(filter-out -specs=%,$(PERL_EMBED_LDOPTS))
805 FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS)
807 ifneq ($(feature-libperl), 1)
808 CFLAGS += -DNO_LIBPERL
810 msg := $(warning Missing perl devel files. Disabling perl scripting support, please install perl-ExtUtils-Embed/libperl-dev);
812 LDFLAGS += $(PERL_EMBED_LDFLAGS)
813 EXTLIBS += $(PERL_EMBED_LIBADD)
814 CFLAGS += -DHAVE_LIBPERL_SUPPORT
815 ifeq ($(CC_NO_CLANG), 0)
816 CFLAGS += -Wno-compound-token-split-by-macro
818 $(call detected,CONFIG_LIBPERL)
822 ifeq ($(feature-timerfd), 1)
823 CFLAGS += -DHAVE_TIMERFD_SUPPORT
825 msg := $(warning No timerfd support. Disables 'perf kvm stat live');
828 disable-python = $(eval $(disable-python_code))
829 define disable-python_code
830 CFLAGS += -DNO_LIBPYTHON
835 PYTHON_EXTENSION_SUFFIX := '.so'
837 $(call disable-python,Python support disabled by user)
841 $(call disable-python,No python interpreter was found: disables Python support - please install python-devel/python-dev)
843 PYTHON_WORD := $(call shell-wordify,$(PYTHON))
846 $(call disable-python,No 'python-config' tool was found: disables Python support - please install python-devel/python-dev)
849 ifneq ($(feature-libpython), 1)
850 $(call disable-python,No 'Python.h' was found: disables Python support - please install python-devel/python-dev)
852 LDFLAGS += $(PYTHON_EMBED_LDFLAGS)
853 EXTLIBS += $(PYTHON_EMBED_LIBADD)
854 PYTHON_SETUPTOOLS_INSTALLED := $(shell $(PYTHON) -c 'import setuptools;' 2> /dev/null && echo "yes" || echo "no")
855 ifeq ($(PYTHON_SETUPTOOLS_INSTALLED), yes)
856 PYTHON_EXTENSION_SUFFIX := $(shell $(PYTHON) -c 'from importlib import machinery; print(machinery.EXTENSION_SUFFIXES[0])')
857 LANG_BINDINGS += $(obj-perf)python/perf$(PYTHON_EXTENSION_SUFFIX)
859 msg := $(warning Missing python setuptools, the python binding won't be built, please install python3-setuptools or equivalent);
861 CFLAGS += -DHAVE_LIBPYTHON_SUPPORT
862 $(call detected,CONFIG_LIBPYTHON)
868 ifneq ($(NO_JEVENTS),1)
869 ifeq ($(wildcard pmu-events/arch/$(SRCARCH)/mapfile.csv),)
873 ifneq ($(NO_JEVENTS),1)
876 $(error ERROR: No python interpreter needed for jevents generation. Install python or build with NO_JEVENTS=1.)
878 # jevents.py uses f-strings present in Python 3.6 released in Dec. 2016.
879 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)
880 ifneq ($(JEVENTS_PYTHON_GOOD), 1)
881 $(error ERROR: Python interpreter needed for jevents generation too old (older than 3.6). Install a newer python or build with NO_JEVENTS=1.)
886 ifdef BUILD_NONDISTRO
887 ifeq ($(feature-libbfd), 1)
888 EXTLIBS += -lbfd -lopcodes
890 # we are on a system that requires -liberty and (maybe) -lz
891 # to link against -lbfd; test each case individually here
893 # call all detections now so we get correct
894 # status in VF output
895 $(call feature_check,libbfd-liberty)
896 $(call feature_check,libbfd-liberty-z)
898 ifeq ($(feature-libbfd-liberty), 1)
899 EXTLIBS += -lbfd -lopcodes -liberty
901 ifeq ($(feature-libbfd-liberty-z), 1)
902 EXTLIBS += -lbfd -lopcodes -liberty -lz
905 $(call feature_check,disassembler-four-args)
906 $(call feature_check,disassembler-init-styled)
909 CFLAGS += -DHAVE_LIBBFD_SUPPORT
910 CXXFLAGS += -DHAVE_LIBBFD_SUPPORT
911 ifeq ($(feature-libbfd-buildid), 1)
912 CFLAGS += -DHAVE_LIBBFD_BUILDID_SUPPORT
914 msg := $(warning Old version of libbfd/binutils things like PE executable profiling will not be available);
919 $(call feature_check,cxa-demangle)
920 ifeq ($(feature-cxa-demangle), 1)
922 CFLAGS += -DHAVE_CXA_DEMANGLE_SUPPORT
923 CXXFLAGS += -DHAVE_CXA_DEMANGLE_SUPPORT
925 ifdef BUILD_NONDISTRO
926 ifeq ($(filter -liberty,$(EXTLIBS)),)
927 $(call feature_check,cplus-demangle)
928 ifeq ($(feature-cplus-demangle), 1)
932 ifneq ($(filter -liberty,$(EXTLIBS)),)
933 CFLAGS += -DHAVE_CPLUS_DEMANGLE_SUPPORT
934 CXXFLAGS += -DHAVE_CPLUS_DEMANGLE_SUPPORT
940 ifeq ($(feature-zlib), 1)
941 CFLAGS += -DHAVE_ZLIB_SUPPORT
943 $(call detected,CONFIG_ZLIB)
950 ifeq ($(feature-lzma), 1)
951 CFLAGS += -DHAVE_LZMA_SUPPORT
953 $(call detected,CONFIG_LZMA)
955 msg := $(warning No liblzma found, disables xz kernel module decompression, please install xz-devel/liblzma-dev);
961 ifeq ($(feature-libzstd), 1)
962 CFLAGS += -DHAVE_ZSTD_SUPPORT
963 CFLAGS += $(LIBZSTD_CFLAGS)
964 LDFLAGS += $(LIBZSTD_LDFLAGS)
966 $(call detected,CONFIG_ZSTD)
968 msg := $(warning No libzstd found, disables trace compression, please install libzstd-dev[el] and/or set LIBZSTD_DIR);
974 ifeq ($(feature-libcap), 1)
975 CFLAGS += -DHAVE_LIBCAP_SUPPORT
977 $(call detected,CONFIG_LIBCAP)
979 msg := $(warning No libcap found, disables capability support, please install libcap-devel/libcap-dev);
985 ifeq ($(feature-backtrace), 1)
986 CFLAGS += -DHAVE_BACKTRACE_SUPPORT
991 ifeq ($(feature-libnuma), 0)
992 msg := $(warning No numa.h found, disables 'perf bench numa mem' benchmark, please install numactl-devel/libnuma-devel/libnuma-dev);
995 ifeq ($(feature-numa_num_possible_cpus), 0)
996 msg := $(warning Old numa library found, disables 'perf bench numa mem' benchmark, please install numactl-devel/libnuma-devel/libnuma-dev >= 2.0.8);
999 CFLAGS += -DHAVE_LIBNUMA_SUPPORT
1001 $(call detected,CONFIG_NUMA)
1006 ifdef HAVE_KVM_STAT_SUPPORT
1007 CFLAGS += -DHAVE_KVM_STAT_SUPPORT
1010 ifeq ($(feature-disassembler-four-args), 1)
1011 CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
1014 ifeq ($(feature-disassembler-init-styled), 1)
1015 CFLAGS += -DDISASM_INIT_STYLED
1018 ifeq (${IS_64_BIT}, 1)
1019 ifndef NO_PERF_READ_VDSO32
1020 $(call feature_check,compile-32)
1021 ifeq ($(feature-compile-32), 1)
1022 CFLAGS += -DHAVE_PERF_READ_VDSO32
1024 NO_PERF_READ_VDSO32 := 1
1027 ifneq ($(SRCARCH), x86)
1028 NO_PERF_READ_VDSOX32 := 1
1030 ifndef NO_PERF_READ_VDSOX32
1031 $(call feature_check,compile-x32)
1032 ifeq ($(feature-compile-x32), 1)
1033 CFLAGS += -DHAVE_PERF_READ_VDSOX32
1035 NO_PERF_READ_VDSOX32 := 1
1039 NO_PERF_READ_VDSO32 := 1
1040 NO_PERF_READ_VDSOX32 := 1
1043 ifndef NO_LIBBABELTRACE
1044 $(call feature_check,libbabeltrace)
1045 ifeq ($(feature-libbabeltrace), 1)
1046 CFLAGS += -DHAVE_LIBBABELTRACE_SUPPORT $(LIBBABELTRACE_CFLAGS)
1047 LDFLAGS += $(LIBBABELTRACE_LDFLAGS)
1048 EXTLIBS += -lbabeltrace-ctf
1049 $(call detected,CONFIG_LIBBABELTRACE)
1051 msg := $(warning No libbabeltrace found, disables 'perf data' CTF format support, please install libbabeltrace-dev[el]/libbabeltrace-ctf-dev);
1056 ifeq ($(SRCARCH),x86)
1057 ifeq ($(feature-get_cpuid), 0)
1058 msg := $(warning Your gcc lacks the __get_cpuid() builtin, disables support for auxtrace/Intel PT, please install a newer gcc);
1063 $(call detected,CONFIG_AUXTRACE)
1064 CFLAGS += -DHAVE_AUXTRACE_SUPPORT
1065 ifeq ($(feature-reallocarray), 0)
1066 CFLAGS += -DCOMPAT_NEED_REALLOCARRAY
1072 ifneq (,$(wildcard /usr/sbin/update-java-alternatives))
1073 JDIR=$(shell /usr/sbin/update-java-alternatives -l | head -1 | awk '{print $$3}')
1075 ifneq (,$(wildcard /usr/sbin/alternatives))
1076 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')
1080 $(warning No alternatives command found, you need to set JDIR= to point to the root of your Java directory)
1086 FEATURE_CHECK_CFLAGS-jvmti := -I$(JDIR)/include -I$(JDIR)/include/linux
1087 $(call feature_check,jvmti)
1088 ifeq ($(feature-jvmti), 1)
1089 $(call detected_var,JDIR)
1090 ifndef NO_JVMTI_CMLR
1091 FEATURE_CHECK_CFLAGS-jvmti-cmlr := $(FEATURE_CHECK_CFLAGS-jvmti)
1092 $(call feature_check,jvmti-cmlr)
1093 ifeq ($(feature-jvmti-cmlr), 1)
1094 CFLAGS += -DHAVE_JVMTI_CMLR
1096 endif # NO_JVMTI_CMLR
1098 $(warning No openjdk development package found, please install JDK package, e.g. openjdk-8-jdk, java-1.8.0-openjdk-devel)
1106 $(call feature_check,cxx)
1107 ifneq ($(feature-cxx), 1)
1108 msg := $(warning No g++ found, disable clang and llvm support. Please install g++)
1110 $(call feature_check,llvm)
1111 $(call feature_check,llvm-version)
1112 ifneq ($(feature-llvm), 1)
1113 msg := $(warning No suitable libLLVM found, disabling builtin clang and LLVM support. Please install llvm-dev(el) (>= 3.9.0))
1115 $(call feature_check,clang)
1116 ifneq ($(feature-clang), 1)
1117 msg := $(warning No suitable libclang found, disabling builtin clang and LLVM support. Please install libclang-dev(el) (>= 3.9.0))
1119 CFLAGS += -DHAVE_LIBCLANGLLVM_SUPPORT
1120 CXXFLAGS += -DHAVE_LIBCLANGLLVM_SUPPORT -I$(shell $(LLVM_CONFIG) --includedir)
1121 $(call detected,CONFIG_CXX)
1122 $(call detected,CONFIG_CLANGLLVM)
1126 ifneq ($(feature-llvm-version),1)
1127 msg := $(warning This version of LLVM is not tested. May cause build errors)
1135 $(call feature_check,libpfm4)
1136 ifeq ($(feature-libpfm4), 1)
1137 CFLAGS += -DHAVE_LIBPFM
1139 ASCIIDOC_EXTRA = -aHAVE_LIBPFM=1
1140 $(call detected,CONFIG_LIBPFM4)
1142 msg := $(warning libpfm4 not found, disables libpfm4 support. Please install libpfm4-dev);
1146 # libtraceevent is a recommended dependency picked up from the system.
1147 ifneq ($(NO_LIBTRACEEVENT),1)
1148 $(call feature_check,libtraceevent)
1149 ifeq ($(feature-libtraceevent), 1)
1150 CFLAGS += -DHAVE_LIBTRACEEVENT
1151 EXTLIBS += -ltraceevent
1152 LIBTRACEEVENT_VERSION := $(shell $(PKG_CONFIG) --modversion libtraceevent)
1153 LIBTRACEEVENT_VERSION_1 := $(word 1, $(subst ., ,$(LIBTRACEEVENT_VERSION)))
1154 LIBTRACEEVENT_VERSION_2 := $(word 2, $(subst ., ,$(LIBTRACEEVENT_VERSION)))
1155 LIBTRACEEVENT_VERSION_3 := $(word 3, $(subst ., ,$(LIBTRACEEVENT_VERSION)))
1156 LIBTRACEEVENT_VERSION_CPP := $(shell expr $(LIBTRACEEVENT_VERSION_1) \* 255 \* 255 + $(LIBTRACEEVENT_VERSION_2) \* 255 + $(LIBTRACEEVENT_VERSION_3))
1157 CFLAGS += -DLIBTRACEEVENT_VERSION=$(LIBTRACEEVENT_VERSION_CPP)
1158 $(call detected,CONFIG_LIBTRACEEVENT)
1160 dummy := $(error ERROR: libtraceevent is missing. Please install libtraceevent-dev/libtraceevent-devel or build with NO_LIBTRACEEVENT=1)
1163 $(call feature_check,libtracefs)
1164 ifeq ($(feature-libtracefs), 1)
1165 EXTLIBS += -ltracefs
1166 LIBTRACEFS_VERSION := $(shell $(PKG_CONFIG) --modversion libtracefs)
1167 LIBTRACEFS_VERSION_1 := $(word 1, $(subst ., ,$(LIBTRACEFS_VERSION)))
1168 LIBTRACEFS_VERSION_2 := $(word 2, $(subst ., ,$(LIBTRACEFS_VERSION)))
1169 LIBTRACEFS_VERSION_3 := $(word 3, $(subst ., ,$(LIBTRACEFS_VERSION)))
1170 LIBTRACEFS_VERSION_CPP := $(shell expr $(LIBTRACEFS_VERSION_1) \* 255 \* 255 + $(LIBTRACEFS_VERSION_2) \* 255 + $(LIBTRACEFS_VERSION_3))
1171 CFLAGS += -DLIBTRACEFS_VERSION=$(LIBTRACEFS_VERSION_CPP)
1175 # Among the variables below, these:
1177 # libbpf_include_dir
1183 # ETC_PERFCONFIG (but not sysconfdir)
1184 # can be specified as a relative path some/where/else;
1185 # this is interpreted as relative to $(prefix) and "perf" at
1186 # runtime figures out where they are based on the path to the executable.
1187 # This can help installing the suite in a relocatable way.
1189 # Make the path relative to DESTDIR, not to prefix
1193 bindir_relative = bin
1194 bindir = $(abspath $(prefix)/$(bindir_relative))
1195 includedir_relative = include
1196 includedir = $(abspath $(prefix)/$(includedir_relative))
1198 infodir = share/info
1199 perfexecdir = libexec/perf-core
1200 # FIXME: system's libbpf header directory, where we expect to find bpf/bpf_helpers.h, for instance
1201 libbpf_include_dir = /usr/include
1202 perf_examples_dir = lib/perf/examples
1203 sharedir = $(prefix)/share
1204 template_dir = share/perf-core/templates
1205 STRACE_GROUPS_DIR = share/perf-core/strace/groups
1206 htmldir = share/doc/perf-doc
1207 tipdir = share/doc/perf-tip
1208 srcdir = $(srctree)/tools/perf
1209 ifeq ($(prefix),/usr)
1211 ETC_PERFCONFIG = $(sysconfdir)/perfconfig
1213 sysconfdir = $(prefix)/etc
1214 ETC_PERFCONFIG = etc/perfconfig
1217 ifeq ($(SRCARCH)$(IS_64_BIT), x861)
1223 libdir = $(prefix)/$(lib)
1225 # Shell quote (do not use $(call) to accommodate ancient setups);
1226 ETC_PERFCONFIG_SQ = $(subst ','\'',$(ETC_PERFCONFIG))
1227 STRACE_GROUPS_DIR_SQ = $(subst ','\'',$(STRACE_GROUPS_DIR))
1228 DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
1229 bindir_SQ = $(subst ','\'',$(bindir))
1230 includedir_SQ = $(subst ','\'',$(includedir))
1231 mandir_SQ = $(subst ','\'',$(mandir))
1232 infodir_SQ = $(subst ','\'',$(infodir))
1233 perfexecdir_SQ = $(subst ','\'',$(perfexecdir))
1234 libbpf_include_dir_SQ = $(subst ','\'',$(libbpf_include_dir))
1235 perf_examples_dir_SQ = $(subst ','\'',$(perf_examples_dir))
1236 template_dir_SQ = $(subst ','\'',$(template_dir))
1237 htmldir_SQ = $(subst ','\'',$(htmldir))
1238 tipdir_SQ = $(subst ','\'',$(tipdir))
1239 prefix_SQ = $(subst ','\'',$(prefix))
1240 sysconfdir_SQ = $(subst ','\'',$(sysconfdir))
1241 libdir_SQ = $(subst ','\'',$(libdir))
1242 srcdir_SQ = $(subst ','\'',$(srcdir))
1244 ifneq ($(filter /%,$(firstword $(perfexecdir))),)
1245 perfexec_instdir = $(perfexecdir)
1246 perf_include_instdir = $(libbpf_include_dir)
1247 perf_examples_instdir = $(perf_examples_dir)
1248 STRACE_GROUPS_INSTDIR = $(STRACE_GROUPS_DIR)
1249 tip_instdir = $(tipdir)
1251 perfexec_instdir = $(prefix)/$(perfexecdir)
1252 perf_include_instdir = $(prefix)/$(libbpf_include_dir)
1253 perf_examples_instdir = $(prefix)/$(perf_examples_dir)
1254 STRACE_GROUPS_INSTDIR = $(prefix)/$(STRACE_GROUPS_DIR)
1255 tip_instdir = $(prefix)/$(tipdir)
1257 perfexec_instdir_SQ = $(subst ','\'',$(perfexec_instdir))
1258 perf_include_instdir_SQ = $(subst ','\'',$(perf_include_instdir))
1259 perf_examples_instdir_SQ = $(subst ','\'',$(perf_examples_instdir))
1260 STRACE_GROUPS_INSTDIR_SQ = $(subst ','\'',$(STRACE_GROUPS_INSTDIR))
1261 tip_instdir_SQ = $(subst ','\'',$(tip_instdir))
1263 export perfexec_instdir_SQ
1265 print_var = $(eval $(print_var_code)) $(info $(MSG))
1266 define print_var_code
1267 MSG = $(shell printf '...%40s: %s' $(1) $($(1)))
1270 ifeq ($(feature_display),1)
1271 $(call feature_display_entries)
1275 # Display EXTRA features which are detected manualy
1276 # from here with feature_check call and thus cannot
1277 # be partof global state output.
1278 $(foreach feat,$(FEATURE_TESTS_EXTRA),$(call feature_print_status,$(feat),) $(info $(MSG)))
1279 $(call print_var,prefix)
1280 $(call print_var,bindir)
1281 $(call print_var,libdir)
1282 $(call print_var,sysconfdir)
1283 $(call print_var,LIBUNWIND_DIR)
1284 $(call print_var,LIBDW_DIR)
1285 $(call print_var,JDIR)
1287 ifeq ($(dwarf-post-unwind),1)
1288 $(call feature_print_text,"DWARF post unwind library", $(dwarf-post-unwind-text)) $(info $(MSG))
1294 $(call detected_var,bindir_SQ)
1295 $(call detected_var,PYTHON_WORD)
1297 $(call detected_var,OUTPUT)
1299 $(call detected_var,htmldir_SQ)
1300 $(call detected_var,infodir_SQ)
1301 $(call detected_var,mandir_SQ)
1302 $(call detected_var,ETC_PERFCONFIG_SQ)
1303 $(call detected_var,STRACE_GROUPS_DIR_SQ)
1304 $(call detected_var,prefix_SQ)
1305 $(call detected_var,perfexecdir_SQ)
1306 $(call detected_var,libbpf_include_dir_SQ)
1307 $(call detected_var,perf_examples_dir_SQ)
1308 $(call detected_var,tipdir_SQ)
1309 $(call detected_var,srcdir_SQ)
1310 $(call detected_var,LIBDIR)
1311 $(call detected_var,GTK_CFLAGS)
1312 $(call detected_var,PERL_EMBED_CCOPTS)
1313 $(call detected_var,PYTHON_EMBED_CCOPTS)
1314 ifneq ($(BISON_FILE_PREFIX_MAP),)
1315 $(call detected_var,BISON_FILE_PREFIX_MAP)
1318 # re-generate FEATURE-DUMP as we may have called feature_check, found out
1319 # extra libraries to add to LDFLAGS of some other test and then redo those
1321 $(shell rm -f $(FEATURE_DUMP_FILENAME))
1322 $(foreach feat,$(FEATURE_TESTS),$(shell echo "$(call feature_assign,$(feat))" >> $(FEATURE_DUMP_FILENAME)))