[evolution-data-server] Update libedataserverui versioning for gtk3. 3.0 should build gtk3 and 1.2 with gtk2



commit 6acd6c419b8288b370f9b0d31a024d31ae1f736a
Author: Chenthill Palanisamy <pchenthill novell com>
Date:   Tue Jun 29 17:35:09 2010 +0530

    Update libedataserverui versioning for gtk3. 3.0 should build gtk3 and 1.2 with gtk2

 configure.ac                            |   26 +++++++++++++++++++++++---
 libedataserverui/Makefile.am            |   31 +++++++++++++++++++++++--------
 libedataserverui/libedataserverui.pc.in |    2 +-
 3 files changed, 47 insertions(+), 12 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 96f1059..0225084 100644
--- a/configure.ac
+++ b/configure.ac
@@ -44,18 +44,31 @@ m4_define([libical_minimum_version], [0.43])
 m4_define([dbus_glib_minimum_version], [0.6])
 
 dnl **********************************
-dnl GTK version
+dnl Gtk-3 compatibility
+dnl Use the API version 3.0 while compiling with gtk+-3
 dnl **********************************
-if $PKG_CONFIG --exists gtk+-3.0; then
+AC_ARG_ENABLE([gtk3],
+	AS_HELP_STRING([--enable-gtk3],
+	[Attempt to use gtk+-3]),
+	[enable_gtk3=$enableval],[enable_gtk3=no])
+
+if test "x${enable_gtk3}" = "xyes"; then
+	LIBEDATASERVER_UI_API_VERSION=3.0
 	GTK_PACKAGE="gtk+-3.0"
 	gtk_minimum_version="2.90.5"
 else	
+	LIBEDATASERVER_UI_API_VERSION=1.2
 	GTK_PACKAGE="gtk+-2.0"
 	gtk_minimum_version="2.20.0"
 fi
 
+AM_CONDITIONAL([ENABLE_GTK3], [test "$enable_gtk3" = yes])
+GTK_MODULE="$GTK_PACKAGE >= $gtk_minimum_version"
+AC_SUBST(GTK_MODULE)
+
 AC_SUBST([BASE_VERSION],[base_version])
 AC_SUBST([API_VERSION],[api_version])
+AC_SUBST(LIBEDATASERVER_UI_API_VERSION)
 AC_DEFINE_UNQUOTED(BASE_VERSION, ["$BASE_VERSION"], [Base version (Major.Minor)])
 AC_DEFINE_UNQUOTED(API_VERSION, ["$API_VERSION"], [API version (Major.Minor)])
 
@@ -74,6 +87,10 @@ LIBEDATASERVERUI_CURRENT=10
 LIBEDATASERVERUI_REVISION=0
 LIBEDATASERVERUI_AGE=0
 
+LIBEDATASERVERUI_GTK3_CURRENT=0
+LIBEDATASERVERUI_GTK3_REVISION=0
+LIBEDATASERVERUI_GTK3_AGE=0
+
 LIBECAL_CURRENT=9
 LIBECAL_REVISION=2
 LIBECAL_AGE=2
@@ -111,6 +128,9 @@ AC_SUBST(LIBEDATASERVER_AGE)
 AC_SUBST(LIBEDATASERVERUI_CURRENT)
 AC_SUBST(LIBEDATASERVERUI_REVISION)
 AC_SUBST(LIBEDATASERVERUI_AGE)
+AC_SUBST(LIBEDATASERVERUI_GTK3_CURRENT)
+AC_SUBST(LIBEDATASERVERUI_GTK3_REVISION)
+AC_SUBST(LIBEDATASERVERUI_GTK3_AGE)
 AC_SUBST(LIBECAL_CURRENT)
 AC_SUBST(LIBECAL_REVISION)
 AC_SUBST(LIBECAL_AGE)
@@ -289,7 +309,7 @@ dnl Check for base dependencies early.
 dnl ***********************************
 PKG_CHECK_MODULES(GNOME_PLATFORM,
 	[glib-2.0 >= glib_minimum_version
-	$GTK_PACKAGE >= $gtk_minimum_version
+	$GTK_MODULE
 	gconf-2.0 >= gconf_minimum_version
 	libxml-2.0 >= libxml_minimum_version
 	libsoup-2.4 >= libsoup_minimum_version
diff --git a/libedataserverui/Makefile.am b/libedataserverui/Makefile.am
index c3f405c..e1299ff 100644
--- a/libedataserverui/Makefile.am
+++ b/libedataserverui/Makefile.am
@@ -2,8 +2,6 @@
 MARSHAL_GENERATED = e-data-server-ui-marshal.c e-data-server-ui-marshal.h
 @EVO_MARSHAL_RULE@
 
-lib_LTLIBRARIES = libedataserverui-1.2.la
-
 noinst_PROGRAMS = 			\
 	test-category-completion	\
 	test-source-combo-box		\
@@ -11,7 +9,7 @@ noinst_PROGRAMS = 			\
 	test-contact-store		\
 	test-name-selector
 
-libedataserverui_1_2_la_CPPFLAGS = \
+CPPFLAGS = \
 	$(AM_CPPFLAGS)				\
 	-I$(top_srcdir)				\
 	-I$(top_srcdir)/addressbook		\
@@ -21,7 +19,7 @@ libedataserverui_1_2_la_CPPFLAGS = \
 	$(E_DATA_SERVER_UI_CFLAGS)		\
 	$(CAMEL_CFLAGS)
 
-libedataserverui_1_2_la_SOURCES =	\
+csources =				\
 	$(MARSHAL_GENERATED)		\
 	e-categories-dialog.c		\
 	e-category-completion.c		\
@@ -41,15 +39,32 @@ libedataserverui_1_2_la_SOURCES =	\
 	e-cell-renderer-color.c		\
 	gtk-compat.h
 
+
+if ENABLE_GTK3
+lib_LTLIBRARIES = libedataserverui-3.0.la
+libedataserverui_3_0_la_CPPFLAGS = $(CPPFLAGS)
+libedataserverui_3_0_la_SOURCES = $(csources)	
+libedataserverui_3_0_la_LIBADD = 				\
+	$(top_builddir)/addressbook/libebook/libebook-1.2.la	\
+	$(top_builddir)/libedataserver/libedataserver-1.2.la	\
+	$(top_builddir)/camel/libcamel-1.2.la			\
+	$(E_DATA_SERVER_UI_LIBS)				\
+	$(CAMEL_LIBS)
+libedataserverui_3_0_la_LDFLAGS = 										\
+	-version-info $(LIBEDATASERVERUI_GTK3_CURRENT):$(LIBEDATASERVERUI_GTK3_REVISION):$(LIBEDATASERVERUI_GTK3_AGE) $(NO_UNDEFINED)
+else
+lib_LTLIBRARIES = libedataserverui-1.2.la
+libedataserverui_1_2_la_CPPFLAGS = $(CPPFLAGS)
+libedataserverui_1_2_la_SOURCES = $(csources)	
 libedataserverui_1_2_la_LIBADD = 				\
 	$(top_builddir)/addressbook/libebook/libebook-1.2.la	\
 	$(top_builddir)/libedataserver/libedataserver-1.2.la	\
 	$(top_builddir)/camel/libcamel-1.2.la			\
 	$(E_DATA_SERVER_UI_LIBS)				\
 	$(CAMEL_LIBS)
-
 libedataserverui_1_2_la_LDFLAGS = 										\
 	-version-info $(LIBEDATASERVERUI_CURRENT):$(LIBEDATASERVERUI_REVISION):$(LIBEDATASERVERUI_AGE) $(NO_UNDEFINED)
+endif
 
 libedataserveruiincludedir = $(privincludedir)/libedataserverui
 
@@ -107,11 +122,11 @@ test_name_selector_CPPFLAGS = $(TEST_EDATASERVERUI_CPPFLAGS)
 test_name_selector_SOURCES = test-name-selector.c
 test_name_selector_LDADD = $(TEST_EDATASERVERUI_LDFLAGS)
 
-%-$(API_VERSION).pc: %.pc
+%-$(LIBEDATASERVER_UI_API_VERSION).pc: %.pc
 	 cp $< $@
 
 pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = libedataserverui-$(API_VERSION).pc
+pkgconfig_DATA = libedataserverui-$(LIBEDATASERVER_UI_API_VERSION).pc
 
 ui_DATA = e-categories-dialog.ui e-name-selector-dialog.ui
 
@@ -120,7 +135,7 @@ BUILT_SOURCES = $(MARSHAL_GENERATED)
 EXTRA_DIST = 						\
 	$(ui_DATA)					\
 	e-data-server-ui-marshal.list			\
-	$(pkgconfig_DATA:-$(API_VERSION).pc=.pc.in)
+	$(pkgconfig_DATA:-$(LIBEDATASERVER_UI_API_VERSION).pc=.pc.in)
 
 CLEANFILES = $(BUILT_SOURCES)
 DISTCLEANFILES = $(pkgconfig_DATA)
diff --git a/libedataserverui/libedataserverui.pc.in b/libedataserverui/libedataserverui.pc.in
index c059dcb..7c40c20 100644
--- a/libedataserverui/libedataserverui.pc.in
+++ b/libedataserverui/libedataserverui.pc.in
@@ -8,6 +8,6 @@ privincludedir= privincludedir@
 Name: libedataserverui
 Description: GUI utility library for Evolution Data Server
 Version: @VERSION@
-Requires: gtk+-2.0 libedataserver- API_VERSION@ libebook- API_VERSION@
+Requires: @GTK_MODULE@ libedataserver- API_VERSION@ libebook- API_VERSION@
 Libs: -L${libdir} -ledataserverui-1.2
 Cflags: -I${privincludedir}



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