tools/perf/build: Split out feature check: 'libslang'
authorIngo Molnar <mingo@kernel.org>
Mon, 30 Sep 2013 12:57:54 +0000 (14:57 +0200)
committerIngo Molnar <mingo@kernel.org>
Wed, 9 Oct 2013 06:48:41 +0000 (08:48 +0200)
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-FGmpkydfwqlkaw7yy8ewjpza@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
tools/perf/config/Makefile
tools/perf/config/feature-checks/Makefile
tools/perf/config/feature-checks/test-libslang.c [new file with mode: 0644]

index d4f18f4c8d5103000ec76a7bbbbf42621ef08818..43713c641600c90127c17af96532eff2798c8c46 100644 (file)
@@ -115,6 +115,7 @@ FEATURE_TESTS =                             \
        libelf-getphdrnum               \
        libunwind                       \
        libaudit                        \
+       libslang                        \
        libnuma
 
 $(foreach test,$(FEATURE_TESTS),$(call feature_check,$(test),$(test)))
@@ -280,8 +281,7 @@ ifdef NO_NEWT
 endif
 
 ifndef NO_SLANG
-  FLAGS_SLANG=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) -I/usr/include/slang -lslang
-  ifneq ($(call try-cc,$(SOURCE_SLANG),$(FLAGS_SLANG),libslang),y)
+  ifneq ($(feature-libslang), 1)
     msg := $(warning slang not found, disables TUI support. Please install slang-devel or libslang-dev);
     NO_SLANG := 1
   else
index 8e49fa0c922b06a224c0d58d131c159e039a5596..c9b15b0a819bfe1a45ae1f575057c3336d9775d2 100644 (file)
@@ -13,6 +13,7 @@ FILES=                                        \
        test-libelf-getphdrnum          \
        test-libunwind                  \
        test-libaudit                   \
+       test-libslang                   \
        test-libnuma
 
 CC := $(CC) -MD
@@ -65,6 +66,9 @@ test-libunwind:
 test-libaudit:
        $(BUILD) -laudit
 
+test-libslang:
+       $(BUILD) -I/usr/include/slang -lslang
+
 -include *.d */*.d
 
 ###############################
diff --git a/tools/perf/config/feature-checks/test-libslang.c b/tools/perf/config/feature-checks/test-libslang.c
new file mode 100644 (file)
index 0000000..22ff22e
--- /dev/null
@@ -0,0 +1,6 @@
+#include <slang.h>
+
+int main(void)
+{
+       return SLsmg_init_smg();
+}