summaryrefslogtreecommitdiffstats
path: root/tools/perf/config
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/config')
-rw-r--r--tools/perf/config/feature-tests.mak25
-rw-r--r--tools/perf/config/utilities.mak10
2 files changed, 31 insertions, 4 deletions
diff --git a/tools/perf/config/feature-tests.mak b/tools/perf/config/feature-tests.mak
index 4add41bb0c7..f5ac77485a4 100644
--- a/tools/perf/config/feature-tests.mak
+++ b/tools/perf/config/feature-tests.mak
@@ -43,6 +43,15 @@ int main(void)
}
endef
+define SOURCE_BIONIC
+#include <android/api-level.h>
+
+int main(void)
+{
+ return __ANDROID_API__;
+}
+endef
+
define SOURCE_ELF_MMAP
#include <libelf.h>
int main(void)
@@ -112,7 +121,10 @@ define SOURCE_PYTHON_VERSION
#if PY_VERSION_HEX >= 0x03000000
#error
#endif
-int main(void){}
+int main(void)
+{
+ return 0;
+}
endef
define SOURCE_PYTHON_EMBED
#include <Python.h>
@@ -203,4 +215,13 @@ int main(void)
return audit_open();
}
endef
-endif \ No newline at end of file
+endif
+
+define SOURCE_ON_EXIT
+#include <stdio.h>
+
+int main(void)
+{
+ return on_exit(NULL, NULL);
+}
+endef
diff --git a/tools/perf/config/utilities.mak b/tools/perf/config/utilities.mak
index 8046182a19e..e5413125e6b 100644
--- a/tools/perf/config/utilities.mak
+++ b/tools/perf/config/utilities.mak
@@ -180,9 +180,15 @@ _gea_warn = $(warning The path '$(1)' is not executable.)
_gea_err = $(if $(1),$(error Please set '$(1)' appropriately))
# try-cc
-# Usage: option = $(call try-cc, source-to-build, cc-options)
+# Usage: option = $(call try-cc, source-to-build, cc-options, msg)
+ifndef V
+TRY_CC_OUTPUT= > /dev/null 2>&1
+endif
+TRY_CC_MSG=echo " CHK $(3)" 1>&2;
+
try-cc = $(shell sh -c \
'TMP="$(OUTPUT)$(TMPOUT).$$$$"; \
+ $(TRY_CC_MSG) \
echo "$(1)" | \
- $(CC) -x c - $(2) -o "$$TMP" > /dev/null 2>&1 && echo y; \
+ $(CC) -x c - $(2) -o "$$TMP" $(TRY_CC_OUTPUT) && echo y; \
rm -f "$$TMP"')