Makefile 16 KB

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