[evolution] Use version 3.0 for evolution-<module>.pc files while compiling with gtk3. Set dependencies right be



commit d852bddc484166a06dc1bdd8ff362179e51f5a52
Author: Chenthill Palanisamy <pchenthill novell com>
Date:   Tue Jun 29 18:50:43 2010 +0530

    Use version 3.0 for evolution-<module>.pc files while compiling with gtk3. Set dependencies right between gtk3 and gtk2 compilations

 Makefile.am            |   13 ++++++
 configure.ac           |  109 ++++++++++++++++++++++++++++++++++--------------
 evolution-plugin.pc.in |    2 +-
 evolution-shell.pc.in  |    2 +-
 4 files changed, 93 insertions(+), 33 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index a69c686..03870ac 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,11 +1,24 @@
 ACLOCAL_AMFLAGS=-I m4
 
 pkgconfigdir = $(libdir)/pkgconfig
+INTERFACE_VERSION=3.0
+
+if ENABLE_GTK3
+%-$(INTERFACE_VERSION).pc: %.pc
+	 cp $< $@
+
+pkgconfig_DATA = 					\
+	evolution-calendar-$(INTERFACE_VERSION).pc	\
+	evolution-mail-$(INTERFACE_VERSION).pc		\
+	evolution-plugin-$(INTERFACE_VERSION).pc	\
+	evolution-shell-$(INTERFACE_VERSION).pc
+else
 pkgconfig_DATA = 				\
 	evolution-calendar.pc			\
 	evolution-mail.pc			\
 	evolution-plugin.pc			\
 	evolution-shell.pc
+endif	
 
 EXTRA_DIST = 			\
 	AUTHORS			\
diff --git a/configure.ac b/configure.ac
index 75b1c47..d2de077 100644
--- a/configure.ac
+++ b/configure.ac
@@ -38,29 +38,14 @@ dnl Required Packages
 m4_define([glib_minimum_version], [2.22.0])
 m4_define([eds_minimum_version], [evo_version])
 m4_define([gnome_icon_theme_minimum_version], [2.19.91])
-m4_define([gnome_desktop_minimum_version], [2.26.0])
-m4_define([libgtkhtml_minimum_version], [3.31.2])
-m4_define([gail_minimum_version], [1.9.0])		dnl For libgnomecanvas
 m4_define([pangoft2_minimum_version], [1.0.1])		dnl For libgnomecanvas
 m4_define([gconf_minimum_version], [2.0.0])		dnl XXX Just a Guess
 m4_define([libsoup_minimum_version], [2.4.0])		dnl XXX Just a Guess
 m4_define([libxml_minimum_version], [2.7.3])
 m4_define([shared_mime_info_minimum_version], [0.22])
 m4_define([libpst_minimum_version], [0.6.41])
-m4_define([unique_minimum_version], [1.1.2])
 m4_define([dbus_glib_minimum_version], [0.74])
 
-dnl **********************************
-dnl GTK version
-dnl **********************************
-if $PKG_CONFIG --exists gtk+-3.0; then
-	GTK_PACKAGE="gtk+-3.0"
-	gtk_minimum_version="2.90.5"
-else	
-	GTK_PACKAGE="gtk+-2.0"
-	gtk_minimum_version="2.20.0"
-fi
-
 dnl Optional Packages
 m4_define([nm_minimum_version],[0.7])
 m4_define([champlain_minimum_version], [0.4])
@@ -71,6 +56,68 @@ m4_define([gweather_minimum_version], [2.25.3])
 m4_define([gtkimageview_minimum_version], [1.6])
 m4_define([gladeui_minimum_version], [3.0.0])
 
+	
+dnl **********************************
+dnl Gtk-3 compatibility
+dnl **********************************
+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
+	LIBEDATASERVERUI="libedataserverui-3.0"
+	GTK="gtk+-3.0"
+	gtk_minimum_version="2.90.5"
+
+	GAIL="gail-3.0"
+	gail_minimum_version="2.90.5"
+
+	UNIQUE="unique-3.0"
+	unique_minimum_version="2.90"
+
+	GNOME_DESKTOP="gnome-desktop-3.0"
+	gnome_desktop_minimum_version="2.90"
+
+	CANBERRA_GTK="libcanberra-gtk3"
+	libcanberra_gtk_minimum_version="0.25"
+
+	GTKHTML="libgtkhtml-4.0"
+	libgtkhtml_minimum_version="3.31.4"
+
+	GTKHTML_EDITOR="gtkhtml-editor-4.0"
+else	
+	LIBEDATASERVERUI="libedataserverui-1.2"
+	
+	GTK="gtk+-2.0"
+	gtk_minimum_version="2.20.0"
+
+	GAIL="gail"
+	gail_minimum_version="1.9.0"
+
+	UNIQUE="unique-1.0"
+	unique_minimum_version="1.1.2"
+
+	GNOME_DESKTOP="gnome-desktop-2.0"
+	gnome_desktop_minimum_version="2.26.0"
+	
+	CANBERRA_GTK="libcanberra-gtk"
+	libcanberra_gtk_minimum_version="0"
+	
+	GTKHTML="libgtkhtml-3.14"
+	libgtkhtml_minimum_version="3.31.2"
+
+	GTKHTML_EDITOR="gtkhtml-editor-4.0"
+fi
+
+AC_SUBST(GTKHTML_EDITOR)
+AC_SUBST(GTK)
+AC_SUBT(GTKHTML)
+AC_SUBST(UNIQUE)
+AC_SUBST(GNOME_DESKTOP)
+AC_SUBST(LIBEDATASERVERUI)
+AM_CONDITIONAL([ENABLE_GTK3], [test "$enable_gtk3" = yes])
+
 dnl ******************************
 dnl Compiler Warning Flags
 dnl ******************************
@@ -230,14 +277,14 @@ dnl **********************************
 PKG_CHECK_MODULES([GNOME_PLATFORM],
 	[glib-2.0 >= glib_minimum_version
 	 gthread-2.0 >= glib_minimum_version
-	 $GTK_PACKAGE >= $gtk_minimum_version
-	 gail >= gail_minimum_version
+	 $GTK >= $gtk_minimum_version
+	 $GAIL >= $gail_minimum_version
 	 gconf-2.0 >= gconf_minimum_version
 	 libxml-2.0 >= libxml_minimum_version
 	 pangoft2 >= pangoft2_minimum_version
 	 shared-mime-info >= shared_mime_info_minimum_version
-	 gnome-desktop-2.0 >= gnome_desktop_minimum_version
-	 unique-1.0 >= unique_minimum_version])
+	 $GNOME_DESKTOP >= $gnome_desktop_minimum_version
+	 $UNIQUE >= $unique_minimum_version])
 AC_SUBST(GNOME_PLATFORM_CFLAGS)
 AC_SUBST(GNOME_PLATFORM_LIBS)
 
@@ -245,7 +292,7 @@ PKG_CHECK_MODULES([EVOLUTION_DATA_SERVER],
 	[libebook-1.2 >= eds_minimum_version
 	 libecal-1.2 >= eds_minimum_version
 	 libedataserver-1.2 >= eds_minimum_version
-	 libedataserverui-1.2 >= eds_minimum_version
+	 $LIBEDATASERVERUI >= eds_minimum_version
 	 libegroupwise-1.2 >= eds_minimum_version
 	 libebackend-1.2 >= eds_minimum_version])
 
@@ -259,7 +306,7 @@ AC_ARG_ENABLE([canberra],
 	[enable_canberra="$enableval"], [enable_canberra=yes])
 
 if test $enable_canberra = yes; then
-	PKG_CHECK_MODULES([CANBERRA],[libcanberra-gtk])
+	PKG_CHECK_MODULES([CANBERRA],[$CANBERRA_GTK >= $libcanberra_gtk_minimum_version])
 	AC_DEFINE(HAVE_CANBERRA, 1, [Define if using Canberra and Canberra-GTK for sound])
 fi
 AC_SUBST(CANBERRA_CFLAGS)
@@ -652,7 +699,7 @@ dnl *************************
 dnl GTKHTML check
 dnl XXX Drop the version from the package name?
 dnl *************************
-PKG_CHECK_MODULES([GTKHTML], [libgtkhtml-3.14 >= libgtkhtml_minimum_version])
+PKG_CHECK_MODULES([GTKHTML], [$GTKHTML >= $libgtkhtml_minimum_version])
 AC_SUBST(GTKHTML_CFLAGS)
 AC_SUBST(GTKHTML_LIBS)
 
@@ -1187,7 +1234,7 @@ dnl (which are dragged in through libedataserverui), as both
 dnl gnutls and mozilla-nss have a header called "pkcs12.h" which is
 dnl included in smime/lib/e-pkcs12.c. It wants the Mozilla NSS one.
 dnl
-EVO_SET_COMPILE_FLAGS(CERT_UI, libedataserverui-1.2 gthread-2.0)
+EVO_SET_COMPILE_FLAGS(CERT_UI, $LIBEDATASERVERUI gthread-2.0)
 CERT_UI_CFLAGS="$MANUAL_NSS_CFLAGS $MOZILLA_NSS_CFLAGS $CERT_UI_CFLAGS"
 CERT_UI_LIBS="$MOZILLA_L_DIR $MANUAL_NSS_LIBS $MOZILLA_NSS_LIBS $CERT_UI_LIBS"
 AC_SUBST(CERT_UI_CFLAGS)
@@ -1196,7 +1243,7 @@ AC_SUBST(CERT_UI_LIBS)
 dnl ************
 dnl E_UTIL Flags
 dnl ************
-EVO_SET_COMPILE_FLAGS(E_UTIL, libedataserverui-1.2 camel-1.2 $mozilla_nspr, $MANUAL_NSPR_CFLAGS $MANUAL_NSPR_LIBS)
+EVO_SET_COMPILE_FLAGS(E_UTIL, $LIBEDATASERVERUI camel-1.2 $mozilla_nspr, $MANUAL_NSPR_CFLAGS $MANUAL_NSPR_LIBS)
 AC_SUBST(E_UTIL_CFLAGS)
 AC_SUBST(E_UTIL_LIBS)
 
@@ -1212,14 +1259,14 @@ AC_SUBST(TZDIALOG_LIBS)
 dnl ***************
 dnl E_WIDGETS Flags
 dnl ***************
-EVO_SET_COMPILE_FLAGS(E_WIDGETS, libedataserverui-1.2 gtkhtml-editor)
+EVO_SET_COMPILE_FLAGS(E_WIDGETS, $LIBEDATASERVERUI $GTKHTML_EDITOR)
 AC_SUBST(E_WIDGETS_CFLAGS)
 AC_SUBST(E_WIDGETS_LIBS)
 
 dnl ***************
 dnl IMPORTERS Flags
 dnl ***************
-EVO_SET_COMPILE_FLAGS(IMPORTERS, libedataserverui-1.2 camel-provider-1.2 libebook-1.2)
+EVO_SET_COMPILE_FLAGS(IMPORTERS, $LIBEDATASERVERUI camel-provider-1.2 libebook-1.2)
 AC_SUBST(IMPORTERS_CFLAGS)
 AC_SUBST(IMPORTERS_LIBS)
 
@@ -1233,14 +1280,14 @@ AC_SUBST(LIBFILTER_LIBS)
 dnl ***********
 dnl Shell Flags
 dnl ***********
-EVO_SET_COMPILE_FLAGS(SHELL, libgtkhtml-3.14 libedataserverui-1.2)
+EVO_SET_COMPILE_FLAGS(SHELL, $GTKHTML $LIBEDATASERVERUI)
 AC_SUBST(SHELL_CFLAGS)
 AC_SUBST(SHELL_LIBS)
 
 dnl *****************
 dnl Addressbook Flags
 dnl *****************
-EVOLUTION_ADDRESSBOOK_DEPS="libgtkhtml-3.14 libebook-1.2 libedataserverui-1.2 camel-1.2 gtkhtml-editor"
+EVOLUTION_ADDRESSBOOK_DEPS="$GTKHTML libebook-1.2 $LIBEDATASERVERUI camel-1.2 $GTKHTML_EDITOR"
 EVO_SET_COMPILE_FLAGS(EVOLUTION_ADDRESSBOOK, $EVOLUTION_ADDRESSBOOK_DEPS)
 AC_SUBST(EVOLUTION_ADDRESSBOOK_CFLAGS)
 AC_SUBST(EVOLUTION_ADDRESSBOOK_LIBS)
@@ -1271,14 +1318,14 @@ EVO_SET_COMPILE_FLAGS(GDATA, libgdata >= 0.4.0)
 AC_SUBST(GDATA_CFLAGS)
 AC_SUBST(GDATA_LIBS)
 
-EVO_SET_COMPILE_FLAGS(EVOLUTION_CALENDAR, libgtkhtml-3.14 libebook-1.2 libecal-1.2 libedataserverui-1.2 libebackend-1.2 $libnotify gtkhtml-editor)
+EVO_SET_COMPILE_FLAGS(EVOLUTION_CALENDAR, $GTKHTML libebook-1.2 libecal-1.2 $LIBEDATASERVERUI libebackend-1.2 $libnotify $GTKHTML_EDITOR)
 AC_SUBST(EVOLUTION_CALENDAR_CFLAGS)
 AC_SUBST(EVOLUTION_CALENDAR_LIBS)
 
 dnl **********
 dnl Mail Flags
 dnl **********
-EVO_SET_COMPILE_FLAGS(EVOLUTION_MAIL, camel-provider-1.2 libgtkhtml-3.14 gtkhtml-editor $mozilla_nss libebook-1.2 libedataserverui-1.2)
+EVO_SET_COMPILE_FLAGS(EVOLUTION_MAIL, camel-provider-1.2 $GTKHTML $GTKHTML_EDITOR $mozilla_nss libebook-1.2 $LIBEDATASERVERUI)
 AC_SUBST(EVOLUTION_MAIL_CFLAGS)
 AC_SUBST(EVOLUTION_MAIL_LIBS)
 
@@ -1291,7 +1338,7 @@ AC_SUBST(DATASERVER_EXEC_VERSION)
 dnl *****************
 dnl EggSMClient Flags
 dnl *****************
-EVO_SET_COMPILE_FLAGS(EGG_SMCLIENT, gtk+-2.0)
+EVO_SET_COMPILE_FLAGS(EGG_SMCLIENT, $GTK)
 AC_SUBST(EGG_SMCLIENT_CFLAGS)
 AC_SUBST(EGG_SMCLIENT_LIBS)
 
diff --git a/evolution-plugin.pc.in b/evolution-plugin.pc.in
index cab9c43..889bcb4 100644
--- a/evolution-plugin.pc.in
+++ b/evolution-plugin.pc.in
@@ -15,6 +15,6 @@ errordir= privdatadir@/errors
 Name: evolution-plugin
 Description: libraries needed for Evolution plugin development
 Version: @VERSION@
-Requires: camel-provider-1.2 libxml-2.0 unique-1.0 libgtkhtml-3.14 gtkhtml-editor
+Requires: camel-provider-1.2 libxml-2.0 @UNIQUE@ @GTKHTML@ @GTKHTML@
 Libs: -L${privlibdir} -leutil -Wl,-R${privlibdir}
 Cflags: -I${privincludedir}
diff --git a/evolution-shell.pc.in b/evolution-shell.pc.in
index aced79e..5242ad2 100644
--- a/evolution-shell.pc.in
+++ b/evolution-shell.pc.in
@@ -17,6 +17,6 @@ execversion= BASE_VERSION@
 Name: evolution-shell
 Description: libraries needed for Evolution shell components
 Version: @VERSION@
-Requires: gconf-2.0 gnome-desktop-2.0 gtk+-2.0 libedataserverui-1.2 unique-1.0
+Requires: gconf-2.0 @GNOME_DESKTOP@ @GTK@ @LIBEDATASERVERUI@ @UNIQUE@
 Libs: -L${privlibdir} -leshell -Wl,-R${privlibdir}
 Cflags: -I${privincludedir}



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