• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# SPDX-License-Identifier: GPL-2.0-only
2
3ifeq ($(src-perf),)
4src-perf := $(srctree)/tools/perf
5endif
6
7ifeq ($(obj-perf),)
8obj-perf := $(OUTPUT)
9endif
10
11ifneq ($(obj-perf),)
12obj-perf := $(abspath $(obj-perf))/
13endif
14
15$(shell printf "" > $(OUTPUT).config-detected)
16detected     = $(shell echo "$(1)=y"       >> $(OUTPUT).config-detected)
17detected_var = $(shell echo "$(1)=$($(1))" >> $(OUTPUT).config-detected)
18
19CFLAGS := $(EXTRA_CFLAGS) $(EXTRA_WARNINGS)
20
21include $(srctree)/tools/scripts/Makefile.arch
22
23$(call detected_var,SRCARCH)
24
25NO_PERF_REGS := 1
26NO_SYSCALL_TABLE := 1
27
28# Additional ARCH settings for ppc
29ifeq ($(SRCARCH),powerpc)
30  NO_PERF_REGS := 0
31  NO_SYSCALL_TABLE := 0
32  CFLAGS += -I$(OUTPUT)arch/powerpc/include/generated
33  LIBUNWIND_LIBS := -lunwind -lunwind-ppc64
34endif
35
36# Additional ARCH settings for x86
37ifeq ($(SRCARCH),x86)
38  $(call detected,CONFIG_X86)
39  ifeq (${IS_64_BIT}, 1)
40    NO_SYSCALL_TABLE := 0
41    CFLAGS += -DHAVE_ARCH_X86_64_SUPPORT -I$(OUTPUT)arch/x86/include/generated
42    ARCH_INCLUDE = ../../arch/x86/lib/memcpy_64.S ../../arch/x86/lib/memset_64.S
43    LIBUNWIND_LIBS = -lunwind-x86_64 -lunwind -llzma
44    $(call detected,CONFIG_X86_64)
45  else
46    LIBUNWIND_LIBS = -lunwind-x86 -llzma -lunwind
47  endif
48  NO_PERF_REGS := 0
49endif
50
51ifeq ($(SRCARCH),arm)
52  NO_PERF_REGS := 0
53  LIBUNWIND_LIBS = -lunwind -lunwind-arm
54endif
55
56ifeq ($(SRCARCH),arm64)
57  NO_PERF_REGS := 0
58  NO_SYSCALL_TABLE := 0
59  CFLAGS += -I$(OUTPUT)arch/arm64/include/generated
60  LIBUNWIND_LIBS = -lunwind -lunwind-aarch64
61endif
62
63ifeq ($(SRCARCH),riscv)
64  NO_PERF_REGS := 0
65endif
66
67ifeq ($(SRCARCH),csky)
68  NO_PERF_REGS := 0
69endif
70
71ifeq ($(ARCH),s390)
72  NO_PERF_REGS := 0
73  NO_SYSCALL_TABLE := 0
74  CFLAGS += -fPIC -I$(OUTPUT)arch/s390/include/generated
75endif
76
77ifeq ($(NO_PERF_REGS),0)
78  $(call detected,CONFIG_PERF_REGS)
79endif
80
81ifneq ($(NO_SYSCALL_TABLE),1)
82  CFLAGS += -DHAVE_SYSCALL_TABLE_SUPPORT
83endif
84
85# So far there's only x86 and arm libdw unwind support merged in perf.
86# Disable it on all other architectures in case libdw unwind
87# support is detected in system. Add supported architectures
88# to the check.
89ifneq ($(SRCARCH),$(filter $(SRCARCH),x86 arm arm64 powerpc s390 csky riscv))
90  NO_LIBDW_DWARF_UNWIND := 1
91endif
92
93ifeq ($(LIBUNWIND_LIBS),)
94  NO_LIBUNWIND := 1
95endif
96#
97# For linking with debug library, run like:
98#
99#   make DEBUG=1 LIBUNWIND_DIR=/opt/libunwind/
100#
101
102libunwind_arch_set_flags = $(eval $(libunwind_arch_set_flags_code))
103define libunwind_arch_set_flags_code
104  FEATURE_CHECK_CFLAGS-libunwind-$(1)  = -I$(LIBUNWIND_DIR)/include
105  FEATURE_CHECK_LDFLAGS-libunwind-$(1) = -L$(LIBUNWIND_DIR)/lib
106endef
107
108ifdef LIBUNWIND_DIR
109  LIBUNWIND_CFLAGS  = -I$(LIBUNWIND_DIR)/include
110  LIBUNWIND_LDFLAGS = -L$(LIBUNWIND_DIR)/lib
111  LIBUNWIND_ARCHS = x86 x86_64 arm aarch64 debug-frame-arm debug-frame-aarch64
112  $(foreach libunwind_arch,$(LIBUNWIND_ARCHS),$(call libunwind_arch_set_flags,$(libunwind_arch)))
113endif
114
115# Set per-feature check compilation flags
116FEATURE_CHECK_CFLAGS-libunwind = $(LIBUNWIND_CFLAGS)
117FEATURE_CHECK_LDFLAGS-libunwind = $(LIBUNWIND_LDFLAGS) $(LIBUNWIND_LIBS)
118FEATURE_CHECK_CFLAGS-libunwind-debug-frame = $(LIBUNWIND_CFLAGS)
119FEATURE_CHECK_LDFLAGS-libunwind-debug-frame = $(LIBUNWIND_LDFLAGS) $(LIBUNWIND_LIBS)
120
121FEATURE_CHECK_LDFLAGS-libunwind-arm += -lunwind -lunwind-arm
122FEATURE_CHECK_LDFLAGS-libunwind-aarch64 += -lunwind -lunwind-aarch64
123FEATURE_CHECK_LDFLAGS-libunwind-x86 += -lunwind -llzma -lunwind-x86
124FEATURE_CHECK_LDFLAGS-libunwind-x86_64 += -lunwind -llzma -lunwind-x86_64
125
126FEATURE_CHECK_LDFLAGS-libcrypto = -lcrypto
127
128ifdef CSINCLUDES
129  LIBOPENCSD_CFLAGS := -I$(CSINCLUDES)
130endif
131OPENCSDLIBS := -lopencsd_c_api -lopencsd
132ifdef CSLIBS
133  LIBOPENCSD_LDFLAGS := -L$(CSLIBS)
134endif
135FEATURE_CHECK_CFLAGS-libopencsd := $(LIBOPENCSD_CFLAGS)
136FEATURE_CHECK_LDFLAGS-libopencsd := $(LIBOPENCSD_LDFLAGS) $(OPENCSDLIBS)
137
138ifeq ($(NO_PERF_REGS),0)
139  CFLAGS += -DHAVE_PERF_REGS_SUPPORT
140endif
141
142# for linking with debug library, run like:
143# make DEBUG=1 LIBDW_DIR=/opt/libdw/
144ifdef LIBDW_DIR
145  LIBDW_CFLAGS  := -I$(LIBDW_DIR)/include
146  LIBDW_LDFLAGS := -L$(LIBDW_DIR)/lib
147endif
148DWARFLIBS := -ldw
149ifeq ($(findstring -static,${LDFLAGS}),-static)
150  DWARFLIBS += -lelf -lebl -ldl -lz -llzma -lbz2
151endif
152FEATURE_CHECK_CFLAGS-libdw-dwarf-unwind := $(LIBDW_CFLAGS)
153FEATURE_CHECK_LDFLAGS-libdw-dwarf-unwind := $(LIBDW_LDFLAGS) $(DWARFLIBS)
154
155# for linking with debug library, run like:
156# make DEBUG=1 LIBBABELTRACE_DIR=/opt/libbabeltrace/
157ifdef LIBBABELTRACE_DIR
158  LIBBABELTRACE_CFLAGS  := -I$(LIBBABELTRACE_DIR)/include
159  LIBBABELTRACE_LDFLAGS := -L$(LIBBABELTRACE_DIR)/lib
160endif
161FEATURE_CHECK_CFLAGS-libbabeltrace := $(LIBBABELTRACE_CFLAGS)
162FEATURE_CHECK_LDFLAGS-libbabeltrace := $(LIBBABELTRACE_LDFLAGS) -lbabeltrace-ctf
163
164ifdef LIBZSTD_DIR
165  LIBZSTD_CFLAGS  := -I$(LIBZSTD_DIR)/lib
166  LIBZSTD_LDFLAGS := -L$(LIBZSTD_DIR)/lib
167endif
168FEATURE_CHECK_CFLAGS-libzstd := $(LIBZSTD_CFLAGS)
169FEATURE_CHECK_LDFLAGS-libzstd := $(LIBZSTD_LDFLAGS)
170
171FEATURE_CHECK_CFLAGS-bpf = -I. -I$(srctree)/tools/include -I$(srctree)/tools/arch/$(SRCARCH)/include/uapi -I$(srctree)/tools/include/uapi
172# include ARCH specific config
173-include $(src-perf)/arch/$(SRCARCH)/Makefile
174
175ifdef PERF_HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET
176  CFLAGS += -DHAVE_ARCH_REGS_QUERY_REGISTER_OFFSET
177endif
178
179include $(srctree)/tools/scripts/utilities.mak
180
181ifeq ($(call get-executable,$(FLEX)),)
182  dummy := $(error Error: $(FLEX) is missing on this system, please install it)
183endif
184
185ifeq ($(call get-executable,$(BISON)),)
186  dummy := $(error Error: $(BISON) is missing on this system, please install it)
187endif
188
189# Treat warnings as errors unless directed not to
190ifneq ($(WERROR),0)
191  CFLAGS += -Werror
192  CXXFLAGS += -Werror
193endif
194
195ifndef DEBUG
196  DEBUG := 0
197endif
198
199ifeq ($(DEBUG),0)
200ifeq ($(CC_NO_CLANG), 0)
201  CFLAGS += -O3
202else
203  CFLAGS += -O6
204endif
205endif
206
207ifdef PARSER_DEBUG
208  PARSER_DEBUG_BISON := -t
209  PARSER_DEBUG_FLEX  := -d
210  CFLAGS             += -DPARSER_DEBUG
211  $(call detected_var,PARSER_DEBUG_BISON)
212  $(call detected_var,PARSER_DEBUG_FLEX)
213endif
214
215# Try different combinations to accommodate systems that only have
216# python[2][-config] in weird combinations but always preferring
217# python2 and python2-config as per pep-0394. If we catch a
218# python[-config] in version 3, the version check will kill it.
219PYTHON2 := $(if $(call get-executable,python2),python2,python)
220override PYTHON := $(call get-executable-or-default,PYTHON,$(PYTHON2))
221PYTHON2_CONFIG := \
222  $(if $(call get-executable,$(PYTHON)-config),$(PYTHON)-config,python-config)
223override PYTHON_CONFIG := \
224  $(call get-executable-or-default,PYTHON_CONFIG,$(PYTHON2_CONFIG))
225
226grep-libs  = $(filter -l%,$(1))
227strip-libs  = $(filter-out -l%,$(1))
228
229PYTHON_CONFIG_SQ := $(call shell-sq,$(PYTHON_CONFIG))
230
231# Python 3.8 changed the output of `python-config --ldflags` to not include the
232# '-lpythonX.Y' flag unless '--embed' is also passed. The feature check for
233# libpython fails if that flag is not included in LDFLAGS
234ifeq ($(shell $(PYTHON_CONFIG_SQ) --ldflags --embed 2>&1 1>/dev/null; echo $$?), 0)
235  PYTHON_CONFIG_LDFLAGS := --ldflags --embed
236else
237  PYTHON_CONFIG_LDFLAGS := --ldflags
238endif
239
240ifdef PYTHON_CONFIG
241  PYTHON_EMBED_LDOPTS := $(shell $(PYTHON_CONFIG_SQ) $(PYTHON_CONFIG_LDFLAGS) 2>/dev/null)
242  PYTHON_EMBED_LDFLAGS := $(call strip-libs,$(PYTHON_EMBED_LDOPTS))
243  PYTHON_EMBED_LIBADD := $(call grep-libs,$(PYTHON_EMBED_LDOPTS)) -lutil
244  PYTHON_EMBED_CCOPTS := $(shell $(PYTHON_CONFIG_SQ) --includes 2>/dev/null)
245  FLAGS_PYTHON_EMBED := $(PYTHON_EMBED_CCOPTS) $(PYTHON_EMBED_LDOPTS)
246endif
247
248FEATURE_CHECK_CFLAGS-libpython := $(PYTHON_EMBED_CCOPTS)
249FEATURE_CHECK_LDFLAGS-libpython := $(PYTHON_EMBED_LDOPTS)
250
251FEATURE_CHECK_LDFLAGS-libaio = -lrt
252
253FEATURE_CHECK_LDFLAGS-disassembler-four-args = -lbfd -lopcodes -ldl
254
255CFLAGS += -fno-omit-frame-pointer
256CFLAGS += -ggdb3
257CFLAGS += -funwind-tables
258CFLAGS += -Wall
259CFLAGS += -Wextra
260CFLAGS += -std=gnu99
261
262CXXFLAGS += -std=gnu++11 -fno-exceptions -fno-rtti
263CXXFLAGS += -Wall
264CXXFLAGS += -fno-omit-frame-pointer
265CXXFLAGS += -ggdb3
266CXXFLAGS += -funwind-tables
267CXXFLAGS += -Wno-strict-aliasing
268
269# Enforce a non-executable stack, as we may regress (again) in the future by
270# adding assembler files missing the .GNU-stack linker note.
271LDFLAGS += -Wl,-z,noexecstack
272
273EXTLIBS = -lpthread -lrt -lm -ldl
274
275ifeq ($(FEATURES_DUMP),)
276include $(srctree)/tools/build/Makefile.feature
277else
278include $(FEATURES_DUMP)
279endif
280
281ifeq ($(feature-stackprotector-all), 1)
282  CFLAGS += -fstack-protector-all
283endif
284
285ifeq ($(DEBUG),0)
286  ifeq ($(feature-fortify-source), 1)
287    CFLAGS += -D_FORTIFY_SOURCE=2
288  endif
289endif
290
291INC_FLAGS += -I$(src-perf)/lib/include
292INC_FLAGS += -I$(src-perf)/util/include
293INC_FLAGS += -I$(src-perf)/arch/$(SRCARCH)/include
294INC_FLAGS += -I$(srctree)/tools/include/
295INC_FLAGS += -I$(srctree)/tools/arch/$(SRCARCH)/include/uapi
296INC_FLAGS += -I$(srctree)/tools/include/uapi
297INC_FLAGS += -I$(srctree)/tools/arch/$(SRCARCH)/include/
298INC_FLAGS += -I$(srctree)/tools/arch/$(SRCARCH)/
299
300# $(obj-perf)      for generated common-cmds.h
301# $(obj-perf)/util for generated bison/flex headers
302ifneq ($(OUTPUT),)
303INC_FLAGS += -I$(obj-perf)/util
304INC_FLAGS += -I$(obj-perf)
305endif
306
307INC_FLAGS += -I$(src-perf)/util
308INC_FLAGS += -I$(src-perf)
309INC_FLAGS += -I$(srctree)/tools/lib/
310
311CFLAGS   += $(INC_FLAGS)
312CXXFLAGS += $(INC_FLAGS)
313
314CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
315
316ifeq ($(feature-sync-compare-and-swap), 1)
317  CFLAGS += -DHAVE_SYNC_COMPARE_AND_SWAP_SUPPORT
318endif
319
320ifeq ($(feature-pthread-attr-setaffinity-np), 1)
321  CFLAGS += -DHAVE_PTHREAD_ATTR_SETAFFINITY_NP
322endif
323
324ifeq ($(feature-pthread-barrier), 1)
325  CFLAGS += -DHAVE_PTHREAD_BARRIER
326endif
327
328ifndef NO_BIONIC
329  $(call feature_check,bionic)
330  ifeq ($(feature-bionic), 1)
331    BIONIC := 1
332    CFLAGS += -DLACKS_SIGQUEUE_PROTOTYPE
333    CFLAGS += -DLACKS_OPEN_MEMSTREAM_PROTOTYPE
334    EXTLIBS := $(filter-out -lrt,$(EXTLIBS))
335    EXTLIBS := $(filter-out -lpthread,$(EXTLIBS))
336  endif
337endif
338
339ifeq ($(feature-eventfd), 1)
340  CFLAGS += -DHAVE_EVENTFD
341endif
342
343ifeq ($(feature-get_current_dir_name), 1)
344  CFLAGS += -DHAVE_GET_CURRENT_DIR_NAME
345endif
346
347ifeq ($(feature-gettid), 1)
348  CFLAGS += -DHAVE_GETTID
349endif
350
351ifdef NO_LIBELF
352  NO_DWARF := 1
353  NO_DEMANGLE := 1
354  NO_LIBUNWIND := 1
355  NO_LIBDW_DWARF_UNWIND := 1
356  NO_LIBBPF := 1
357  NO_JVMTI := 1
358else
359  ifeq ($(feature-libelf), 0)
360    ifeq ($(feature-glibc), 1)
361      LIBC_SUPPORT := 1
362    endif
363    ifeq ($(BIONIC),1)
364      LIBC_SUPPORT := 1
365    endif
366    ifeq ($(LIBC_SUPPORT),1)
367      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);
368
369      NO_LIBELF := 1
370      NO_DWARF := 1
371      NO_DEMANGLE := 1
372      NO_LIBUNWIND := 1
373      NO_LIBDW_DWARF_UNWIND := 1
374      NO_LIBBPF := 1
375      NO_JVMTI := 1
376    else
377      ifneq ($(filter s% -static%,$(LDFLAGS),),)
378        msg := $(error No static glibc found, please install glibc-static);
379      else
380        msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]);
381      endif
382    endif
383  else
384    ifndef NO_LIBDW_DWARF_UNWIND
385      ifneq ($(feature-libdw-dwarf-unwind),1)
386        NO_LIBDW_DWARF_UNWIND := 1
387        msg := $(warning No libdw DWARF unwind found, Please install elfutils-devel/libdw-dev >= 0.158 and/or set LIBDW_DIR);
388      endif
389    endif
390    ifneq ($(feature-dwarf), 1)
391      ifndef NO_DWARF
392        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);
393        NO_DWARF := 1
394      endif
395    else
396      ifneq ($(feature-dwarf_getlocations), 1)
397        msg := $(warning Old libdw.h, finding variables at given 'perf probe' point will not work, install elfutils-devel/libdw-dev >= 0.157);
398      else
399        CFLAGS += -DHAVE_DWARF_GETLOCATIONS_SUPPORT
400      endif # dwarf_getlocations
401    endif # Dwarf support
402  endif # libelf support
403endif # NO_LIBELF
404
405ifeq ($(feature-glibc), 1)
406  CFLAGS += -DHAVE_GLIBC_SUPPORT
407endif
408
409ifeq ($(feature-libaio), 1)
410  ifndef NO_AIO
411    CFLAGS += -DHAVE_AIO_SUPPORT
412  endif
413endif
414
415ifdef NO_DWARF
416  NO_LIBDW_DWARF_UNWIND := 1
417endif
418
419ifeq ($(feature-sched_getcpu), 1)
420  CFLAGS += -DHAVE_SCHED_GETCPU_SUPPORT
421endif
422
423ifeq ($(feature-setns), 1)
424  CFLAGS += -DHAVE_SETNS_SUPPORT
425  $(call detected,CONFIG_SETNS)
426endif
427
428ifdef CORESIGHT
429  $(call feature_check,libopencsd)
430  ifeq ($(feature-libopencsd), 1)
431    CFLAGS += -DHAVE_CSTRACE_SUPPORT $(LIBOPENCSD_CFLAGS)
432    ifeq ($(feature-reallocarray), 0)
433      CFLAGS += -DCOMPAT_NEED_REALLOCARRAY
434    endif
435    LDFLAGS += $(LIBOPENCSD_LDFLAGS)
436    EXTLIBS += $(OPENCSDLIBS)
437    $(call detected,CONFIG_LIBOPENCSD)
438    ifdef CSTRACE_RAW
439      CFLAGS += -DCS_DEBUG_RAW
440      ifeq (${CSTRACE_RAW}, packed)
441        CFLAGS += -DCS_RAW_PACKED
442      endif
443    endif
444  endif
445endif
446
447ifndef NO_LIBELF
448  CFLAGS += -DHAVE_LIBELF_SUPPORT
449  EXTLIBS += -lelf
450  $(call detected,CONFIG_LIBELF)
451
452  ifeq ($(feature-libelf-mmap), 1)
453    CFLAGS += -DHAVE_LIBELF_MMAP_SUPPORT
454  endif
455
456  ifeq ($(feature-libelf-getphdrnum), 1)
457    CFLAGS += -DHAVE_ELF_GETPHDRNUM_SUPPORT
458  endif
459
460  ifeq ($(feature-libelf-gelf_getnote), 1)
461    CFLAGS += -DHAVE_GELF_GETNOTE_SUPPORT
462  else
463    msg := $(warning gelf_getnote() not found on libelf, SDT support disabled);
464  endif
465
466  ifeq ($(feature-libelf-getshdrstrndx), 1)
467    CFLAGS += -DHAVE_ELF_GETSHDRSTRNDX_SUPPORT
468  endif
469
470  ifndef NO_DWARF
471    ifeq ($(origin PERF_HAVE_DWARF_REGS), undefined)
472      msg := $(warning DWARF register mappings have not been defined for architecture $(SRCARCH), DWARF support disabled);
473      NO_DWARF := 1
474    else
475      CFLAGS += -DHAVE_DWARF_SUPPORT $(LIBDW_CFLAGS)
476      LDFLAGS += $(LIBDW_LDFLAGS)
477      EXTLIBS += ${DWARFLIBS}
478      $(call detected,CONFIG_DWARF)
479    endif # PERF_HAVE_DWARF_REGS
480  endif # NO_DWARF
481
482  ifndef NO_LIBBPF
483    ifeq ($(feature-bpf), 1)
484      CFLAGS += -DHAVE_LIBBPF_SUPPORT
485      $(call detected,CONFIG_LIBBPF)
486    endif
487
488    ifndef NO_DWARF
489      ifdef PERF_HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET
490        CFLAGS += -DHAVE_BPF_PROLOGUE
491        $(call detected,CONFIG_BPF_PROLOGUE)
492      else
493        msg := $(warning BPF prologue is not supported by architecture $(SRCARCH), missing regs_query_register_offset());
494      endif
495    else
496      msg := $(warning DWARF support is off, BPF prologue is disabled);
497    endif
498
499  endif # NO_LIBBPF
500endif # NO_LIBELF
501
502ifndef NO_SDT
503  ifneq ($(feature-sdt), 1)
504    msg := $(warning No sys/sdt.h found, no SDT events are defined, please install systemtap-sdt-devel or systemtap-sdt-dev);
505    NO_SDT := 1;
506  else
507    CFLAGS += -DHAVE_SDT_EVENT
508    $(call detected,CONFIG_SDT_EVENT)
509  endif
510endif
511
512ifdef PERF_HAVE_JITDUMP
513  ifndef NO_LIBELF
514    $(call detected,CONFIG_JITDUMP)
515    CFLAGS += -DHAVE_JITDUMP
516  endif
517endif
518
519ifeq ($(SRCARCH),powerpc)
520  ifndef NO_DWARF
521    CFLAGS += -DHAVE_SKIP_CALLCHAIN_IDX
522  endif
523endif
524
525ifndef NO_LIBUNWIND
526  have_libunwind :=
527
528  $(call feature_check,libunwind-x86)
529  ifeq ($(feature-libunwind-x86), 1)
530    $(call detected,CONFIG_LIBUNWIND_X86)
531    CFLAGS += -DHAVE_LIBUNWIND_X86_SUPPORT
532    LDFLAGS += -lunwind-x86
533    EXTLIBS_LIBUNWIND += -lunwind-x86
534    have_libunwind = 1
535  endif
536
537  $(call feature_check,libunwind-aarch64)
538  ifeq ($(feature-libunwind-aarch64), 1)
539    $(call detected,CONFIG_LIBUNWIND_AARCH64)
540    CFLAGS += -DHAVE_LIBUNWIND_AARCH64_SUPPORT
541    LDFLAGS += -lunwind-aarch64
542    EXTLIBS_LIBUNWIND += -lunwind-aarch64
543    have_libunwind = 1
544    $(call feature_check,libunwind-debug-frame-aarch64)
545    ifneq ($(feature-libunwind-debug-frame-aarch64), 1)
546      msg := $(warning No debug_frame support found in libunwind-aarch64);
547      CFLAGS += -DNO_LIBUNWIND_DEBUG_FRAME_AARCH64
548    endif
549  endif
550
551  ifneq ($(feature-libunwind), 1)
552    msg := $(warning No libunwind found. Please install libunwind-dev[el] >= 1.1 and/or set LIBUNWIND_DIR);
553    NO_LOCAL_LIBUNWIND := 1
554  else
555    have_libunwind := 1
556    $(call detected,CONFIG_LOCAL_LIBUNWIND)
557  endif
558
559  ifneq ($(have_libunwind), 1)
560    NO_LIBUNWIND := 1
561  endif
562else
563  NO_LOCAL_LIBUNWIND := 1
564endif
565
566ifndef NO_LIBBPF
567  ifneq ($(feature-bpf), 1)
568    msg := $(warning BPF API too old. Please install recent kernel headers. BPF support in 'perf record' is disabled.)
569    NO_LIBBPF := 1
570  endif
571endif
572
573dwarf-post-unwind := 1
574dwarf-post-unwind-text := BUG
575
576# setup DWARF post unwinder
577ifdef NO_LIBUNWIND
578  ifdef NO_LIBDW_DWARF_UNWIND
579    msg := $(warning Disabling post unwind, no support found.);
580    dwarf-post-unwind := 0
581  else
582    dwarf-post-unwind-text := libdw
583    $(call detected,CONFIG_LIBDW_DWARF_UNWIND)
584  endif
585else
586  dwarf-post-unwind-text := libunwind
587  $(call detected,CONFIG_LIBUNWIND)
588  # Enable libunwind support by default.
589  ifndef NO_LIBDW_DWARF_UNWIND
590    NO_LIBDW_DWARF_UNWIND := 1
591  endif
592endif
593
594ifeq ($(dwarf-post-unwind),1)
595  CFLAGS += -DHAVE_DWARF_UNWIND_SUPPORT
596  $(call detected,CONFIG_DWARF_UNWIND)
597else
598  NO_DWARF_UNWIND := 1
599endif
600
601ifndef NO_LOCAL_LIBUNWIND
602  ifeq ($(SRCARCH),$(filter $(SRCARCH),arm arm64))
603    $(call feature_check,libunwind-debug-frame)
604    ifneq ($(feature-libunwind-debug-frame), 1)
605      msg := $(warning No debug_frame support found in libunwind);
606      CFLAGS += -DNO_LIBUNWIND_DEBUG_FRAME
607    endif
608  else
609    # non-ARM has no dwarf_find_debug_frame() function:
610    CFLAGS += -DNO_LIBUNWIND_DEBUG_FRAME
611  endif
612  EXTLIBS += $(LIBUNWIND_LIBS)
613  LDFLAGS += $(LIBUNWIND_LIBS)
614endif
615ifeq ($(findstring -static,${LDFLAGS}),-static)
616  # gcc -static links libgcc_eh which contans piece of libunwind
617  LIBUNWIND_LDFLAGS += -Wl,--allow-multiple-definition
618endif
619
620ifndef NO_LIBUNWIND
621  CFLAGS  += -DHAVE_LIBUNWIND_SUPPORT
622  CFLAGS  += $(LIBUNWIND_CFLAGS)
623  LDFLAGS += $(LIBUNWIND_LDFLAGS)
624  EXTLIBS += $(EXTLIBS_LIBUNWIND)
625endif
626
627ifeq ($(NO_SYSCALL_TABLE),0)
628  $(call detected,CONFIG_TRACE)
629else
630  ifndef NO_LIBAUDIT
631    ifneq ($(feature-libaudit), 1)
632      msg := $(warning No libaudit.h found, disables 'trace' tool, please install audit-libs-devel or libaudit-dev);
633      NO_LIBAUDIT := 1
634    else
635      CFLAGS += -DHAVE_LIBAUDIT_SUPPORT
636      EXTLIBS += -laudit
637      $(call detected,CONFIG_TRACE)
638    endif
639  endif
640endif
641
642ifndef NO_LIBCRYPTO
643  ifneq ($(feature-libcrypto), 1)
644    msg := $(warning No libcrypto.h found, disables jitted code injection, please install openssl-devel or libssl-dev);
645    NO_LIBCRYPTO := 1
646  else
647    CFLAGS += -DHAVE_LIBCRYPTO_SUPPORT
648    EXTLIBS += -lcrypto
649    $(call detected,CONFIG_CRYPTO)
650  endif
651endif
652
653ifdef NO_NEWT
654  NO_SLANG=1
655endif
656
657ifndef NO_SLANG
658  ifneq ($(feature-libslang), 1)
659    ifneq ($(feature-libslang-include-subdir), 1)
660      msg := $(warning slang not found, disables TUI support. Please install slang-devel, libslang-dev or libslang2-dev);
661      NO_SLANG := 1
662    else
663      CFLAGS += -DHAVE_SLANG_INCLUDE_SUBDIR
664    endif
665  endif
666  ifndef NO_SLANG
667    # Fedora has /usr/include/slang/slang.h, but ubuntu /usr/include/slang.h
668    CFLAGS += -DHAVE_SLANG_SUPPORT
669    EXTLIBS += -lslang
670    $(call detected,CONFIG_SLANG)
671  endif
672endif
673
674ifndef NO_GTK2
675  FLAGS_GTK2=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null)
676  ifneq ($(feature-gtk2), 1)
677    msg := $(warning GTK2 not found, disables GTK2 support. Please install gtk2-devel or libgtk2.0-dev);
678    NO_GTK2 := 1
679  else
680    ifeq ($(feature-gtk2-infobar), 1)
681      GTK_CFLAGS := -DHAVE_GTK_INFO_BAR_SUPPORT
682    endif
683    CFLAGS += -DHAVE_GTK2_SUPPORT
684    GTK_CFLAGS += $(shell $(PKG_CONFIG) --cflags gtk+-2.0 2>/dev/null)
685    GTK_LIBS := $(shell $(PKG_CONFIG) --libs gtk+-2.0 2>/dev/null)
686    EXTLIBS += -ldl
687  endif
688endif
689
690ifdef NO_LIBPERL
691  CFLAGS += -DNO_LIBPERL
692else
693  PERL_EMBED_LDOPTS = $(shell perl -MExtUtils::Embed -e ldopts 2>/dev/null)
694  PERL_EMBED_LDFLAGS = $(call strip-libs,$(PERL_EMBED_LDOPTS))
695  PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS))
696  PERL_EMBED_CCOPTS = $(shell perl -MExtUtils::Embed -e ccopts 2>/dev/null)
697  PERL_EMBED_CCOPTS := $(filter-out -specs=%,$(PERL_EMBED_CCOPTS))
698  PERL_EMBED_LDOPTS := $(filter-out -specs=%,$(PERL_EMBED_LDOPTS))
699  FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS)
700
701  ifneq ($(feature-libperl), 1)
702    CFLAGS += -DNO_LIBPERL
703    NO_LIBPERL := 1
704    msg := $(warning Missing perl devel files. Disabling perl scripting support, please install perl-ExtUtils-Embed/libperl-dev);
705  else
706    LDFLAGS += $(PERL_EMBED_LDFLAGS)
707    EXTLIBS += $(PERL_EMBED_LIBADD)
708    CFLAGS += -DHAVE_LIBPERL_SUPPORT
709    ifeq ($(CC_NO_CLANG), 0)
710      CFLAGS += -Wno-compound-token-split-by-macro
711    endif
712    $(call detected,CONFIG_LIBPERL)
713  endif
714endif
715
716ifeq ($(feature-timerfd), 1)
717  CFLAGS += -DHAVE_TIMERFD_SUPPORT
718else
719  msg := $(warning No timerfd support. Disables 'perf kvm stat live');
720endif
721
722disable-python = $(eval $(disable-python_code))
723define disable-python_code
724  CFLAGS += -DNO_LIBPYTHON
725  $(warning $1)
726  NO_LIBPYTHON := 1
727endef
728
729ifdef NO_LIBPYTHON
730  $(call disable-python,Python support disabled by user)
731else
732
733  ifndef PYTHON
734    $(call disable-python,No python interpreter was found: disables Python support - please install python-devel/python-dev)
735  else
736    PYTHON_WORD := $(call shell-wordify,$(PYTHON))
737
738    ifndef PYTHON_CONFIG
739      $(call disable-python,No 'python-config' tool was found: disables Python support - please install python-devel/python-dev)
740    else
741
742      ifneq ($(feature-libpython), 1)
743        $(call disable-python,No 'Python.h' (for Python 2.x support) was found: disables Python support - please install python-devel/python-dev)
744      else
745         LDFLAGS += $(PYTHON_EMBED_LDFLAGS)
746         EXTLIBS += $(PYTHON_EMBED_LIBADD)
747         LANG_BINDINGS += $(obj-perf)python/perf.so
748         CFLAGS += -DHAVE_LIBPYTHON_SUPPORT
749         $(call detected,CONFIG_LIBPYTHON)
750      endif
751    endif
752  endif
753endif
754
755
756ifndef NO_LIBBFD
757  ifeq ($(feature-libbfd), 1)
758    EXTLIBS += -lbfd -lopcodes
759  else
760    # we are on a system that requires -liberty and (maybe) -lz
761    # to link against -lbfd; test each case individually here
762
763    # call all detections now so we get correct
764    # status in VF output
765    $(call feature_check,libbfd-liberty)
766    $(call feature_check,libbfd-liberty-z)
767
768    ifeq ($(feature-libbfd-liberty), 1)
769      EXTLIBS += -lbfd -lopcodes -liberty
770      FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -ldl
771    else
772      ifeq ($(feature-libbfd-liberty-z), 1)
773        EXTLIBS += -lbfd -lopcodes -liberty -lz
774        FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -lz -ldl
775      endif
776    endif
777    $(call feature_check,disassembler-four-args)
778  endif
779
780  ifeq ($(feature-libbfd-buildid), 1)
781    CFLAGS += -DHAVE_LIBBFD_BUILDID_SUPPORT
782  else
783    msg := $(warning Old version of libbfd/binutils things like PE executable profiling will not be available);
784  endif
785endif
786
787ifdef NO_DEMANGLE
788  CFLAGS += -DNO_DEMANGLE
789else
790  ifdef HAVE_CPLUS_DEMANGLE_SUPPORT
791    EXTLIBS += -liberty
792  else
793    ifeq ($(filter -liberty,$(EXTLIBS)),)
794      $(call feature_check,cplus-demangle)
795
796      # we dont have neither HAVE_CPLUS_DEMANGLE_SUPPORT
797      # or any of 'bfd iberty z' trinity
798      ifeq ($(feature-cplus-demangle), 1)
799        EXTLIBS += -liberty
800      else
801        msg := $(warning No bfd.h/libbfd found, please install binutils-dev[el]/zlib-static/libiberty-dev to gain symbol demangling)
802        CFLAGS += -DNO_DEMANGLE
803      endif
804    endif
805  endif
806
807  ifneq ($(filter -liberty,$(EXTLIBS)),)
808    CFLAGS += -DHAVE_CPLUS_DEMANGLE_SUPPORT
809  endif
810endif
811
812ifneq ($(filter -lbfd,$(EXTLIBS)),)
813  CFLAGS += -DHAVE_LIBBFD_SUPPORT
814endif
815
816ifndef NO_ZLIB
817  ifeq ($(feature-zlib), 1)
818    CFLAGS += -DHAVE_ZLIB_SUPPORT
819    EXTLIBS += -lz
820    $(call detected,CONFIG_ZLIB)
821  else
822    NO_ZLIB := 1
823  endif
824endif
825
826ifndef NO_LZMA
827  ifeq ($(feature-lzma), 1)
828    CFLAGS += -DHAVE_LZMA_SUPPORT
829    EXTLIBS += -llzma
830    $(call detected,CONFIG_LZMA)
831  else
832    msg := $(warning No liblzma found, disables xz kernel module decompression, please install xz-devel/liblzma-dev);
833    NO_LZMA := 1
834  endif
835endif
836
837ifndef NO_LIBZSTD
838  ifeq ($(feature-libzstd), 1)
839    CFLAGS += -DHAVE_ZSTD_SUPPORT
840    CFLAGS += $(LIBZSTD_CFLAGS)
841    LDFLAGS += $(LIBZSTD_LDFLAGS)
842    EXTLIBS += -lzstd
843    $(call detected,CONFIG_ZSTD)
844  else
845    msg := $(warning No libzstd found, disables trace compression, please install libzstd-dev[el] and/or set LIBZSTD_DIR);
846    NO_LIBZSTD := 1
847  endif
848endif
849
850ifndef NO_LIBCAP
851  ifeq ($(feature-libcap), 1)
852    CFLAGS += -DHAVE_LIBCAP_SUPPORT
853    EXTLIBS += -lcap
854    $(call detected,CONFIG_LIBCAP)
855  else
856    msg := $(warning No libcap found, disables capability support, please install libcap-devel/libcap-dev);
857    NO_LIBCAP := 1
858  endif
859endif
860
861ifndef NO_BACKTRACE
862  ifeq ($(feature-backtrace), 1)
863    CFLAGS += -DHAVE_BACKTRACE_SUPPORT
864  endif
865endif
866
867ifndef NO_LIBNUMA
868  ifeq ($(feature-libnuma), 0)
869    msg := $(warning No numa.h found, disables 'perf bench numa mem' benchmark, please install numactl-devel/libnuma-devel/libnuma-dev);
870    NO_LIBNUMA := 1
871  else
872    ifeq ($(feature-numa_num_possible_cpus), 0)
873      msg := $(warning Old numa library found, disables 'perf bench numa mem' benchmark, please install numactl-devel/libnuma-devel/libnuma-dev >= 2.0.8);
874      NO_LIBNUMA := 1
875    else
876      CFLAGS += -DHAVE_LIBNUMA_SUPPORT
877      EXTLIBS += -lnuma
878      $(call detected,CONFIG_NUMA)
879    endif
880  endif
881endif
882
883ifdef HAVE_KVM_STAT_SUPPORT
884    CFLAGS += -DHAVE_KVM_STAT_SUPPORT
885endif
886
887ifeq ($(feature-disassembler-four-args), 1)
888    CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
889endif
890
891ifeq (${IS_64_BIT}, 1)
892  ifndef NO_PERF_READ_VDSO32
893    $(call feature_check,compile-32)
894    ifeq ($(feature-compile-32), 1)
895      CFLAGS += -DHAVE_PERF_READ_VDSO32
896    else
897      NO_PERF_READ_VDSO32 := 1
898    endif
899  endif
900  ifneq ($(SRCARCH), x86)
901    NO_PERF_READ_VDSOX32 := 1
902  endif
903  ifndef NO_PERF_READ_VDSOX32
904    $(call feature_check,compile-x32)
905    ifeq ($(feature-compile-x32), 1)
906      CFLAGS += -DHAVE_PERF_READ_VDSOX32
907    else
908      NO_PERF_READ_VDSOX32 := 1
909    endif
910  endif
911else
912  NO_PERF_READ_VDSO32 := 1
913  NO_PERF_READ_VDSOX32 := 1
914endif
915
916ifndef NO_LIBBABELTRACE
917  $(call feature_check,libbabeltrace)
918  ifeq ($(feature-libbabeltrace), 1)
919    CFLAGS += -DHAVE_LIBBABELTRACE_SUPPORT $(LIBBABELTRACE_CFLAGS)
920    LDFLAGS += $(LIBBABELTRACE_LDFLAGS)
921    EXTLIBS += -lbabeltrace-ctf
922    $(call detected,CONFIG_LIBBABELTRACE)
923  else
924    msg := $(warning No libbabeltrace found, disables 'perf data' CTF format support, please install libbabeltrace-dev[el]/libbabeltrace-ctf-dev);
925  endif
926endif
927
928ifndef NO_AUXTRACE
929  ifeq ($(SRCARCH),x86)
930    ifeq ($(feature-get_cpuid), 0)
931      msg := $(warning Your gcc lacks the __get_cpuid() builtin, disables support for auxtrace/Intel PT, please install a newer gcc);
932      NO_AUXTRACE := 1
933    endif
934  endif
935  ifndef NO_AUXTRACE
936    $(call detected,CONFIG_AUXTRACE)
937    CFLAGS += -DHAVE_AUXTRACE_SUPPORT
938  endif
939endif
940
941ifndef NO_JVMTI
942  ifneq (,$(wildcard /usr/sbin/update-java-alternatives))
943    JDIR=$(shell /usr/sbin/update-java-alternatives -l | head -1 | awk '{print $$3}')
944  else
945    ifneq (,$(wildcard /usr/sbin/alternatives))
946      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')
947    endif
948  endif
949  ifndef JDIR
950    $(warning No alternatives command found, you need to set JDIR= to point to the root of your Java directory)
951    NO_JVMTI := 1
952  endif
953endif
954
955ifndef NO_JVMTI
956  FEATURE_CHECK_CFLAGS-jvmti := -I$(JDIR)/include -I$(JDIR)/include/linux
957  $(call feature_check,jvmti)
958  ifeq ($(feature-jvmti), 1)
959    $(call detected_var,JDIR)
960    ifndef NO_JVMTI_CMLR
961      FEATURE_CHECK_CFLAGS-jvmti-cmlr := $(FEATURE_CHECK_CFLAGS-jvmti)
962      $(call feature_check,jvmti-cmlr)
963      ifeq ($(feature-jvmti-cmlr), 1)
964        CFLAGS += -DHAVE_JVMTI_CMLR
965      endif
966    endif # NO_JVMTI_CMLR
967  else
968    $(warning No openjdk development package found, please install JDK package, e.g. openjdk-8-jdk, java-1.8.0-openjdk-devel)
969    NO_JVMTI := 1
970  endif
971endif
972
973USE_CXX = 0
974USE_CLANGLLVM = 0
975ifdef LIBCLANGLLVM
976  $(call feature_check,cxx)
977  ifneq ($(feature-cxx), 1)
978    msg := $(warning No g++ found, disable clang and llvm support. Please install g++)
979  else
980    $(call feature_check,llvm)
981    $(call feature_check,llvm-version)
982    ifneq ($(feature-llvm), 1)
983      msg := $(warning No suitable libLLVM found, disabling builtin clang and LLVM support. Please install llvm-dev(el) (>= 3.9.0))
984    else
985      $(call feature_check,clang)
986      ifneq ($(feature-clang), 1)
987        msg := $(warning No suitable libclang found, disabling builtin clang and LLVM support. Please install libclang-dev(el) (>= 3.9.0))
988      else
989        CFLAGS += -DHAVE_LIBCLANGLLVM_SUPPORT
990        CXXFLAGS += -DHAVE_LIBCLANGLLVM_SUPPORT -I$(shell $(LLVM_CONFIG) --includedir)
991        $(call detected,CONFIG_CXX)
992        $(call detected,CONFIG_CLANGLLVM)
993	USE_CXX = 1
994	USE_LLVM = 1
995	USE_CLANG = 1
996        ifneq ($(feature-llvm-version),1)
997          msg := $(warning This version of LLVM is not tested. May cause build errors)
998        endif
999      endif
1000    endif
1001  endif
1002endif
1003
1004# Among the variables below, these:
1005#   perfexecdir
1006#   perf_include_dir
1007#   perf_examples_dir
1008#   template_dir
1009#   mandir
1010#   infodir
1011#   htmldir
1012#   ETC_PERFCONFIG (but not sysconfdir)
1013# can be specified as a relative path some/where/else;
1014# this is interpreted as relative to $(prefix) and "perf" at
1015# runtime figures out where they are based on the path to the executable.
1016# This can help installing the suite in a relocatable way.
1017
1018# Make the path relative to DESTDIR, not to prefix
1019ifndef DESTDIR
1020prefix ?= $(HOME)
1021endif
1022bindir_relative = bin
1023bindir = $(abspath $(prefix)/$(bindir_relative))
1024mandir = share/man
1025infodir = share/info
1026perfexecdir = libexec/perf-core
1027perf_include_dir = lib/perf/include
1028perf_examples_dir = lib/perf/examples
1029sharedir = $(prefix)/share
1030template_dir = share/perf-core/templates
1031STRACE_GROUPS_DIR = share/perf-core/strace/groups
1032htmldir = share/doc/perf-doc
1033tipdir = share/doc/perf-tip
1034srcdir = $(srctree)/tools/perf
1035ifeq ($(prefix),/usr)
1036sysconfdir = /etc
1037ETC_PERFCONFIG = $(sysconfdir)/perfconfig
1038else
1039sysconfdir = $(prefix)/etc
1040ETC_PERFCONFIG = etc/perfconfig
1041endif
1042ifndef lib
1043ifeq ($(SRCARCH)$(IS_64_BIT), x861)
1044lib = lib64
1045else
1046lib = lib
1047endif
1048endif # lib
1049libdir = $(prefix)/$(lib)
1050
1051# Shell quote (do not use $(call) to accommodate ancient setups);
1052ETC_PERFCONFIG_SQ = $(subst ','\'',$(ETC_PERFCONFIG))
1053STRACE_GROUPS_DIR_SQ = $(subst ','\'',$(STRACE_GROUPS_DIR))
1054DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
1055bindir_SQ = $(subst ','\'',$(bindir))
1056mandir_SQ = $(subst ','\'',$(mandir))
1057infodir_SQ = $(subst ','\'',$(infodir))
1058perfexecdir_SQ = $(subst ','\'',$(perfexecdir))
1059perf_include_dir_SQ = $(subst ','\'',$(perf_include_dir))
1060perf_examples_dir_SQ = $(subst ','\'',$(perf_examples_dir))
1061template_dir_SQ = $(subst ','\'',$(template_dir))
1062htmldir_SQ = $(subst ','\'',$(htmldir))
1063tipdir_SQ = $(subst ','\'',$(tipdir))
1064prefix_SQ = $(subst ','\'',$(prefix))
1065sysconfdir_SQ = $(subst ','\'',$(sysconfdir))
1066libdir_SQ = $(subst ','\'',$(libdir))
1067srcdir_SQ = $(subst ','\'',$(srcdir))
1068
1069ifneq ($(filter /%,$(firstword $(perfexecdir))),)
1070perfexec_instdir = $(perfexecdir)
1071perf_include_instdir = $(perf_include_dir)
1072perf_examples_instdir = $(perf_examples_dir)
1073STRACE_GROUPS_INSTDIR = $(STRACE_GROUPS_DIR)
1074tip_instdir = $(tipdir)
1075else
1076perfexec_instdir = $(prefix)/$(perfexecdir)
1077perf_include_instdir = $(prefix)/$(perf_include_dir)
1078perf_examples_instdir = $(prefix)/$(perf_examples_dir)
1079STRACE_GROUPS_INSTDIR = $(prefix)/$(STRACE_GROUPS_DIR)
1080tip_instdir = $(prefix)/$(tipdir)
1081endif
1082perfexec_instdir_SQ = $(subst ','\'',$(perfexec_instdir))
1083perf_include_instdir_SQ = $(subst ','\'',$(perf_include_instdir))
1084perf_examples_instdir_SQ = $(subst ','\'',$(perf_examples_instdir))
1085STRACE_GROUPS_INSTDIR_SQ = $(subst ','\'',$(STRACE_GROUPS_INSTDIR))
1086tip_instdir_SQ = $(subst ','\'',$(tip_instdir))
1087
1088# If we install to $(HOME) we keep the traceevent default:
1089# $(HOME)/.traceevent/plugins
1090# Otherwise we install plugins into the global $(libdir).
1091ifdef DESTDIR
1092plugindir=$(libdir)/traceevent/plugins
1093plugindir_SQ= $(subst ','\'',$(plugindir))
1094endif
1095
1096print_var = $(eval $(print_var_code)) $(info $(MSG))
1097define print_var_code
1098    MSG = $(shell printf '...%30s: %s' $(1) $($(1)))
1099endef
1100
1101ifeq ($(VF),1)
1102  # Display EXTRA features which are detected manualy
1103  # from here with feature_check call and thus cannot
1104  # be partof global state output.
1105  $(foreach feat,$(FEATURE_TESTS_EXTRA),$(call feature_print_status,$(feat),))
1106  $(call print_var,prefix)
1107  $(call print_var,bindir)
1108  $(call print_var,libdir)
1109  $(call print_var,sysconfdir)
1110  $(call print_var,LIBUNWIND_DIR)
1111  $(call print_var,LIBDW_DIR)
1112  $(call print_var,JDIR)
1113
1114  ifeq ($(dwarf-post-unwind),1)
1115    $(call feature_print_text,"DWARF post unwind library", $(dwarf-post-unwind-text))
1116  endif
1117  $(info )
1118endif
1119
1120$(call detected_var,bindir_SQ)
1121$(call detected_var,PYTHON_WORD)
1122ifneq ($(OUTPUT),)
1123$(call detected_var,OUTPUT)
1124endif
1125$(call detected_var,htmldir_SQ)
1126$(call detected_var,infodir_SQ)
1127$(call detected_var,mandir_SQ)
1128$(call detected_var,ETC_PERFCONFIG_SQ)
1129$(call detected_var,STRACE_GROUPS_DIR_SQ)
1130$(call detected_var,prefix_SQ)
1131$(call detected_var,perfexecdir_SQ)
1132$(call detected_var,perf_include_dir_SQ)
1133$(call detected_var,perf_examples_dir_SQ)
1134$(call detected_var,tipdir_SQ)
1135$(call detected_var,srcdir_SQ)
1136$(call detected_var,LIBDIR)
1137$(call detected_var,GTK_CFLAGS)
1138$(call detected_var,PERL_EMBED_CCOPTS)
1139$(call detected_var,PYTHON_EMBED_CCOPTS)
1140