diff options
author | Ingo Molnar <mingo@kernel.org> | 2013-09-30 08:55:31 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2013-10-09 02:48:40 -0400 |
commit | d795a658eb0ab5ab0b86cda5abe28954b0a08471 (patch) | |
tree | caeb6549959220a58f2d918a78a9b55e0651b69d | |
parent | 058f952de9b3075cd888dc3cea60691db0ec4d3f (diff) |
tools/perf/build: Split out feature check: 'libaudit'
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/n/tip-orhejqtjao3vf4wxwBUdzhaz@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r-- | tools/perf/config/Makefile | 4 | ||||
-rw-r--r-- | tools/perf/config/feature-checks/Makefile | 4 | ||||
-rw-r--r-- | tools/perf/config/feature-checks/test-libaudit.c | 7 |
3 files changed, 13 insertions, 2 deletions
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile index d684a292536e..d4f18f4c8d51 100644 --- a/tools/perf/config/Makefile +++ b/tools/perf/config/Makefile | |||
@@ -114,6 +114,7 @@ FEATURE_TESTS = \ | |||
114 | libelf-mmap \ | 114 | libelf-mmap \ |
115 | libelf-getphdrnum \ | 115 | libelf-getphdrnum \ |
116 | libunwind \ | 116 | libunwind \ |
117 | libaudit \ | ||
117 | libnuma | 118 | libnuma |
118 | 119 | ||
119 | $(foreach test,$(FEATURE_TESTS),$(call feature_check,$(test),$(test))) | 120 | $(foreach test,$(FEATURE_TESTS),$(call feature_check,$(test),$(test))) |
@@ -265,8 +266,7 @@ ifndef NO_LIBUNWIND | |||
265 | endif | 266 | endif |
266 | 267 | ||
267 | ifndef NO_LIBAUDIT | 268 | ifndef NO_LIBAUDIT |
268 | FLAGS_LIBAUDIT = $(CFLAGS) $(LDFLAGS) -laudit | 269 | ifneq ($(feature-libaudit), 1) |
269 | ifneq ($(call try-cc,$(SOURCE_LIBAUDIT),$(FLAGS_LIBAUDIT),libaudit),y) | ||
270 | msg := $(warning No libaudit.h found, disables 'trace' tool, please install audit-libs-devel or libaudit-dev); | 270 | msg := $(warning No libaudit.h found, disables 'trace' tool, please install audit-libs-devel or libaudit-dev); |
271 | NO_LIBAUDIT := 1 | 271 | NO_LIBAUDIT := 1 |
272 | else | 272 | else |
diff --git a/tools/perf/config/feature-checks/Makefile b/tools/perf/config/feature-checks/Makefile index d6d9570a038f..8e49fa0c922b 100644 --- a/tools/perf/config/feature-checks/Makefile +++ b/tools/perf/config/feature-checks/Makefile | |||
@@ -12,6 +12,7 @@ FILES= \ | |||
12 | test-libelf-mmap \ | 12 | test-libelf-mmap \ |
13 | test-libelf-getphdrnum \ | 13 | test-libelf-getphdrnum \ |
14 | test-libunwind \ | 14 | test-libunwind \ |
15 | test-libaudit \ | ||
15 | test-libnuma | 16 | test-libnuma |
16 | 17 | ||
17 | CC := $(CC) -MD | 18 | CC := $(CC) -MD |
@@ -61,6 +62,9 @@ test-libnuma: | |||
61 | test-libunwind: | 62 | test-libunwind: |
62 | $(BUILD) -lunwind -lunwind-x86_64 -lelf | 63 | $(BUILD) -lunwind -lunwind-x86_64 -lelf |
63 | 64 | ||
65 | test-libaudit: | ||
66 | $(BUILD) -laudit | ||
67 | |||
64 | -include *.d */*.d | 68 | -include *.d */*.d |
65 | 69 | ||
66 | ############################### | 70 | ############################### |
diff --git a/tools/perf/config/feature-checks/test-libaudit.c b/tools/perf/config/feature-checks/test-libaudit.c new file mode 100644 index 000000000000..854a65d3cc78 --- /dev/null +++ b/tools/perf/config/feature-checks/test-libaudit.c | |||
@@ -0,0 +1,7 @@ | |||
1 | #include <libaudit.h> | ||
2 | |||
3 | int main(void) | ||
4 | { | ||
5 | printf("error message: %s\n", audit_errno_to_name(0)); | ||
6 | return audit_open(); | ||
7 | } | ||