Makefile 14 KB

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