Moving gtk2 check config into config/Makefile.

Signed-off-by: Jiri Olsa <jo...@redhat.com>
Cc: Arnaldo Carvalho de Melo <a...@ghostprotocols.net>
Cc: Peter Zijlstra <a.p.zijls...@chello.nl>
Cc: Ingo Molnar <mi...@elte.hu>
Cc: Paul Mackerras <pau...@samba.org>
Cc: Corey Ashford <cjash...@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweis...@gmail.com>
Cc: Namhyung Kim <namhy...@kernel.org>
Cc: Borislav Petkov <b...@alien8.de>
Cc: Stephane Eranian <eran...@google.com>
---
 tools/perf/Makefile        | 25 +++++++------------------
 tools/perf/config/Makefile | 15 +++++++++++++++
 2 files changed, 22 insertions(+), 18 deletions(-)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index f6744cb..8d3dd8e 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -509,24 +509,13 @@ ifndef NO_SLANG
 endif
 
 ifndef NO_GTK2
-       FLAGS_GTK2=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) $(shell pkg-config 
--libs --cflags gtk+-2.0 2>/dev/null)
-       ifneq ($(call try-cc,$(SOURCE_GTK2),$(FLAGS_GTK2),gtk2),y)
-               msg := $(warning GTK2 not found, disables GTK2 support. Please 
install gtk2-devel or libgtk2.0-dev);
-       else
-               ifeq ($(call 
try-cc,$(SOURCE_GTK2_INFOBAR),$(FLAGS_GTK2),-DHAVE_GTK_INFO_BAR),y)
-                       BASIC_CFLAGS += -DHAVE_GTK_INFO_BAR
-               endif
-               BASIC_CFLAGS += -DGTK2_SUPPORT
-               BASIC_CFLAGS += $(shell pkg-config --cflags gtk+-2.0 
2>/dev/null)
-               EXTLIBS += $(shell pkg-config --libs gtk+-2.0 2>/dev/null)
-               LIB_OBJS += $(OUTPUT)ui/gtk/browser.o
-               LIB_OBJS += $(OUTPUT)ui/gtk/hists.o
-               LIB_OBJS += $(OUTPUT)ui/gtk/setup.o
-               LIB_OBJS += $(OUTPUT)ui/gtk/util.o
-               LIB_OBJS += $(OUTPUT)ui/gtk/helpline.o
-               LIB_OBJS += $(OUTPUT)ui/gtk/progress.o
-               LIB_OBJS += $(OUTPUT)ui/gtk/annotate.o
-       endif
+       LIB_OBJS += $(OUTPUT)ui/gtk/browser.o
+       LIB_OBJS += $(OUTPUT)ui/gtk/hists.o
+       LIB_OBJS += $(OUTPUT)ui/gtk/setup.o
+       LIB_OBJS += $(OUTPUT)ui/gtk/util.o
+       LIB_OBJS += $(OUTPUT)ui/gtk/helpline.o
+       LIB_OBJS += $(OUTPUT)ui/gtk/progress.o
+       LIB_OBJS += $(OUTPUT)ui/gtk/annotate.o
 endif
 
 ifdef NO_LIBPERL
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 008b212..6fc2089 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -225,3 +225,18 @@ ifndef NO_SLANG
                EXTLIBS += -lslang
        endif
 endif
+
+ifndef NO_GTK2
+       FLAGS_GTK2=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) $(shell pkg-config 
--libs --cflags gtk+-2.0 2>/dev/null)
+       ifneq ($(call try-cc,$(SOURCE_GTK2),$(FLAGS_GTK2),gtk2),y)
+               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),y)
+                       BASIC_CFLAGS += -DHAVE_GTK_INFO_BAR
+               endif
+               BASIC_CFLAGS += -DGTK2_SUPPORT
+               BASIC_CFLAGS += $(shell pkg-config --cflags gtk+-2.0 
2>/dev/null)
+               EXTLIBS += $(shell pkg-config --libs gtk+-2.0 2>/dev/null)
+       endif
+endif
-- 
1.7.11.7

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to