Makefile 15 KB

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