aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/config/utilities.mak
diff options
context:
space:
mode:
authorMichael Witten <mfwitten@gmail.com>2011-04-12 16:27:59 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2011-04-19 07:18:36 -0400
commit7fbd065f5a2b299172502f09fc3fbde02b48f591 (patch)
treef989584eb661d386875ff134dbdaa934c312d64a /tools/perf/config/utilities.mak
parentced465c400b23656ef2c4fbfb4add0e5b92e3d97 (diff)
perf tools: Move `try-cc'
The `try-cc' user-defined function was in tools/perf/feature-tests.mak; this commit moves it to tools/perf/config/utilities.mak. Signed-off-by: Michael Witten <mfwitten@gmail.com> Link: http://lkml.kernel.org/n/tip-bqhwcuxsrve0iodn6q4ejaoi@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/config/utilities.mak')
-rw-r--r--tools/perf/config/utilities.mak8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/perf/config/utilities.mak b/tools/perf/config/utilities.mak
index 6d8ff8878405..8046182a19eb 100644
--- a/tools/perf/config/utilities.mak
+++ b/tools/perf/config/utilities.mak
@@ -178,3 +178,11 @@ endef
178_ge_attempt = $(or $(get-executable),$(_gea_warn),$(call _gea_err,$(2))) 178_ge_attempt = $(or $(get-executable),$(_gea_warn),$(call _gea_err,$(2)))
179_gea_warn = $(warning The path '$(1)' is not executable.) 179_gea_warn = $(warning The path '$(1)' is not executable.)
180_gea_err = $(if $(1),$(error Please set '$(1)' appropriately)) 180_gea_err = $(if $(1),$(error Please set '$(1)' appropriately))
181
182# try-cc
183# Usage: option = $(call try-cc, source-to-build, cc-options)
184try-cc = $(shell sh -c \
185 'TMP="$(OUTPUT)$(TMPOUT).$$$$"; \
186 echo "$(1)" | \
187 $(CC) -x c - $(2) -o "$$TMP" > /dev/null 2>&1 && echo y; \
188 rm -f "$$TMP"')