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

index b3bf931dd2a0cfc512afcd961e8a49fc37f40670..3d3d435b41fa3b0d104b929cd70f6d6d985b7eb0 100644 (file)
@@ -117,6 +117,7 @@ FEATURE_TESTS =                             \
        libaudit                        \
        libslang                        \
        gtk2                            \
+       gtk2-infobar                    \
        libnuma
 
 $(foreach test,$(FEATURE_TESTS),$(call feature_check,$(test),$(test)))
@@ -299,7 +300,7 @@ ifndef NO_GTK2
     msg := $(warning GTK2 not found, disables GTK2 support. Please install gtk2-devel or libgtk2.0-dev);
     NO_GTK2 := 1
   else
-    ifeq ($(call try-cc,$(SOURCE_GTK2_INFOBAR),$(FLAGS_GTK2),-DHAVE_GTK_INFO_BAR_SUPPORT),y)
+    ifeq ($(feature-gtk2-infobar), 1)
       CFLAGS += -DHAVE_GTK_INFO_BAR_SUPPORT
     endif
     CFLAGS += -DHAVE_GTK2_SUPPORT
index 920958c83ce8b68f3a99cbb54b1eab71a56eb407..017918f809ffca62a1280f17a51bfd3c60855d6a 100644 (file)
@@ -15,6 +15,7 @@ FILES=                                        \
        test-libaudit                   \
        test-libslang                   \
        test-gtk2                       \
+       test-gtk2-infobar               \
        test-libnuma
 
 CC := $(CC) -MD
@@ -73,6 +74,9 @@ test-libslang:
 test-gtk2:
        $(BUILD) $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null)
 
+test-gtk2-infobar:
+       $(BUILD) $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null)
+
 -include *.d */*.d
 
 ###############################
diff --git a/tools/perf/config/feature-checks/test-gtk2-infobar.c b/tools/perf/config/feature-checks/test-gtk2-infobar.c
new file mode 100644 (file)
index 0000000..eebcfbc
--- /dev/null
@@ -0,0 +1,10 @@
+#pragma GCC diagnostic ignored "-Wstrict-prototypes"
+#include <gtk/gtk.h>
+#pragma GCC diagnostic error "-Wstrict-prototypes"
+
+int main(void)
+{
+       gtk_info_bar_new();
+
+       return 0;
+}