Makefile 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499
  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/feature-tests.mak
  45. include $(src-perf)/config/utilities.mak
  46. ifeq ($(call get-executable,$(FLEX)),)
  47. dummy := $(error Error: $(FLEX) is missing on this system, please install it)
  48. endif
  49. ifeq ($(call get-executable,$(BISON)),)
  50. dummy := $(error Error: $(BISON) is missing on this system, please install it)
  51. endif
  52. # Treat warnings as errors unless directed not to
  53. ifneq ($(WERROR),0)
  54. CFLAGS += -Werror
  55. endif
  56. ifeq ("$(origin DEBUG)", "command line")
  57. PERF_DEBUG = $(DEBUG)
  58. endif
  59. ifndef PERF_DEBUG
  60. CFLAGS += -O6
  61. endif
  62. ifdef PARSER_DEBUG
  63. PARSER_DEBUG_BISON := -t
  64. PARSER_DEBUG_FLEX := -d
  65. CFLAGS += -DPARSER_DEBUG
  66. endif
  67. CFLAGS += -fno-omit-frame-pointer
  68. CFLAGS += -ggdb3
  69. CFLAGS += -funwind-tables
  70. CFLAGS += -Wall
  71. CFLAGS += -Wextra
  72. CFLAGS += -std=gnu99
  73. EXTLIBS = -lelf -lpthread -lrt -lm -ldl
  74. feature_check = $(eval $(feature_check_code)); $(info CHK: config/feature-checks/test-$(1))
  75. define feature_check_code
  76. feature-$(2) := $(shell make -C config/feature-checks test-$1 >/dev/null 2>/dev/null && echo 1 || echo 0)
  77. endef
  78. #
  79. # Build the feature check binaries in parallel, ignore errors, ignore return value and suppress output:
  80. #
  81. $(info Testing features:)
  82. $(shell make -i -j -C config/feature-checks >/dev/null 2>&1)
  83. $(info done)
  84. FEATURE_TESTS = \
  85. hello \
  86. stackprotector-all \
  87. libnuma
  88. $(foreach test,$(FEATURE_TESTS),$(call feature_check,$(test),$(test)))
  89. ifeq ($(feature-stackprotector-all), 1)
  90. CFLAGS += -fstack-protector-all
  91. endif
  92. ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -Werror -Wstack-protector,-Wstack-protector),y)
  93. CFLAGS += -Wstack-protector
  94. endif
  95. ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -Werror -Wvolatile-register-var,-Wvolatile-register-var),y)
  96. CFLAGS += -Wvolatile-register-var
  97. endif
  98. ifndef PERF_DEBUG
  99. ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -D_FORTIFY_SOURCE=2,-D_FORTIFY_SOURCE=2),y)
  100. CFLAGS += -D_FORTIFY_SOURCE=2
  101. endif
  102. endif
  103. CFLAGS += -I$(src-perf)/util/include
  104. CFLAGS += -I$(src-perf)/arch/$(ARCH)/include
  105. CFLAGS += -I$(srctree)/arch/$(ARCH)/include/uapi
  106. CFLAGS += -I$(srctree)/arch/$(ARCH)/include
  107. CFLAGS += -I$(srctree)/include/uapi
  108. CFLAGS += -I$(srctree)/include
  109. # $(obj-perf) for generated common-cmds.h
  110. # $(obj-perf)/util for generated bison/flex headers
  111. ifneq ($(OUTPUT),)
  112. CFLAGS += -I$(obj-perf)/util
  113. CFLAGS += -I$(obj-perf)
  114. endif
  115. CFLAGS += -I$(src-perf)/util
  116. CFLAGS += -I$(src-perf)
  117. CFLAGS += -I$(LIB_INCLUDE)
  118. CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
  119. ifndef NO_BIONIC
  120. ifeq ($(call try-cc,$(SOURCE_BIONIC),$(CFLAGS),bionic),y)
  121. BIONIC := 1
  122. EXTLIBS := $(filter-out -lrt,$(EXTLIBS))
  123. EXTLIBS := $(filter-out -lpthread,$(EXTLIBS))
  124. endif
  125. endif # NO_BIONIC
  126. ifdef NO_LIBELF
  127. NO_DWARF := 1
  128. NO_DEMANGLE := 1
  129. NO_LIBUNWIND := 1
  130. else
  131. FLAGS_LIBELF=$(CFLAGS) $(LDFLAGS) $(EXTLIBS)
  132. ifneq ($(call try-cc,$(SOURCE_LIBELF),$(FLAGS_LIBELF),libelf),y)
  133. FLAGS_GLIBC=$(CFLAGS) $(LDFLAGS)
  134. ifeq ($(call try-cc,$(SOURCE_GLIBC),$(FLAGS_GLIBC),glibc),y)
  135. LIBC_SUPPORT := 1
  136. endif
  137. ifeq ($(BIONIC),1)
  138. LIBC_SUPPORT := 1
  139. endif
  140. ifeq ($(LIBC_SUPPORT),1)
  141. msg := $(warning No libelf found, disables 'probe' tool, please install elfutils-libelf-devel/libelf-dev);
  142. NO_LIBELF := 1
  143. NO_DWARF := 1
  144. NO_DEMANGLE := 1
  145. else
  146. msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]/glibc-static);
  147. endif
  148. else
  149. # for linking with debug library, run like:
  150. # make DEBUG=1 LIBDW_DIR=/opt/libdw/
  151. ifdef LIBDW_DIR
  152. LIBDW_CFLAGS := -I$(LIBDW_DIR)/include
  153. LIBDW_LDFLAGS := -L$(LIBDW_DIR)/lib
  154. endif
  155. FLAGS_DWARF=$(CFLAGS) $(LIBDW_CFLAGS) -ldw -lz -lelf $(LIBDW_LDFLAGS) $(LDFLAGS) $(EXTLIBS)
  156. ifneq ($(call try-cc,$(SOURCE_DWARF),$(FLAGS_DWARF),libdw),y)
  157. 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);
  158. NO_DWARF := 1
  159. endif # Dwarf support
  160. endif # SOURCE_LIBELF
  161. endif # NO_LIBELF
  162. ifndef NO_LIBELF
  163. CFLAGS += -DHAVE_LIBELF_SUPPORT
  164. FLAGS_LIBELF=$(CFLAGS) $(LDFLAGS) $(EXTLIBS)
  165. ifeq ($(call try-cc,$(SOURCE_ELF_MMAP),$(FLAGS_LIBELF),-DHAVE_LIBELF_MMAP_SUPPORT),y)
  166. CFLAGS += -DHAVE_LIBELF_MMAP_SUPPORT
  167. endif
  168. ifeq ($(call try-cc,$(SOURCE_ELF_GETPHDRNUM),$(FLAGS_LIBELF),-DHAVE_ELF_GETPHDRNUM_SUPPORT),y)
  169. CFLAGS += -DHAVE_ELF_GETPHDRNUM_SUPPORT
  170. endif
  171. # include ARCH specific config
  172. -include $(src-perf)/arch/$(ARCH)/Makefile
  173. ifndef NO_DWARF
  174. ifeq ($(origin PERF_HAVE_DWARF_REGS), undefined)
  175. msg := $(warning DWARF register mappings have not been defined for architecture $(ARCH), DWARF support disabled);
  176. NO_DWARF := 1
  177. else
  178. CFLAGS += -DHAVE_DWARF_SUPPORT $(LIBDW_CFLAGS)
  179. LDFLAGS += $(LIBDW_LDFLAGS)
  180. EXTLIBS += -lelf -ldw
  181. endif # PERF_HAVE_DWARF_REGS
  182. endif # NO_DWARF
  183. endif # NO_LIBELF
  184. ifndef NO_LIBELF
  185. CFLAGS += -DHAVE_LIBELF_SUPPORT
  186. FLAGS_LIBELF=$(CFLAGS) $(LDFLAGS) $(EXTLIBS)
  187. ifeq ($(call try-cc,$(SOURCE_ELF_MMAP),$(FLAGS_LIBELF),-DHAVE_LIBELF_MMAP_SUPPORT),y)
  188. CFLAGS += -DHAVE_LIBELF_MMAP_SUPPORT
  189. endif # try-cc
  190. endif # NO_LIBELF
  191. # There's only x86 (both 32 and 64) support for CFI unwind so far
  192. ifneq ($(ARCH),x86)
  193. NO_LIBUNWIND := 1
  194. endif
  195. ifndef NO_LIBUNWIND
  196. # for linking with debug library, run like:
  197. # make DEBUG=1 LIBUNWIND_DIR=/opt/libunwind/
  198. ifdef LIBUNWIND_DIR
  199. LIBUNWIND_CFLAGS := -I$(LIBUNWIND_DIR)/include
  200. LIBUNWIND_LDFLAGS := -L$(LIBUNWIND_DIR)/lib
  201. endif
  202. FLAGS_UNWIND=$(LIBUNWIND_CFLAGS) $(CFLAGS) $(LIBUNWIND_LDFLAGS) $(LDFLAGS) $(EXTLIBS) $(LIBUNWIND_LIBS)
  203. ifneq ($(call try-cc,$(SOURCE_LIBUNWIND),$(FLAGS_UNWIND),libunwind),y)
  204. msg := $(warning No libunwind found, disabling post unwind support. Please install libunwind-dev[el] >= 0.99);
  205. NO_LIBUNWIND := 1
  206. endif # Libunwind support
  207. endif # NO_LIBUNWIND
  208. ifndef NO_LIBUNWIND
  209. CFLAGS += -DHAVE_LIBUNWIND_SUPPORT
  210. EXTLIBS += $(LIBUNWIND_LIBS)
  211. CFLAGS += $(LIBUNWIND_CFLAGS)
  212. LDFLAGS += $(LIBUNWIND_LDFLAGS)
  213. endif # NO_LIBUNWIND
  214. ifndef NO_LIBAUDIT
  215. FLAGS_LIBAUDIT = $(CFLAGS) $(LDFLAGS) -laudit
  216. ifneq ($(call try-cc,$(SOURCE_LIBAUDIT),$(FLAGS_LIBAUDIT),libaudit),y)
  217. msg := $(warning No libaudit.h found, disables 'trace' tool, please install audit-libs-devel or libaudit-dev);
  218. NO_LIBAUDIT := 1
  219. else
  220. CFLAGS += -DHAVE_LIBAUDIT_SUPPORT
  221. EXTLIBS += -laudit
  222. endif
  223. endif
  224. ifdef NO_NEWT
  225. NO_SLANG=1
  226. endif
  227. ifndef NO_SLANG
  228. FLAGS_SLANG=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) -I/usr/include/slang -lslang
  229. ifneq ($(call try-cc,$(SOURCE_SLANG),$(FLAGS_SLANG),libslang),y)
  230. msg := $(warning slang not found, disables TUI support. Please install slang-devel or libslang-dev);
  231. NO_SLANG := 1
  232. else
  233. # Fedora has /usr/include/slang/slang.h, but ubuntu /usr/include/slang.h
  234. CFLAGS += -I/usr/include/slang
  235. CFLAGS += -DHAVE_SLANG_SUPPORT
  236. EXTLIBS += -lslang
  237. endif
  238. endif
  239. ifndef NO_GTK2
  240. FLAGS_GTK2=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null)
  241. ifneq ($(call try-cc,$(SOURCE_GTK2),$(FLAGS_GTK2),gtk2),y)
  242. msg := $(warning GTK2 not found, disables GTK2 support. Please install gtk2-devel or libgtk2.0-dev);
  243. NO_GTK2 := 1
  244. else
  245. ifeq ($(call try-cc,$(SOURCE_GTK2_INFOBAR),$(FLAGS_GTK2),-DHAVE_GTK_INFO_BAR_SUPPORT),y)
  246. CFLAGS += -DHAVE_GTK_INFO_BAR_SUPPORT
  247. endif
  248. CFLAGS += -DHAVE_GTK2_SUPPORT
  249. CFLAGS += $(shell pkg-config --cflags gtk+-2.0 2>/dev/null)
  250. EXTLIBS += $(shell pkg-config --libs gtk+-2.0 2>/dev/null)
  251. endif
  252. endif
  253. grep-libs = $(filter -l%,$(1))
  254. strip-libs = $(filter-out -l%,$(1))
  255. ifdef NO_LIBPERL
  256. CFLAGS += -DNO_LIBPERL
  257. else
  258. PERL_EMBED_LDOPTS = $(shell perl -MExtUtils::Embed -e ldopts 2>/dev/null)
  259. PERL_EMBED_LDFLAGS = $(call strip-libs,$(PERL_EMBED_LDOPTS))
  260. PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS))
  261. PERL_EMBED_CCOPTS = `perl -MExtUtils::Embed -e ccopts 2>/dev/null`
  262. FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS)
  263. ifneq ($(call try-cc,$(SOURCE_PERL_EMBED),$(FLAGS_PERL_EMBED),perl),y)
  264. CFLAGS += -DNO_LIBPERL
  265. NO_LIBPERL := 1
  266. else
  267. LDFLAGS += $(PERL_EMBED_LDFLAGS)
  268. EXTLIBS += $(PERL_EMBED_LIBADD)
  269. endif
  270. endif
  271. disable-python = $(eval $(disable-python_code))
  272. define disable-python_code
  273. CFLAGS += -DNO_LIBPYTHON
  274. $(if $(1),$(warning No $(1) was found))
  275. $(warning Python support will not be built)
  276. NO_LIBPYTHON := 1
  277. endef
  278. override PYTHON := \
  279. $(call get-executable-or-default,PYTHON,python)
  280. ifndef PYTHON
  281. $(call disable-python,python interpreter)
  282. else
  283. PYTHON_WORD := $(call shell-wordify,$(PYTHON))
  284. ifdef NO_LIBPYTHON
  285. $(call disable-python)
  286. else
  287. override PYTHON_CONFIG := \
  288. $(call get-executable-or-default,PYTHON_CONFIG,$(PYTHON)-config)
  289. ifndef PYTHON_CONFIG
  290. $(call disable-python,python-config tool)
  291. else
  292. PYTHON_CONFIG_SQ := $(call shell-sq,$(PYTHON_CONFIG))
  293. PYTHON_EMBED_LDOPTS := $(shell $(PYTHON_CONFIG_SQ) --ldflags 2>/dev/null)
  294. PYTHON_EMBED_LDFLAGS := $(call strip-libs,$(PYTHON_EMBED_LDOPTS))
  295. PYTHON_EMBED_LIBADD := $(call grep-libs,$(PYTHON_EMBED_LDOPTS))
  296. PYTHON_EMBED_CCOPTS := $(shell $(PYTHON_CONFIG_SQ) --cflags 2>/dev/null)
  297. FLAGS_PYTHON_EMBED := $(PYTHON_EMBED_CCOPTS) $(PYTHON_EMBED_LDOPTS)
  298. ifneq ($(call try-cc,$(SOURCE_PYTHON_EMBED),$(FLAGS_PYTHON_EMBED),python),y)
  299. $(call disable-python,Python.h (for Python 2.x))
  300. else
  301. ifneq ($(call try-cc,$(SOURCE_PYTHON_VERSION),$(FLAGS_PYTHON_EMBED),python version),y)
  302. $(warning Python 3 is not yet supported; please set)
  303. $(warning PYTHON and/or PYTHON_CONFIG appropriately.)
  304. $(warning If you also have Python 2 installed, then)
  305. $(warning try something like:)
  306. $(warning $(and ,))
  307. $(warning $(and ,) make PYTHON=python2)
  308. $(warning $(and ,))
  309. $(warning Otherwise, disable Python support entirely:)
  310. $(warning $(and ,))
  311. $(warning $(and ,) make NO_LIBPYTHON=1)
  312. $(warning $(and ,))
  313. $(error $(and ,))
  314. else
  315. LDFLAGS += $(PYTHON_EMBED_LDFLAGS)
  316. EXTLIBS += $(PYTHON_EMBED_LIBADD)
  317. LANG_BINDINGS += $(obj-perf)python/perf.so
  318. endif
  319. endif
  320. endif
  321. endif
  322. endif
  323. ifdef NO_DEMANGLE
  324. CFLAGS += -DNO_DEMANGLE
  325. else
  326. ifdef HAVE_CPLUS_DEMANGLE_SUPPORT
  327. EXTLIBS += -liberty
  328. CFLAGS += -DHAVE_CPLUS_DEMANGLE_SUPPORT
  329. else
  330. FLAGS_BFD=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) -DPACKAGE='perf' -lbfd
  331. has_bfd := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD),libbfd)
  332. ifeq ($(has_bfd),y)
  333. EXTLIBS += -lbfd
  334. else
  335. FLAGS_BFD_IBERTY=$(FLAGS_BFD) -liberty
  336. has_bfd_iberty := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD_IBERTY),liberty)
  337. ifeq ($(has_bfd_iberty),y)
  338. EXTLIBS += -lbfd -liberty
  339. else
  340. FLAGS_BFD_IBERTY_Z=$(FLAGS_BFD_IBERTY) -lz
  341. has_bfd_iberty_z := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD_IBERTY_Z),libz)
  342. ifeq ($(has_bfd_iberty_z),y)
  343. EXTLIBS += -lbfd -liberty -lz
  344. else
  345. FLAGS_CPLUS_DEMANGLE=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) -liberty
  346. has_cplus_demangle := $(call try-cc,$(SOURCE_CPLUS_DEMANGLE),$(FLAGS_CPLUS_DEMANGLE),demangle)
  347. ifeq ($(has_cplus_demangle),y)
  348. EXTLIBS += -liberty
  349. CFLAGS += -DHAVE_CPLUS_DEMANGLE_SUPPORT
  350. else
  351. msg := $(warning No bfd.h/libbfd found, install binutils-dev[el]/zlib-static to gain symbol demangling)
  352. CFLAGS += -DNO_DEMANGLE
  353. endif
  354. endif
  355. endif
  356. endif
  357. endif
  358. endif
  359. ifndef NO_STRLCPY
  360. ifeq ($(call try-cc,$(SOURCE_STRLCPY),,-DHAVE_STRLCPY_SUPPORT),y)
  361. CFLAGS += -DHAVE_STRLCPY_SUPPORT
  362. endif
  363. endif
  364. ifndef NO_ON_EXIT
  365. ifeq ($(call try-cc,$(SOURCE_ON_EXIT),,-DHAVE_ON_EXIT_SUPPORT),y)
  366. CFLAGS += -DHAVE_ON_EXIT_SUPPORT
  367. endif
  368. endif
  369. ifndef NO_BACKTRACE
  370. ifeq ($(call try-cc,$(SOURCE_BACKTRACE),,-DHAVE_BACKTRACE_SUPPORT),y)
  371. CFLAGS += -DHAVE_BACKTRACE_SUPPORT
  372. endif
  373. endif
  374. ifndef NO_LIBNUMA
  375. ifeq ($(feature-libnuma), 0)
  376. msg := $(warning No numa.h found, disables 'perf bench numa mem' benchmark, please install numa-libs-devel or libnuma-dev);
  377. NO_LIBNUMA := 1
  378. else
  379. CFLAGS += -DHAVE_LIBNUMA_SUPPORT
  380. EXTLIBS += -lnuma
  381. endif
  382. endif
  383. # Among the variables below, these:
  384. # perfexecdir
  385. # template_dir
  386. # mandir
  387. # infodir
  388. # htmldir
  389. # ETC_PERFCONFIG (but not sysconfdir)
  390. # can be specified as a relative path some/where/else;
  391. # this is interpreted as relative to $(prefix) and "perf" at
  392. # runtime figures out where they are based on the path to the executable.
  393. # This can help installing the suite in a relocatable way.
  394. # Make the path relative to DESTDIR, not to prefix
  395. ifndef DESTDIR
  396. prefix = $(HOME)
  397. endif
  398. bindir_relative = bin
  399. bindir = $(prefix)/$(bindir_relative)
  400. mandir = share/man
  401. infodir = share/info
  402. perfexecdir = libexec/perf-core
  403. sharedir = $(prefix)/share
  404. template_dir = share/perf-core/templates
  405. htmldir = share/doc/perf-doc
  406. ifeq ($(prefix),/usr)
  407. sysconfdir = /etc
  408. ETC_PERFCONFIG = $(sysconfdir)/perfconfig
  409. else
  410. sysconfdir = $(prefix)/etc
  411. ETC_PERFCONFIG = etc/perfconfig
  412. endif
  413. lib = lib
  414. # Shell quote (do not use $(call) to accommodate ancient setups);
  415. ETC_PERFCONFIG_SQ = $(subst ','\'',$(ETC_PERFCONFIG))
  416. DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
  417. bindir_SQ = $(subst ','\'',$(bindir))
  418. mandir_SQ = $(subst ','\'',$(mandir))
  419. infodir_SQ = $(subst ','\'',$(infodir))
  420. perfexecdir_SQ = $(subst ','\'',$(perfexecdir))
  421. template_dir_SQ = $(subst ','\'',$(template_dir))
  422. htmldir_SQ = $(subst ','\'',$(htmldir))
  423. prefix_SQ = $(subst ','\'',$(prefix))
  424. sysconfdir_SQ = $(subst ','\'',$(sysconfdir))
  425. ifneq ($(filter /%,$(firstword $(perfexecdir))),)
  426. perfexec_instdir = $(perfexecdir)
  427. else
  428. perfexec_instdir = $(prefix)/$(perfexecdir)
  429. endif
  430. perfexec_instdir_SQ = $(subst ','\'',$(perfexec_instdir))