commit a27184b262c60a949da619613ebbe22af2fa127c
Author: Frédéric Péters <fpeters@0d.be>
Date:   Sat Aug 28 09:54:04 2010 +0200

    Check for gcr-1 when building against GTK+ 3 (GNOME bug 628092)

diff --git a/configure.ac b/configure.ac
index 48dd5ea..6a7ea46 100644
--- a/configure.ac
+++ b/configure.ac
@@ -151,7 +151,6 @@ PKG_CHECK_MODULES(EMPATHY,
    folks >= $FOLKS_REQUIRED
    folks-telepathy >= $FOLKS_REQUIRED
    gconf-2.0 >= $GCONF_REQUIRED
-   gcr-0 >= $KEYRING_REQUIRED
    gio-2.0 >= $GLIB_REQUIRED
    gio-unix-2.0 >= $GLIB_REQUIRED
    gnome-keyring-1 >= $KEYRING_REQUIRED
@@ -205,6 +204,10 @@ if test "x$have_gtk3" == "xyes"; then
    PKG_CHECK_MODULES(CANBERRA, libcanberra-gtk3 >= $LIBCANBERRA_GTK_REQUIRED)
    PKG_CHECK_MODULES(LIBNOTIFY, libnotify >= $LIBNOTIFY_REQUIRED_GTK3)
    PKG_CHECK_MODULES(UNIQUE, unique-3.0 >= $UNIQUE_REQUIRED)
+   # gcr-1 doesn't exist at the moment, and could even be named differently
+   # once it exists, but checking for it makes sure configure abort, instead
+   # of allowing to build an empathy binary linked to both GTK+ 2 and 3.
+   PKG_CHECK_MODULES(GCR, gcr-1 >= $KEYRING_REQUIRED)
 else
    PKG_CHECK_MODULES(GTK, gtk+-2.0 >= $GTK_REQUIRED)
 
@@ -212,6 +215,7 @@ else
    PKG_CHECK_MODULES(CANBERRA, libcanberra-gtk >= $LIBCANBERRA_GTK_REQUIRED)
    PKG_CHECK_MODULES(LIBNOTIFY, libnotify >= $LIBNOTIFY_REQUIRED)
    PKG_CHECK_MODULES(UNIQUE, unique-1.0 >= $UNIQUE_REQUIRED)
+   PKG_CHECK_MODULES(GCR, gcr-0 >= $KEYRING_REQUIRED)
 
    # Enable GSEAL checks if needed
    if test $USE_MAINTAINER_MODE = yes; then
diff --git a/libempathy-gtk/Makefile.am b/libempathy-gtk/Makefile.am
index d81b972..1cc6553 100644
--- a/libempathy-gtk/Makefile.am
+++ b/libempathy-gtk/Makefile.am
@@ -14,6 +14,7 @@ AM_CPPFLAGS =                                           \
 	$(ENCHANT_CFLAGS)				\
 	$(LIBCHAMPLAIN_CFLAGS)				\
 	$(GEOCLUE_CFLAGS)				\
+	$(GCR_CFLAGS)					\
 	$(MEEGO_CFLAGS)				\
 	$(WEBKIT_CFLAGS)				\
 	$(WARN_CFLAGS)					\
@@ -170,6 +171,7 @@ libempathy_gtk_la_LIBADD =			\
 	$(ENCHANT_LIBS)				\
 	$(LIBCHAMPLAIN_LIBS)			\
 	$(GEOCLUE_LIBS)				\
+	$(GCR_LIBS)				\
 	$(MEEGO_LIBS)				\
 	$(WEBKIT_LIBS)				\
 	$(top_builddir)/libempathy/libempathy.la
