Makefile 15 KB

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