tools/perf/build: Split out feature check: 'libbfd'
authorIngo Molnar <mingo@kernel.org>
Mon, 30 Sep 2013 13:53:31 +0000 (15:53 +0200)
committerIngo Molnar <mingo@kernel.org>
Wed, 9 Oct 2013 06:48:45 +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-cdxdfv7Corpfvjg9Skezhvjn@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-libbfd.c [new file with mode: 0644]

index 63ba069..7e13969 100644 (file)
@@ -121,6 +121,7 @@ FEATURE_TESTS =                             \
        libperl                         \
        libpython                       \
        libpython-version               \
+       libbfd                          \
        libnuma
 
 $(foreach test,$(FEATURE_TESTS),$(call feature_check,$(test),$(test)))
@@ -404,8 +405,7 @@ else
     CFLAGS += -DHAVE_CPLUS_DEMANGLE_SUPPORT
   else
     FLAGS_BFD=$(CFLAGS) $(LDFLAGS) $(EXTLIBS) -DPACKAGE='perf' -lbfd
-    has_bfd := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD),libbfd)
-    ifeq ($(has_bfd),y)
+    ifeq ($(feature-libbfd), 1)
       EXTLIBS += -lbfd
     else
       FLAGS_BFD_IBERTY=$(FLAGS_BFD) -liberty
index d15074d..af65aaa 100644 (file)
@@ -19,6 +19,7 @@ FILES=                                        \
        test-libperl                    \
        test-libpython                  \
        test-libpython-version          \
+       test-libbfd                     \
        test-libnuma
 
 CC := $(CC) -MD
@@ -112,6 +113,9 @@ test-libpython:
 test-libpython-version:
        $(BUILD) $(FLAGS_PYTHON_EMBED)
 
+test-libbfd:
+       $(BUILD) -DPACKAGE='perf' -DPACKAGE=perf -lbfd -ldl
+
 -include *.d */*.d
 
 ###############################
diff --git a/tools/perf/config/feature-checks/test-libbfd.c b/tools/perf/config/feature-checks/test-libbfd.c
new file mode 100644 (file)
index 0000000..d03339c
--- /dev/null
@@ -0,0 +1,7 @@
+#include <bfd.h>
+
+int main(void)
+{
+       bfd_demangle(0, 0, 0);
+       return 0;
+}