Makefile 15 KB

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