提交 7fbd065f 编写于 作者: M Michael Witten 提交者: Arnaldo Carvalho de Melo

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: NMichael Witten <mfwitten@gmail.com>
Link: http://lkml.kernel.org/n/tip-bqhwcuxsrve0iodn6q4ejaoi@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 ced465c4
...@@ -178,3 +178,11 @@ endef ...@@ -178,3 +178,11 @@ endef
_ge_attempt = $(or $(get-executable),$(_gea_warn),$(call _gea_err,$(2))) _ge_attempt = $(or $(get-executable),$(_gea_warn),$(call _gea_err,$(2)))
_gea_warn = $(warning The path '$(1)' is not executable.) _gea_warn = $(warning The path '$(1)' is not executable.)
_gea_err = $(if $(1),$(error Please set '$(1)' appropriately)) _gea_err = $(if $(1),$(error Please set '$(1)' appropriately))
# try-cc
# Usage: option = $(call try-cc, source-to-build, cc-options)
try-cc = $(shell sh -c \
'TMP="$(OUTPUT)$(TMPOUT).$$$$"; \
echo "$(1)" | \
$(CC) -x c - $(2) -o "$$TMP" > /dev/null 2>&1 && echo y; \
rm -f "$$TMP"')
...@@ -126,11 +126,3 @@ int main(void) ...@@ -126,11 +126,3 @@ int main(void)
return 0; return 0;
} }
endef endef
# try-cc
# Usage: option = $(call try-cc, source-to-build, cc-options)
try-cc = $(shell sh -c \
'TMP="$(OUTPUT)$(TMPOUT).$$$$"; \
echo "$(1)" | \
$(CC) -x c - $(2) -o "$$TMP" > /dev/null 2>&1 && echo y; \
rm -f "$$TMP"')
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册