Makefile.config 30 KB

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