[gnome-utils] Split gtk2 and gtk3 cflags and libs to allow porting each app



commit 1edb33ff9a5945dd70a35526547bb037adbc5340
Author: Paolo Borelli <pborelli gnome org>
Date:   Sat Oct 9 14:45:00 2010 +0200

    Split gtk2 and gtk3 cflags and libs to allow porting each app

 baobab/Makefile.am                                |    2 -
 baobab/src/Makefile.am                            |   11 ++++-
 configure.ac                                      |   45 +++++++++++---------
 gnome-dictionary/docs/reference/gdict/Makefile.am |    8 ++-
 gnome-dictionary/libgdict/Makefile.am             |   22 ++++++++--
 gnome-dictionary/src/Makefile.am                  |   34 +++++++++++----
 gnome-screenshot/Makefile.am                      |   17 ++++++--
 gsearchtool/Makefile.am                           |   22 ++++++----
 gsearchtool/libgnomeui-deprecated/Makefile.am     |   27 ++++++++----
 logview/Makefile.am                               |   15 ++++++-
 logview/tests/Makefile.am                         |   18 +++++++-
 11 files changed, 153 insertions(+), 68 deletions(-)
---
diff --git a/baobab/Makefile.am b/baobab/Makefile.am
index d9279ee..99b8327 100644
--- a/baobab/Makefile.am
+++ b/baobab/Makefile.am
@@ -1,3 +1 @@
-## Process this file with automake to produce Makefile.in
-
 SUBDIRS =  src data pixmaps help
diff --git a/baobab/src/Makefile.am b/baobab/src/Makefile.am
index e8c6241..11312d4 100644
--- a/baobab/src/Makefile.am
+++ b/baobab/src/Makefile.am
@@ -39,13 +39,20 @@ baobab_SOURCES = \
 	baobab-treemap.h
 
 baobab_CFLAGS = 			\
-	$(GNOME_UTILS_CFLAGS)		\
+	$(GLIB_CFLAGS)			\
+	$(GIO_CFLAGS)			\
+	$(GTK2_CFLAGS)			\
 	$(LIBGTOP_CFLAGS)		\
+	$(GCONF_CFLAGS)			\
 	$(NULL)
 
 baobab_LDFLAGS = -export-dynamic
 baobab_LDADD = 				\
 	-lm				\
-	$(GNOME_UTILS_LIBS)		\
+	$(GLIB_LIBS)			\
+	$(GIO_LIBS)			\
+	$(GTK2_LIBS)			\
 	$(LIBGTOP_LIBS)			\
+	$(GCONF_LIBS)			\
 	$(NULL)
+
diff --git a/configure.ac b/configure.ac
index 3494afc..3785973 100644
--- a/configure.ac
+++ b/configure.ac
@@ -71,34 +71,44 @@ dnl pkg-config check
 
 GLIB_REQUIRED=2.20.0
 GIO_REQUIRED=2.16.0
-GTK_REQUIRED=2.20.0
+GTK2_REQUIRED=2.20.0
+GTK_REQUIRED=2.91.1
 GIO_UNIX_REQUIRED=2.18.0
 LIBPANEL_APPLET_REQUIRED=2.13.4
 LIBGTOP_REQUIRED=2.12.0
 LIBCANBERRA_GTK_REQUIRED=0.4
 
-# common checks
-PKG_CHECK_MODULES(GNOME_UTILS, glib-2.0 >= $GLIB_REQUIRED dnl
-                               gio-2.0 >= $GIO_REQUIRED   dnl
-                               gconf-2.0                  dnl
-                               gtk+-2.0 >= $GTK_REQUIRED)
-AC_SUBST(GNOME_UTILS_CFLAGS)
-AC_SUBST(GNOME_UTILS_LIBS)
+PKG_CHECK_MODULES(GLIB, glib-2.0 >= $GLIB_REQUIRED)
+AC_SUBST(GLIB_CFLAGS)
+AC_SUBST(GLIB_LIBS)
 
 PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= $GLIB_REQUIRED)
 AC_SUBST(GTHREAD_CFLAGS)
 AC_SUBST(GTHREAD_LIBS)
 
-# libeggsmclient
-PKG_CHECK_MODULES(LIBEGGSMCLIENT, gtk+-2.0 >= $GTK_REQUIRED)
+PKG_CHECK_MODULES(GIO, gio-2.0 >= $GIO_REQUIRED)
+AC_SUBST(GIO_CFLAGS)
+AC_SUBST(GIO_LIBS)
+
+PKG_CHECK_MODULES(GIO_UNIX, gio-unix-2.0 >= $GIO_UNIX_REQUIRED)
+AC_SUBST(GIO_UNIX_CFLAGS)
+AC_SUBST(GIO_UNIX_LIBS)
+
+PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= $GTK2_REQUIRED)
+AC_SUBST(GTK2_CFLAGS)
+AC_SUBST(GTK2_LIBS)
+
+PKG_CHECK_MODULES(GTK, gtk+-3.0 >= $GTK_REQUIRED)
+AC_SUBST(GTK_CFLAGS)
+AC_SUBST(GTK_LIBS)
+
+PKG_CHECK_MODULES(LIBEGGSMCLIENT, gtk+-2.0 >= $GTK2_REQUIRED)
 AC_SUBST(LIBEGGSMCLIENT_CFLAGS)
 AC_SUBST(LIBEGGSMCLIENT_LIBS)
 
-# libgdict requires just gtk+
-PKG_CHECK_MODULES(LIBGDICT, glib-2.0 >= $GLIB_REQUIRED dnl
-                            gtk+-2.0 >= $GTK_REQUIRED)
-AC_SUBST(LIBGDICT_CFLAGS)
-AC_SUBST(LIBGDICT_LIBS)
+PKG_CHECK_MODULES(GCONF, gconf-2.0)
+AC_SUBST(GCONF_CFLAGS)
+AC_SUBST(GCONF_LIBS)
 
 # For each cycle:
 # 	first release: increment major += 1, minor = micro = 0;
@@ -128,11 +138,6 @@ PKG_CHECK_MODULES(XSHAPE, xext x11,
                   [AC_CHECK_HEADERS(X11/extensions/shape.h, XSHAPE_LIBS="-lXext -lX11")])
 AC_SUBST(XSHAPE_LIBS)
 
-# gio-unix is needed for gsearchtool
-PKG_CHECK_MODULES(GIO_UNIX, gio-unix-2.0 >= $GIO_UNIX_REQUIRED)
-AC_SUBST(GIO_UNIX_CFLAGS)
-AC_SUBST(GIO_UNIX_LIBS)
-
 # for anything which calls gconftool-2 correctly
 AC_PATH_PROG(GCONFTOOL, [gconftool-2], [no])
 AS_IF([test "x$GCONFTOOL" = "xno"],
diff --git a/gnome-dictionary/docs/reference/gdict/Makefile.am b/gnome-dictionary/docs/reference/gdict/Makefile.am
index 9dda65a..63ac9ab 100644
--- a/gnome-dictionary/docs/reference/gdict/Makefile.am
+++ b/gnome-dictionary/docs/reference/gdict/Makefile.am
@@ -53,13 +53,15 @@ extra_files =
 GTKDOC_CFLAGS =					\
 	$(CFLAGS)				\
 	$(CPPFLAGS)				\
-	$(LIBGDICT_CFLAGS)			\
-	-I$(srcdir)/../../../libgdict    	\
+	$(GLIB_CFLAGS)				\
+	$(GTK2_CFLAGS)				\
+	-I$(srcdir)/../../../libgdict		\
 	-I$(top_builddir)/gnome-dictionary/libgdict
 
 GTKDOC_LIBS =						\
 	$(LDFLAGS)					\
-	$(LIBGDICT_LIBS)				\
+	$(GLIB_LIBS)					\
+	$(GTK2_LIBS)					\
 	../../../libgdict/libgdict-1.0.la
 
 include $(top_srcdir)/gtk-doc.make
diff --git a/gnome-dictionary/libgdict/Makefile.am b/gnome-dictionary/libgdict/Makefile.am
index d141c8b..a1b8627 100644
--- a/gnome-dictionary/libgdict/Makefile.am
+++ b/gnome-dictionary/libgdict/Makefile.am
@@ -53,12 +53,24 @@ sources_c =	\
 lib_LTLIBRARIES = libgdict-1.0.la
 
 # GNOME Dictionary shared library
-libgdict_1_0_la_SOURCES  = $(sources_h) $(sources_h_priv) $(sources_c)
-libgdict_1_0_la_CPPFLAGS = $(LIBGDICT_CFLAGS) $(GDICT_DEBUG_CFLAGS) $(MAINTAINER_CFLAGS)
-libgdict_1_0_la_LIBADD   = $(LIBGDICT_LIBS)
+libgdict_1_0_la_SOURCES = \
+	$(sources_h)		\
+	$(sources_h_priv)	\
+	$(sources_c)
+
+libgdict_1_0_la_CPPFLAGS = \
+	$(GLIB_CFLAGS)		\
+	$(GTK2_CFLAGS)		\
+	$(GDICT_DEBUG_CFLAGS)	\
+	$(MAINTAINER_CFLAGS)
+
+libgdict_1_0_la_LIBADD = \
+	$(GLIB_LIBS)		\
+	$(GTK2_LIBS)
+
 libgdict_1_0_la_LDFLAGS  = \
-	-version-info $(LIBGDICT_LT_VERSION) \
-	-export-dynamic \
+	-version-info $(LIBGDICT_LT_VERSION)	\
+	-export-dynamic				\
 	-no-undefined
 
 libgdict_includedir = $(includedir)/gdict-1.0/gdict
diff --git a/gnome-dictionary/src/Makefile.am b/gnome-dictionary/src/Makefile.am
index 94532b5..cf0312e 100644
--- a/gnome-dictionary/src/Makefile.am
+++ b/gnome-dictionary/src/Makefile.am
@@ -35,15 +35,23 @@ gnome_dictionary_SOURCES = \
 	gdict-window.h 		\
 	main.c			\
 	$(NULL)
+
 gnome_dictionary_CFLAGS = \
-	-I$(top_builddir)/gnome-dictionary \
-	-I$(top_srcdir)/gnome-dictionary \
-	$(GNOME_UTILS_CFLAGS) \
+	-I$(top_builddir)/gnome-dictionary	\
+	-I$(top_srcdir)/gnome-dictionary	\
+	$(GLIB_CFLAGS)				\
+	$(GIO_CFLAGS)				\
+	$(GTK2_CFLAGS)				\
+	$(GCONF_CFLAGS)				\
 	$(NULL)
+
 gnome_dictionary_LDADD = \
 	-lm			\
 	$(top_builddir)/gnome-dictionary/libgdict/libgdict-1.0.la \
-	$(GNOME_UTILS_LIBS) \
+	$(GLIB_LIBS)		\
+	$(GIO_LIBS)		\
+	$(GTK2_LIBS)		\
+	$(GCONF_LIBS)		\
 	$(NULL)
 
 if BUILD_GDICT_APPLET
@@ -66,17 +74,25 @@ gnome_dictionary_applet_SOURCES = \
 	gdict-source-dialog.c 	\
 	gdict-source-dialog.h 	\
 	$(NULL)
+
 gnome_dictionary_applet_CFLAGS = \
-	-I$(top_builddir)/gnome-dictionary \
-	-I$(top_srcdir)/gnome-dictionary \
-	$(GNOME_UTILS_CFLAGS) \
+	-I$(top_builddir)/gnome-dictionary	\
+	-I$(top_srcdir)/gnome-dictionary	\
+	$(GLIB_CFLAGS)				\
+	$(GIO_CFLAG)				\
+	$(GTK2_CFLAGS)				\
+	$(GCONF_CFLAG)				\
 	$(APPLET_CFLAGS) \
 	$(NULL)
+
 gnome_dictionary_applet_LDADD = \
 	-lm			\
 	$(top_builddir)/gnome-dictionary/libgdict/libgdict-1.0.la \
-	$(GNOME_UTILS_LIBS) \
-	$(APPLET_LIBS) \
+	$(GLIB_LIBS)		\
+	$(GIO_LIBS)		\
+	$(GTK2_LIBS)		\
+	$(GCONF_LIBS)		\
+	$(APPLET_LIBS)		\
 	$(NULL)
 
 endif # BUILD_GDICT_APPLET
diff --git a/gnome-screenshot/Makefile.am b/gnome-screenshot/Makefile.am
index 87368bc..6f1b8fa 100644
--- a/gnome-screenshot/Makefile.am
+++ b/gnome-screenshot/Makefile.am
@@ -5,9 +5,6 @@ INCLUDES =							\
 	-I$(srcdir)						\
 	-DGNOMELOCALEDIR=\""$(prefix)/$(DATADIRNAME)/locale"\"	\
 	-DUIDIR=\""$(uidir)"\"					\
-	$(GNOME_UTILS_CFLAGS)					\
-	$(LIBCANBERRA_GTK_CFLAGS)				\
-	$(GTHREAD_CFLAGS)					\
 	$(NULL)
 
 bin_PROGRAMS = \
@@ -28,13 +25,25 @@ gnome_screenshot_SOURCES = \
 	screenshot-xfer.h		\
 	$(NULL)
 
+gnome_screenshot_CFLAGS =		\
+	$(GLIB_CFLAGS)			\
+	$(GIO_CFLAGS)			\
+	$(LIBCANBERRA_GTK_CFLAGS)	\
+	$(GTHREAD_CFLAGS)		\
+	$(GTK2_CFLAGS)			\
+	$(GCONF_CFLAGS)			\
+	$(NULL)
+
 gnome_screenshot_LDFLAGS = -export-dynamic
 
 gnome_screenshot_LDADD =		\
 	$(XSHAPE_LIBS)			\
-	$(GNOME_UTILS_LIBS)		\
+	$(GLIB_LIBS)			\
+	$(GIO_LIBS)			\
 	$(LIBCANBERRA_GTK_LIBS)		\
 	$(GTHREAD_LIBS)			\
+	$(GTK2_LIBS)			\
+	$(GCONF_LIBS)			\
 	-lm				\
 	$(NULL)
 
diff --git a/gsearchtool/Makefile.am b/gsearchtool/Makefile.am
index 2a3c977..3a301df 100644
--- a/gsearchtool/Makefile.am
+++ b/gsearchtool/Makefile.am
@@ -3,12 +3,10 @@ Utilitiesdir = $(datadir)/applications
 SUBDIRS = data help libgnomeui-deprecated
 
 INCLUDES = 	\
-	$(GNOME_UTILS_CFLAGS)					\
-	$(GIO_UNIX_CFLAGS)					\
 	-I$(srcdir)/libgnomeui-deprecated			\
-	-I$(top_srcdir)/libeggsmclient			\
+	-I$(top_srcdir)/libeggsmclient				\
 	-DG_DISABLE_DEPRECATED					\
-	-DGNOMELOCALEDIR=\""$(prefix)/$(DATADIRNAME)/locale"\" 	\
+	-DGNOMELOCALEDIR=\""$(prefix)/$(DATADIRNAME)/locale"\"	\
 	-DLOCALEDIR=\"$(datadir)/locale\"			\
 	-DDATADIR=\""$(datadir)"\"				\
 	-DGREP_COMMAND=\""$(GREP_COMMAND)"\"
@@ -31,10 +29,18 @@ gnome_search_tool_SOURCES =     \
 	gsearchtool.c	        \
 	gsearchtool.h
 
-gnome_search_tool_LDADD =            \
-	$(GNOME_UTILS_LIBS)          \
-	$(GIO_UNIX_LIBS)             \
-	$(libgnomeui_deprecated_LIB) \
+gnome_search_tool_CFLAGS = \
+	$(GLIB_CFLAGS)			\
+	$(GIO_CFLAGS)			\
+	$(GIO_UNIX_CFLAGS)		\
+	$(GTK2_CFLAGS)			\
+	$(GCONF_CFLAGS)
+
+gnome_search_tool_LDADD = \
+	$(GNOME_UTILS_LIBS)		\
+	$(GTK2_LIBS)			\
+	$(GIO_UNIX_LIBS)		\
+	$(libgnomeui_deprecated_LIB)	\
 	$(libeggsmclient_LIB)
 
 man_MANS = gnome-search-tool.1
diff --git a/gsearchtool/libgnomeui-deprecated/Makefile.am b/gsearchtool/libgnomeui-deprecated/Makefile.am
index 68c8844..7c3c9b7 100644
--- a/gsearchtool/libgnomeui-deprecated/Makefile.am
+++ b/gsearchtool/libgnomeui-deprecated/Makefile.am
@@ -1,12 +1,21 @@
-INCLUDES = -DGTK_DISABLE_DEPRECATED \
-           -DGDK_DISABLE_DEPRECATED \
-           -DG_DISABLE_DEPRECATED
-
+INCLUDES = \
+	-DGTK_DISABLE_DEPRECATED	\
+	-DGDK_DISABLE_DEPRECATED	\
+	-DG_DISABLE_DEPRECATED
 
 noinst_LTLIBRARIES = libgnomeui-deprecated.la
 
-libgnomeui_deprecated_la_LIBADD = $(GNOME_UTILS_LIBS)
-libgnomeui_deprecated_la_CFLAGS = $(GNOME_UTILS_CFLAGS) \
-                                  $(WARN_CFLAGS)
-libgnomeui_deprecated_la_SOURCES = gsearchtool-entry.h \
-                                   gsearchtool-entry.c
+libgnomeui_deprecated_la_CFLAGS = \
+	$(GLIB_CFLAGS)			\
+	$(GTK2_CFLAGS)			\
+	$(GCONF_CFLAGS)			\
+	$(WARN_CFLAGS)
+
+libgnomeui_deprecated_la_LIBADD = \
+	$(GLIB_LIBS)			\
+	$(GTK2_LIBS)			\
+	$(GCONF_LIBS)
+
+libgnomeui_deprecated_la_SOURCES = \
+	gsearchtool-entry.h	\
+	gsearchtool-entry.c
diff --git a/logview/Makefile.am b/logview/Makefile.am
index b1474f5..dc9720e 100644
--- a/logview/Makefile.am
+++ b/logview/Makefile.am
@@ -1,8 +1,6 @@
 SUBDIRS = data help tests
 
 INCLUDES = \
-	$(GNOME_UTILS_CFLAGS)					\
-	$(GTHREAD_CFLAGS)					\
 	-DG_LOG_DOMAIN=\"gnome-system-log\"			\
 	-DGNOMELOCALEDIR=\""$(prefix)/$(DATADIRNAME)/locale"\"	\
 	-DDATADIR=\""$(datadir)"\"				\
@@ -42,9 +40,20 @@ gnome_system_log_SOURCES = 	\
 	logview-filter-manager.c  \
 	$(BUILT_SOURCES)
 
+gnome_system_log_CFLAGS =	\
+	$(GLIB_CFLAGS)		\
+	$(GTHREAD_CFLAGS)	\
+	$(GIO_CFLAGS)		\
+	$(GTK2_CFLAGS)		\
+	$(GCONF_CFLAGS)		\
+	$(NULL)
+
 gnome_system_log_LDADD =	\
-	$(GNOME_UTILS_LIBS)	\
+	$(GLIB_LIBS)		\
+	$(GIO_LIBS)		\
 	$(GTHREAD_LIBS)		\
+	$(GTK2_LIBS)		\
+	$(GCONF_LIBS)		\
 	$(Z_LIBS)		\
 	-lm
 
diff --git a/logview/tests/Makefile.am b/logview/tests/Makefile.am
index 1549296..916d678 100644
--- a/logview/tests/Makefile.am
+++ b/logview/tests/Makefile.am
@@ -1,8 +1,20 @@
 INCLUDES = \
-	$(GNOME_UTILS_CFLAGS) \
 	-I../
 
 noinst_PROGRAMS = test-reader
 
-test_reader_SOURCES = test-reader.c ../logview-log.c ../logview-utils.c
-test_reader_LDADD = $(GNOME_UTILS_LIBS) $(Z_LIBS) -lm
+test_reader_SOURCES = \
+	test-reader.c		\
+	../logview-log.c	\
+	../logview-utils.c
+
+test_reader_CFLAGS = \
+	$(GLIB_CFLAGS)		\
+	$(GIO_CFLAGS)		\
+	$(NULL)
+
+test_reader_LDADD = \
+	$(GLIB_LIBS)		\
+	$(GIO_LIBS)		\
+	$(Z_LIBS)		\
+	-lm



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]