Makefile 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578
  1. uname_M := $(shell uname -m 2>/dev/null || echo not)
  2. ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
  3. -e s/arm.*/arm/ -e s/sa110/arm/ \
  4. -e s/s390x/s390/ -e s/parisc64/parisc/ \
  5. -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
  6. -e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ )
  7. NO_PERF_REGS := 1
  8. CFLAGS := $(EXTRA_CFLAGS) $(EXTRA_WARNINGS)
  9. # Additional ARCH settings for x86
  10. ifeq ($(ARCH),i386)
  11. override ARCH := x86
  12. NO_PERF_REGS := 0
  13. LIBUNWIND_LIBS = -lunwind -lunwind-x86
  14. endif
  15. ifeq ($(ARCH),x86_64)
  16. override ARCH := x86
  17. IS_X86_64 := 0
  18. ifeq (, $(findstring m32,$(CFLAGS)))
  19. IS_X86_64 := $(shell echo __x86_64__ | ${CC} -E -x c - | tail -n 1)
  20. endif
  21. ifeq (${IS_X86_64}, 1)
  22. RAW_ARCH := x86_64
  23. CFLAGS += -DHAVE_ARCH_X86_64_SUPPORT
  24. ARCH_INCLUDE = ../../arch/x86/lib/memcpy_64.S ../../arch/x86/lib/memset_64.S
  25. endif
  26. NO_PERF_REGS := 0
  27. LIBUNWIND_LIBS = -lunwind -lunwind-x86_64
  28. endif
  29. ifeq ($(NO_PERF_REGS),0)
  30. CFLAGS += -DHAVE_PERF_REGS_SUPPORT
  31. endif
  32. ifeq ($(src-perf),)
  33. src-perf := $(srctree)/tools/perf
  34. endif
  35. ifeq ($(obj-perf),)
  36. obj-perf := $(OUTPUT)
  37. endif
  38. ifneq ($(obj-perf),)
  39. obj-perf := $(abspath $(obj-perf))/
  40. endif
  41. LIB_INCLUDE := $(srctree)/tools/lib/
  42. # include ARCH specific config
  43. -include $(src-perf)/arch/$(ARCH)/Makefile
  44. include $(src-perf)/config/utilities.mak
  45. ifeq ($(call get-executable,$(FLEX)),)
  46. dummy := $(error Error: $(FLEX) is missing on this system, please install it)
  47. endif
  48. ifeq ($(call get-executable,$(BISON)),)
  49. dummy := $(error Error: $(BISON) is missing on this system, please install it)
  50. endif
  51. # Treat warnings as errors unless directed not to
  52. ifneq ($(WERROR),0)
  53. CFLAGS += -Werror
  54. endif
  55. ifeq ($(DEBUG),0)
  56. CFLAGS += -O6
  57. endif
  58. ifdef PARSER_DEBUG
  59. PARSER_DEBUG_BISON := -t
  60. PARSER_DEBUG_FLEX := -d
  61. CFLAGS += -DPARSER_DEBUG
  62. endif
  63. CFLAGS += -fno-omit-frame-pointer
  64. CFLAGS += -ggdb3
  65. CFLAGS += -funwind-tables
  66. CFLAGS += -Wall
  67. CFLAGS += -Wextra
  68. CFLAGS += -std=gnu99
  69. EXTLIBS = -lelf -lpthread -lrt -lm -ldl
  70. ifneq ($(OUTPUT),)
  71. OUTPUT_FEATURES = $(OUTPUT)config/feature-checks/
  72. $(shell mkdir -p $(OUTPUT_FEATURES))
  73. endif
  74. feature_check = $(eval $(feature_check_code))
  75. define feature_check_code
  76. feature-$(1) := $(shell $(MAKE) OUTPUT=$(OUTPUT_FEATURES) LDFLAGS=$(LDFLAGS) -C config/feature-checks test-$1 >/dev/null 2>/dev/null && echo 1 || echo 0)
  77. endef
  78. feature_set = $(eval $(feature_set_code))
  79. define feature_set_code
  80. feature-$(1) := 1
  81. endef
  82. #
  83. # Build the feature check binaries in parallel, ignore errors, ignore return value and suppress output:
  84. #
  85. #
  86. # Note that this is not a complete list of all feature tests, just
  87. # those that are typically built on a fully configured system.
  88. #
  89. # [ Feature tests not mentioned here have to be built explicitly in
  90. # the rule that uses them - an example for that is the 'bionic'
  91. # feature check. ]
  92. #
  93. CORE_FEATURE_TESTS = \
  94. backtrace \
  95. dwarf \
  96. fortify-source \
  97. glibc \
  98. gtk2 \
  99. gtk2-infobar \
  100. libaudit \
  101. libbfd \
  102. libelf \
  103. libelf-getphdrnum \
  104. libelf-mmap \
  105. libnuma \
  106. libperl \
  107. libpython \
  108. libpython-version \
  109. libslang \
  110. libunwind \
  111. on-exit \
  112. stackprotector \
  113. stackprotector-all \
  114. volatile-register-var
  115. #
  116. # So here we detect whether test-all was rebuilt, to be able
  117. # to skip the print-out of the long features list if the file
  118. # existed before and after it was built:
  119. #
  120. ifeq ($(wildcard $(OUTPUT)config/feature-checks/test-all),)
  121. test-all-failed := 1
  122. else
  123. test-all-failed := 0
  124. endif
  125. #
  126. # Special fast-path for the 'all features are available' case:
  127. #
  128. $(call feature_check,all,$(MSG))
  129. #
  130. # Just in case the build freshly failed, make sure we print the
  131. # feature matrix:
  132. #
  133. ifeq ($(feature-all), 0)
  134. test-all-failed := 1
  135. endif
  136. ifeq ($(test-all-failed),1)
  137. $(info )
  138. $(info Auto-detecting system features:)
  139. endif
  140. ifeq ($(feature-all), 1)
  141. #
  142. # test-all.c passed - just set all the core feature flags to 1:
  143. #
  144. $(foreach feat,$(CORE_FEATURE_TESTS),$(call feature_set,$(feat)))
  145. else
  146. $(shell $(MAKE) OUTPUT=$(OUTPUT_FEATURES) LDFLAGS=$(LDFLAGS) -i -j -C config/feature-checks $(CORE_FEATURE_TESTS) >/dev/null 2>&1)
  147. $(foreach feat,$(CORE_FEATURE_TESTS),$(call feature_check,$(feat)))
  148. endif
  149. #
  150. # Print the result of the feature test:
  151. #
  152. feature_print = $(eval $(feature_print_code)) $(info $(MSG))
  153. define feature_print_code
  154. ifeq ($(feature-$(1)), 1)
  155. MSG = $(shell printf '...%30s: [ \033[32mon\033[m ]' $(1))
  156. else
  157. MSG = $(shell printf '...%30s: [ \033[31mOFF\033[m ]' $(1))
  158. endif
  159. endef
  160. #
  161. # Only print out our features if we rebuilt the testcases or if a test failed:
  162. #
  163. ifeq ($(test-all-failed), 1)
  164. $(foreach feat,$(CORE_FEATURE_TESTS),$(call feature_print,$(feat)))
  165. $(info )
  166. endif
  167. ifeq ($(feature-stackprotector-all), 1)
  168. CFLAGS += -fstack-protector-all
  169. endif
  170. ifeq ($(feature-stackprotector), 1)
  171. CFLAGS += -Wstack-protector
  172. endif
  173. ifeq ($(feature-volatile-register-var), 1)
  174. CFLAGS += -Wvolatile-register-var
  175. endif
  176. ifeq ($(DEBUG),0)
  177. ifeq ($(feature-fortify-source), 1)
  178. CFLAGS += -D_FORTIFY_SOURCE=2
  179. endif
  180. endif
  181. CFLAGS += -I$(src-perf)/util/include
  182. CFLAGS += -I$(src-perf)/arch/$(ARCH)/include
  183. CFLAGS += -I$(srctree)/arch/$(ARCH)/include/uapi
  184. CFLAGS += -I$(srctree)/arch/$(ARCH)/include
  185. CFLAGS += -I$(srctree)/include/uapi
  186. CFLAGS += -I$(srctree)/include
  187. # $(obj-perf) for generated common-cmds.h
  188. # $(obj-perf)/util for generated bison/flex headers
  189. ifneq ($(OUTPUT),)
  190. CFLAGS += -I$(obj-perf)/util
  191. CFLAGS += -I$(obj-perf)
  192. endif
  193. CFLAGS += -I$(src-perf)/util
  194. CFLAGS += -I$(src-perf)
  195. CFLAGS += -I$(LIB_INCLUDE)
  196. CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
  197. ifndef NO_BIONIC
  198. $(feature_check,bionic)
  199. ifeq ($(feature-bionic), 1)
  200. BIONIC := 1
  201. EXTLIBS := $(filter-out -lrt,$(EXTLIBS))
  202. EXTLIBS := $(filter-out -lpthread,$(EXTLIBS))
  203. endif
  204. endif
  205. ifdef NO_LIBELF
  206. NO_DWARF := 1
  207. NO_DEMANGLE := 1
  208. NO_LIBUNWIND := 1
  209. else
  210. ifeq ($(feature-libelf), 0)
  211. ifeq ($(feature-glibc), 1)
  212. LIBC_SUPPORT := 1
  213. endif
  214. ifeq ($(BIONIC),1)
  215. LIBC_SUPPORT := 1
  216. endif
  217. ifeq ($(LIBC_SUPPORT),1)
  218. msg := $(warning No libelf found, disables 'probe' tool, please install elfutils-libelf-devel/libelf-dev);
  219. NO_LIBELF := 1
  220. NO_DWARF := 1
  221. NO_DEMANGLE := 1
  222. else
  223. msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]/glibc-static);
  224. endif
  225. else
  226. # for linking with debug library, run like:
  227. # make DEBUG=1 LIBDW_DIR=/opt/libdw/
  228. ifdef LIBDW_DIR
  229. LIBDW_CFLAGS := -I$(LIBDW_DIR)/include
  230. LIBDW_LDFLAGS := -L$(LIBDW_DIR)/lib
  231. endif
  232. ifneq ($(feature-dwarf), 1)
  233. 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);
  234. NO_DWARF := 1
  235. endif # Dwarf support
  236. endif # libelf support
  237. endif # NO_LIBELF
  238. ifndef NO_LIBELF
  239. CFLAGS += -DHAVE_LIBELF_SUPPORT
  240. ifeq ($(feature-libelf-mmap), 1)
  241. CFLAGS += -DHAVE_LIBELF_MMAP_SUPPORT
  242. endif
  243. ifeq ($(feature-libelf-getphdrnum), 1)
  244. CFLAGS += -DHAVE_ELF_GETPHDRNUM_SUPPORT
  245. endif
  246. # include ARCH specific config
  247. -include $(src-perf)/arch/$(ARCH)/Makefile
  248. ifndef NO_DWARF
  249. ifeq ($(origin PERF_HAVE_DWARF_REGS), undefined)
  250. msg := $(warning DWARF register mappings have not been defined for architecture $(ARCH), DWARF support disabled);
  251. NO_DWARF := 1
  252. else
  253. CFLAGS += -DHAVE_DWARF_SUPPORT $(LIBDW_CFLAGS)
  254. LDFLAGS += $(LIBDW_LDFLAGS)
  255. EXTLIBS += -lelf -ldw
  256. endif # PERF_HAVE_DWARF_REGS
  257. endif # NO_DWARF
  258. endif # NO_LIBELF
  259. # There's only x86 (both 32 and 64) support for CFI unwind so far
  260. ifneq ($(ARCH),x86)
  261. NO_LIBUNWIND := 1
  262. endif
  263. ifndef NO_LIBUNWIND
  264. #
  265. # For linking with debug library, run like:
  266. #
  267. # make DEBUG=1 LIBUNWIND_DIR=/opt/libunwind/
  268. #
  269. ifdef LIBUNWIND_DIR
  270. LIBUNWIND_CFLAGS := -I$(LIBUNWIND_DIR)/include
  271. LIBUNWIND_LDFLAGS := -L$(LIBUNWIND_DIR)/lib
  272. endif
  273. ifneq ($(feature-libunwind), 1)
  274. msg := $(warning No libunwind found, disabling post unwind support. Please install libunwind-dev[el] >= 0.99);
  275. NO_LIBUNWIND := 1
  276. endif
  277. endif
  278. ifndef NO_LIBUNWIND
  279. CFLAGS += -DHAVE_LIBUNWIND_SUPPORT
  280. EXTLIBS += $(LIBUNWIND_LIBS)
  281. CFLAGS += $(LIBUNWIND_CFLAGS)
  282. LDFLAGS += $(LIBUNWIND_LDFLAGS)
  283. endif
  284. ifndef NO_LIBAUDIT
  285. ifneq ($(feature-libaudit), 1)
  286. msg := $(warning No libaudit.h found, disables 'trace' tool, please install audit-libs-devel or libaudit-dev);
  287. NO_LIBAUDIT := 1
  288. else
  289. CFLAGS += -DHAVE_LIBAUDIT_SUPPORT
  290. EXTLIBS += -laudit
  291. endif
  292. endif
  293. ifdef NO_NEWT
  294. NO_SLANG=1
  295. endif
  296. ifndef NO_SLANG
  297. ifneq ($(feature-libslang), 1)
  298. msg := $(warning slang not found, disables TUI support. Please install slang-devel or libslang-dev);
  299. NO_SLANG := 1
  300. else
  301. # Fedora has /usr/include/slang/slang.h, but ubuntu /usr/include/slang.h
  302. CFLAGS += -I/usr/include/slang
  303. CFLAGS += -DHAVE_SLANG_SUPPORT
  304. EXTLIBS += -lslang
  305. endif
  306. endif
  307. ifndef NO_GTK2
  308. FLAGS_GTK2=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null)
  309. ifneq ($(feature-gtk2), 1)
  310. msg := $(warning GTK2 not found, disables GTK2 support. Please install gtk2-devel or libgtk2.0-dev);
  311. NO_GTK2 := 1
  312. else
  313. ifeq ($(feature-gtk2-infobar), 1)
  314. GTK_CFLAGS := -DHAVE_GTK_INFO_BAR_SUPPORT
  315. endif
  316. CFLAGS += -DHAVE_GTK2_SUPPORT
  317. GTK_CFLAGS += $(shell pkg-config --cflags gtk+-2.0 2>/dev/null)
  318. GTK_LIBS := $(shell pkg-config --libs gtk+-2.0 2>/dev/null)
  319. EXTLIBS += -ldl
  320. endif
  321. endif
  322. grep-libs = $(filter -l%,$(1))
  323. strip-libs = $(filter-out -l%,$(1))
  324. ifdef NO_LIBPERL
  325. CFLAGS += -DNO_LIBPERL
  326. else
  327. PERL_EMBED_LDOPTS = $(shell perl -MExtUtils::Embed -e ldopts 2>/dev/null)
  328. PERL_EMBED_LDFLAGS = $(call strip-libs,$(PERL_EMBED_LDOPTS))
  329. PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS))
  330. PERL_EMBED_CCOPTS = `perl -MExtUtils::Embed -e ccopts 2>/dev/null`
  331. FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS)
  332. ifneq ($(feature-libperl), 1)
  333. CFLAGS += -DNO_LIBPERL
  334. NO_LIBPERL := 1
  335. else
  336. LDFLAGS += $(PERL_EMBED_LDFLAGS)
  337. EXTLIBS += $(PERL_EMBED_LIBADD)
  338. endif
  339. endif
  340. disable-python = $(eval $(disable-python_code))
  341. define disable-python_code
  342. CFLAGS += -DNO_LIBPYTHON
  343. $(if $(1),$(warning No $(1) was found))
  344. $(warning Python support will not be built)
  345. NO_LIBPYTHON := 1
  346. endef
  347. override PYTHON := \
  348. $(call get-executable-or-default,PYTHON,python)
  349. ifndef PYTHON
  350. $(call disable-python,python interpreter)
  351. else
  352. PYTHON_WORD := $(call shell-wordify,$(PYTHON))
  353. ifdef NO_LIBPYTHON
  354. $(call disable-python)
  355. else
  356. override PYTHON_CONFIG := \
  357. $(call get-executable-or-default,PYTHON_CONFIG,$(PYTHON)-config)
  358. ifndef PYTHON_CONFIG
  359. $(call disable-python,python-config tool)
  360. else
  361. PYTHON_CONFIG_SQ := $(call shell-sq,$(PYTHON_CONFIG))
  362. PYTHON_EMBED_LDOPTS := $(shell $(PYTHON_CONFIG_SQ) --ldflags 2>/dev/null)
  363. PYTHON_EMBED_LDFLAGS := $(call strip-libs,$(PYTHON_EMBED_LDOPTS))
  364. PYTHON_EMBED_LIBADD := $(call grep-libs,$(PYTHON_EMBED_LDOPTS))
  365. PYTHON_EMBED_CCOPTS := $(shell $(PYTHON_CONFIG_SQ) --cflags 2>/dev/null)
  366. FLAGS_PYTHON_EMBED := $(PYTHON_EMBED_CCOPTS) $(PYTHON_EMBED_LDOPTS)
  367. ifneq ($(feature-libpython), 1)
  368. $(call disable-python,Python.h (for Python 2.x))
  369. else
  370. ifneq ($(feature-libpython-version), 1)
  371. $(warning Python 3 is not yet supported; please set)
  372. $(warning PYTHON and/or PYTHON_CONFIG appropriately.)
  373. $(warning If you also have Python 2 installed, then)
  374. $(warning try something like:)
  375. $(warning $(and ,))
  376. $(warning $(and ,) make PYTHON=python2)
  377. $(warning $(and ,))
  378. $(warning Otherwise, disable Python support entirely:)
  379. $(warning $(and ,))
  380. $(warning $(and ,) make NO_LIBPYTHON=1)
  381. $(warning $(and ,))
  382. $(error $(and ,))
  383. else
  384. LDFLAGS += $(PYTHON_EMBED_LDFLAGS)
  385. EXTLIBS += $(PYTHON_EMBED_LIBADD)
  386. LANG_BINDINGS += $(obj-perf)python/perf.so
  387. endif
  388. endif
  389. endif
  390. endif
  391. endif
  392. ifeq ($(feature-libbfd), 1)
  393. EXTLIBS += -lbfd
  394. endif
  395. ifdef NO_DEMANGLE
  396. CFLAGS += -DNO_DEMANGLE
  397. else
  398. ifdef HAVE_CPLUS_DEMANGLE_SUPPORT
  399. EXTLIBS += -liberty
  400. CFLAGS += -DHAVE_CPLUS_DEMANGLE_SUPPORT
  401. else
  402. ifneq ($(feature-libbfd), 1)
  403. $(feature_check,liberty)
  404. ifeq ($(feature-liberty), 1)
  405. EXTLIBS += -lbfd -liberty
  406. else
  407. $(feature_check,liberty-z)
  408. ifeq ($(feature-liberty-z), 1)
  409. EXTLIBS += -lbfd -liberty -lz
  410. else
  411. $(feature_check,cplus-demangle)
  412. ifeq ($(feature-cplus-demangle), 1)
  413. EXTLIBS += -liberty
  414. CFLAGS += -DHAVE_CPLUS_DEMANGLE_SUPPORT
  415. else
  416. msg := $(warning No bfd.h/libbfd found, install binutils-dev[el]/zlib-static to gain symbol demangling)
  417. CFLAGS += -DNO_DEMANGLE
  418. endif
  419. endif
  420. endif
  421. endif
  422. endif
  423. endif
  424. ifneq ($(filter -lbfd,$(EXTLIBS)),)
  425. CFLAGS += -DHAVE_LIBBFD_SUPPORT
  426. endif
  427. ifndef NO_ON_EXIT
  428. ifeq ($(feature-on-exit), 1)
  429. CFLAGS += -DHAVE_ON_EXIT_SUPPORT
  430. endif
  431. endif
  432. ifndef NO_BACKTRACE
  433. ifeq ($(feature-backtrace), 1)
  434. CFLAGS += -DHAVE_BACKTRACE_SUPPORT
  435. endif
  436. endif
  437. ifndef NO_LIBNUMA
  438. ifeq ($(feature-libnuma), 0)
  439. msg := $(warning No numa.h found, disables 'perf bench numa mem' benchmark, please install numa-libs-devel or libnuma-dev);
  440. NO_LIBNUMA := 1
  441. else
  442. CFLAGS += -DHAVE_LIBNUMA_SUPPORT
  443. EXTLIBS += -lnuma
  444. endif
  445. endif
  446. # Among the variables below, these:
  447. # perfexecdir
  448. # template_dir
  449. # mandir
  450. # infodir
  451. # htmldir
  452. # ETC_PERFCONFIG (but not sysconfdir)
  453. # can be specified as a relative path some/where/else;
  454. # this is interpreted as relative to $(prefix) and "perf" at
  455. # runtime figures out where they are based on the path to the executable.
  456. # This can help installing the suite in a relocatable way.
  457. # Make the path relative to DESTDIR, not to prefix
  458. ifndef DESTDIR
  459. prefix = $(HOME)
  460. endif
  461. bindir_relative = bin
  462. bindir = $(prefix)/$(bindir_relative)
  463. mandir = share/man
  464. infodir = share/info
  465. perfexecdir = libexec/perf-core
  466. sharedir = $(prefix)/share
  467. template_dir = share/perf-core/templates
  468. htmldir = share/doc/perf-doc
  469. ifeq ($(prefix),/usr)
  470. sysconfdir = /etc
  471. ETC_PERFCONFIG = $(sysconfdir)/perfconfig
  472. else
  473. sysconfdir = $(prefix)/etc
  474. ETC_PERFCONFIG = etc/perfconfig
  475. endif
  476. ifeq ($(IS_X86_64),1)
  477. lib = lib64
  478. else
  479. lib = lib
  480. endif
  481. libdir = $(prefix)/$(lib)
  482. # Shell quote (do not use $(call) to accommodate ancient setups);
  483. ETC_PERFCONFIG_SQ = $(subst ','\'',$(ETC_PERFCONFIG))
  484. DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
  485. bindir_SQ = $(subst ','\'',$(bindir))
  486. mandir_SQ = $(subst ','\'',$(mandir))
  487. infodir_SQ = $(subst ','\'',$(infodir))
  488. perfexecdir_SQ = $(subst ','\'',$(perfexecdir))
  489. template_dir_SQ = $(subst ','\'',$(template_dir))
  490. htmldir_SQ = $(subst ','\'',$(htmldir))
  491. prefix_SQ = $(subst ','\'',$(prefix))
  492. sysconfdir_SQ = $(subst ','\'',$(sysconfdir))
  493. libdir_SQ = $(subst ','\'',$(libdir))
  494. ifneq ($(filter /%,$(firstword $(perfexecdir))),)
  495. perfexec_instdir = $(perfexecdir)
  496. else
  497. perfexec_instdir = $(prefix)/$(perfexecdir)
  498. endif
  499. perfexec_instdir_SQ = $(subst ','\'',$(perfexec_instdir))