[PATCH 11/50] tools/perf/build: Split out feature check: 'libelf'
From: Ingo Molnar
Date: Mon Oct 07 2013 - 08:10:15 EST
Cc: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
Cc: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
Cc: David Ahern <dsahern@xxxxxxxxx>
Cc: Jiri Olsa <jolsa@xxxxxxxxxx>
Link: http://lkml.kernel.org/n/tip-qznhihaasbysfqO7ffvRsf9q@xxxxxxxxxxxxxx
Signed-off-by: Ingo Molnar <mingo@xxxxxxxxxx>
---
tools/perf/config/Makefile | 4 ++--
tools/perf/config/feature-checks/Makefile | 4 ++++
tools/perf/config/feature-checks/test-libelf.c | 7 +++++++
3 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 3e9fe16..98a7157 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -108,6 +108,7 @@ FEATURE_TESTS = \
volatile-register-var \
fortify-source \
bionic \
+ libelf \
libnuma
$(foreach test,$(FEATURE_TESTS),$(call feature_check,$(test),$(test)))
@@ -163,8 +164,7 @@ ifdef NO_LIBELF
NO_DEMANGLE := 1
NO_LIBUNWIND := 1
else
- FLAGS_LIBELF=$(CFLAGS) $(LDFLAGS) $(EXTLIBS)
- ifneq ($(call try-cc,$(SOURCE_LIBELF),$(FLAGS_LIBELF),libelf),y)
+ ifeq ($(feature-libelf), 0)
FLAGS_GLIBC=$(CFLAGS) $(LDFLAGS)
ifeq ($(call try-cc,$(SOURCE_GLIBC),$(FLAGS_GLIBC),glibc),y)
LIBC_SUPPORT := 1
diff --git a/tools/perf/config/feature-checks/Makefile b/tools/perf/config/feature-checks/Makefile
index 191df97..789a38d 100644
--- a/tools/perf/config/feature-checks/Makefile
+++ b/tools/perf/config/feature-checks/Makefile
@@ -6,6 +6,7 @@ FILES= \
test-volatile-register-var \
test-fortify-source \
test-bionic \
+ test-libelf \
test-libnuma
CC := $(CC) -MD
@@ -34,6 +35,9 @@ test-fortify-source:
test-bionic:
$(BUILD)
+test-libelf:
+ $(BUILD) -lelf
+
test-libnuma:
$(BUILD) -lnuma
diff --git a/tools/perf/config/feature-checks/test-libelf.c b/tools/perf/config/feature-checks/test-libelf.c
new file mode 100644
index 0000000..1a08f97
--- /dev/null
+++ b/tools/perf/config/feature-checks/test-libelf.c
@@ -0,0 +1,7 @@
+#include <libelf.h>
+
+int main(void)
+{
+ Elf *elf = elf_begin(0, ELF_C_READ, 0);
+ return (long)elf;
+}
--
1.7.11.7
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/