Index: configure.in
===================================================================
RCS file: /cvs/gnome/seahorse/configure.in,v
retrieving revision 1.107
diff -u -d -b -w -r1.107 configure.in
--- configure.in	9 Jun 2006 14:57:42 -0000	1.107
+++ configure.in	25 Jun 2006 20:44:58 -0000
@@ -477,6 +477,56 @@
     AC_SUBST(LIBCRYPTUI_LIBS)
 fi
 
+dnl ****************************************************************************
+dnl GAIM
+dnl ****************************************************************************
+
+with_gaim_plugin="no"
+
+if test "$enable_dbus" != "yes"; then
+    echo "disabling gaim plugin: no dbus support"
+    
+else
+    # Allow gaim plugin to be disabled
+    AC_ARG_ENABLE(gaim, 
+                  AC_HELP_STRING([--disable-gaim],
+                  [Don't compile gaim plugin]))
+    
+    # Gaim and Libebook tests
+    if test "$enable_gaim" = "no"; then
+        echo "disabling gaim plugin..."
+        
+    else
+        enable_gaim=yes
+        echo "enabling gaim plugin..."
+        echo "checking for supported versions of gaim..."
+        
+        PKG_CHECK_MODULES(GAIM, gaim >= 2.0.0beta3, [have_gaim=yes], [enable_gaim=no])
+        
+        echo "checking for supported versions of libebook..."
+        
+        PKG_CHECK_MODULES(EVOLUTION_ADDRESSBOOK, libebook-1.2 libedata-book-1.2, [have_libebook=yes],[enable_gaim=no])
+        
+        
+        
+        if test "$have_gaim" = "yes" && 
+           test "$have_libebook" = "yes"; then
+            
+            with_gaim_plugin=yes
+            
+            AC_SUBST(GAIM_CFLAGS)
+            AC_SUBST(EVOLUTION_ADDRESSBOOK_CFLAGS)
+        	AC_SUBST(EVOLUTION_ADDRESSBOOK_LIBS)
+	
+            GAIM_DATADIR=`pkg-config --variable=datadir gaim`
+            AC_SUBST(GAIM_DATADIR)
+        else
+            echo "disabling gaim plugin..."
+        fi
+    fi
+fi
+
+AM_CONDITIONAL(WITH_GAIM, test "$enable_gaim" = "yes")
 
 dnl ****************************************************************************
 dnl GEDIT
@@ -719,6 +769,7 @@
 plugins/nautilus/Makefile
 plugins/nautilus-ext/Makefile
 plugins/gedit/Makefile
+plugins/gaim/Makefile
 ])
 
 dnl ****************************************************************************
@@ -736,6 +787,7 @@
   gnome-keyring:         $enable_gnome_keyring
 Plugins/DBUS Support:    $enable_dbus
   libcryptui:            $enable_dbus
+  Gaim:                  $with_gaim_plugin
   GEdit (v <= 2.12):     $with_gedit_bonobo
   GEdit (v >= 2.14):     $with_gedit_plugin
   Panel Applet:          $with_panel_applet
Index: plugins/Makefile.am
===================================================================
RCS file: /cvs/gnome/seahorse/plugins/Makefile.am,v
retrieving revision 1.4
diff -u -d -b -w -r1.4 Makefile.am
--- plugins/Makefile.am	24 Dec 2005 00:24:28 -0000	1.4
+++ plugins/Makefile.am	25 Jun 2006 20:44:58 -0000
@@ -17,4 +17,11 @@
 APPLET_DIR =
 endif
 
-SUBDIRS = nautilus $(APPLET_DIR) $(GEDIT_DIR) $(NAUTILUS_EXT_DIR)
+if WITH_GAIM
+GAIM_DIR = gaim
+else
+GAIM = 
+endif
+
+SUBDIRS = nautilus $(APPLET_DIR) $(GAIM_DIR) $(GEDIT_DIR) $(NAUTILUS_EXT_DIR) 
+
