commit 741a1242d49601e5b27a098a7abf58915ba29b45
Author: Matthew Barnes <mbarnes@redhat.com>
Date:   Sun Aug 9 18:51:23 2009 -0400

    Initial patch to build against dbus-hybrid branch.

diff --git a/addressbook/Makefile.am b/addressbook/Makefile.am
index 8be9066..66af3ca 100644
--- a/addressbook/Makefile.am
+++ b/addressbook/Makefile.am
@@ -38,9 +38,9 @@ else
 	fi
 endif
 
-noinst_LTLIBRARIES = libexchangeaddressbook.la
+extension_LTLIBRARIES = libebookbackendexchange.la
 
-libexchangeaddressbook_la_SOURCES = \
+libebookbackendexchange_la_SOURCES = \
 	e-book-backend-exchange.c \
 	e-book-backend-exchange.h \
 	e-book-backend-exchange-factory.c \
@@ -51,14 +51,14 @@ libexchangeaddressbook_la_SOURCES = \
 	e-book-backend-gal.h
 
 if HAVE_LIBDB
-libexchangeaddressbook_la_SOURCES += \
+libebookbackendexchange_la_SOURCES += \
 	e-book-backend-db-cache.c \
 	e-book-backend-db-cache.h
 
-libexchangeaddressbook_la_LIBADD =  \
+libebookbackendexchange_la_LIBADD =  \
 	$(DB_LIBS)
 
-libexchangeaddressbook_la_LDFLAGS = \
+libebookbackendexchange_la_LDFLAGS = \
 	-module -avoid-version $(NO_UNDEFINED)
 endif
 
diff --git a/addressbook/e-book-backend-exchange-factory.c b/addressbook/e-book-backend-exchange-factory.c
index 3b8716a..c045ecc 100644
--- a/addressbook/e-book-backend-exchange-factory.c
+++ b/addressbook/e-book-backend-exchange-factory.c
@@ -24,53 +24,79 @@
 #include <pthread.h>
 #include <string.h>
 
+#include <libebackend/e-data-server-module.h>
 #include "e-book-backend-exchange-factory.h"
 #include "e-book-backend-exchange.h"
 
-static void
-e_book_backend_exchange_factory_instance_init (EBookBackendExchangeFactory *factory)
-{
-}
+static GType exchange_type;
 
 static const gchar *
-_get_protocol (EBookBackendFactory *factory)
+book_backend_exchange_factory_get_protocol (EBookBackendFactory *factory)
 {
 	return "exchange";
 }
 
 static EBookBackend*
-_new_backend (EBookBackendFactory *factory)
+book_backend_exchange_factory_new_backend (EBookBackendFactory *factory)
 {
 	return e_book_backend_exchange_new ();
 }
 
 static void
-e_book_backend_exchange_factory_class_init (EBookBackendExchangeFactoryClass *klass)
+book_backend_exchange_factory_class_init (EBookBackendExchangeFactoryClass *class)
 {
-  E_BOOK_BACKEND_FACTORY_CLASS (klass)->get_protocol = _get_protocol;
-  E_BOOK_BACKEND_FACTORY_CLASS (klass)->new_backend = _new_backend;
+	EBookBackendFactoryClass *factory_class;
+
+	factory_class = E_BOOK_BACKEND_FACTORY_CLASS (class);
+	factory_class->get_protocol = book_backend_exchange_factory_get_protocol;
+	factory_class->new_backend = book_backend_exchange_factory_new_backend;
 }
 
 GType
 e_book_backend_exchange_factory_get_type (void)
 {
-	static GType  type = 0;
-
-	if (!type) {
-		GTypeInfo info = {
-			sizeof (EBookBackendExchangeFactoryClass),
-			NULL, /* base_class_init */
-			NULL, /* base_class_finalize */
-			(GClassInitFunc)  e_book_backend_exchange_factory_class_init,
-			NULL, /* class_finalize */
-			NULL, /* class_data */
-			sizeof (EBookBackend),
-			0,    /* n_preallocs */
-			(GInstanceInitFunc) e_book_backend_exchange_factory_instance_init
-		};
-
-		type = g_type_register_static (E_TYPE_BOOK_BACKEND_FACTORY,
-					       "EBookBackendExchangeFactory", &info, 0);
-	}
-	return type;
+	return exchange_type;
+}
+
+void
+e_book_backend_exchange_factory_register_type (GTypeModule *type_module)
+{
+	static const GTypeInfo type_info = {
+		sizeof (EBookBackendExchangeFactoryClass),
+		(GBaseInitFunc) NULL,
+		(GBaseFinalizeFunc) NULL,
+		(GClassInitFunc)  book_backend_exchange_factory_class_init,
+		(GClassFinalizeFunc) NULL,
+		NULL,  /* class_data */
+		sizeof (EBookBackend),
+		0,     /* n_preallocs */
+		(GInstanceInitFunc) NULL,
+		NULL   /* value_table */
+	};
+
+	exchange_type = g_type_module_register_type (
+		type_module, E_TYPE_BOOK_BACKEND_FACTORY,
+		"EBookBackendExchangeFactory", &type_info, 0);
+}
+
+void
+eds_module_initialize (GTypeModule *type_module)
+{
+	e_book_backend_exchange_factory_register_type (type_module);
+}
+
+void
+eds_module_shutdown (void)
+{
+}
+
+void
+eds_module_list_types (const GType **types, gint *num_types)
+{
+	static GType module_types[1];
+
+	module_types[0] = E_TYPE_BOOK_BACKEND_EXCHANGE_FACTORY;
+
+	*types = module_types;
+	*num_types = G_N_ELEMENTS (module_types);
 }
diff --git a/addressbook/e-book-backend-exchange-factory.h b/addressbook/e-book-backend-exchange-factory.h
index 5ef97a4..8a56d64 100644
--- a/addressbook/e-book-backend-exchange-factory.h
+++ b/addressbook/e-book-backend-exchange-factory.h
@@ -26,24 +26,41 @@
 #include <glib-object.h>
 #include <libedata-book/e-book-backend-factory.h>
 
+/* Standard GObject macros */
+#define E_TYPE_BOOK_BACKEND_EXCHANGE_FACTORY \
+	(e_book_backend_exchange_factory_get_type ())
+#define E_BOOK_BACKEND_EXCHANGE_FACTORY(obj) \
+	(G_TYPE_CHECK_INSTANCE_CAST \
+	((obj), E_TYPE_BOOK_BACKEND_EXCHANGE_FACTORY, EBookBackendExchangeFactory))
+#define E_BOOK_BACKEND_EXCHANGE_FACTORY_CLASS(cls) \
+	(G_TYPE_CHECK_CLASS_CAST \
+	((cls), E_TYPE_BOOK_BACKEND_EXCHANGE_FACTORY, EBookBackendExchangeFactoryClass))
+#define E_IS_BOOK_BACKEND_EXCHANGE_FACTORY(obj) \
+	(G_TYPE_CHECK_INSTANCE_TYPE \
+	((obj), E_TYPE_BOOK_BACKEND_EXCHANGE_FACTORY))
+#define E_IS_BOOK_BACKEND_EXCHANGE_FACTORY_CLASS(cls) \
+	(G_TYPE_CHECK_CLASS_TYPE \
+	((cls), E_TYPE_BOOK_BACKEND_EXCHANGE_FACTORY))
+#define E_BOOK_BACKEND_EXCHANGE_FACTORY_GET_CLASS(cls) \
+	(G_TYPE_INSTANCE_GET_CLASS \
+	((obj), E_TYPE_BOOK_BACKEND_EXCHANGE_FACTORY, EBookBackendExchangeFactoryClass))
+
 G_BEGIN_DECLS
 
-#define E_TYPE_BOOK_BACKEND_EXCHANGE_FACTORY        (e_book_backend_exchange_factory_get_type ())
-#define E_BOOK_BACKEND_EXCHANGE_FACTORY(o)          (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TYPE_BOOK_BACKEND_EXCHANGE_FACTORY, EBookBackendExchangeFactory))
-#define E_BOOK_BACKEND_EXCHANGE_FACTORY_CLASS(k)    (G_TYPE_CHECK_CLASS_CAST((k), E_TYPE_BOOK_BACKEND_EXCHANGE_FACTORY, EBookBackendExchangeFactoryClass))
-#define E_IS_BOOK_BACKEND_EXCHANGE_FACTORY(o)       (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TYPE_BOOK_BACKEND_EXCHANGE_FACTORY))
-#define E_IS_BOOK_BACKEND_EXCHANGE_FACTORY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TYPE_BOOK_BACKEND_EXCHANGE_FACTORY))
-#define E_BOOK_BACKEND_EXCHANGE_FACTORY_GET_CLASS(k) (G_TYPE_INSTANCE_GET_CLASS ((obj), E_TYPE_BOOK_BACKEND_EXCHANGE_FACTORY, EBookBackendExchangeFactoryClass))
+typedef struct _EBookBackendExchangeFactory EBookBackendExchangeFactory;
+typedef struct _EBookBackendExchangeFactoryClass EBookBackendExchangeFactoryClass;
 
-typedef struct {
-	EBookBackendFactory            parent_object;
-} EBookBackendExchangeFactory;
+struct _EBookBackendExchangeFactory {
+	EBookBackendFactory parent;
+};
 
-typedef struct {
+struct _EBookBackendExchangeFactoryClass {
 	EBookBackendFactoryClass parent_class;
-} EBookBackendExchangeFactoryClass;
+};
 
-GType	e_book_backend_exchange_factory_get_type (void);
+GType		e_book_backend_exchange_factory_get_type (void);
+void		e_book_backend_exchange_factory_register_type
+						(GTypeModule *type_module);
 
 G_END_DECLS
 
diff --git a/addressbook/e-book-backend-exchange.c b/addressbook/e-book-backend-exchange.c
index 84cb973..e9ec5c4 100644
--- a/addressbook/e-book-backend-exchange.c
+++ b/addressbook/e-book-backend-exchange.c
@@ -33,7 +33,6 @@
 
 #include <libedataserver/e-sexp.h>
 #include <libedataserver/e-uid.h>
-#include <e-util/e-util.h>
 #include <libebook/e-address-western.h>
 #include <libebook/e-contact.h>
 #include <libedata-book/e-data-book.h>
diff --git a/calendar/Makefile.am b/calendar/Makefile.am
index 6bb7f64..270cf09 100644
--- a/calendar/Makefile.am
+++ b/calendar/Makefile.am
@@ -6,10 +6,10 @@ AM_CPPFLAGS = \
 	$(LDAP_CFLAGS) \
 	-DG_LOG_DOMAIN=\"e-cal-backend-exchange\"
 
-noinst_LTLIBRARIES = \
-        libexchangecalendar.la
+extension_LTLIBRARIES = \
+        libecalbackendexchange.la
 
-libexchangecalendar_la_SOURCES =  \
+libecalbackendexchange_la_SOURCES = \
 	e-cal-backend-exchange.c \
 	e-cal-backend-exchange.h \
 	e-cal-backend-exchange-calendar.c \
@@ -23,4 +23,7 @@ libexchangecalendar_la_SOURCES =  \
 	e2k-cal-utils.c \
 	e2k-cal-utils.h
 
+libecalbackendexchange_la_LDFLAGS = \
+	-module -avoid-version $(NO_UNDEFINED)
+
 -include $(top_srcdir)/git.mk
diff --git a/calendar/e-cal-backend-exchange-factory.c b/calendar/e-cal-backend-exchange-factory.c
index 3715e7c..62c0de5 100644
--- a/calendar/e-cal-backend-exchange-factory.c
+++ b/calendar/e-cal-backend-exchange-factory.c
@@ -24,14 +24,13 @@
 #include <pthread.h>
 #include <string.h>
 
+#include <libebackend/e-data-server-module.h>
 #include "e-cal-backend-exchange-factory.h"
 #include "e-cal-backend-exchange-calendar.h"
 #include "e-cal-backend-exchange-tasks.h"
 
-static void
-e_cal_backend_exchange_factory_instance_init (ECalBackendExchangeFactory *factory)
-{
-}
+static GType exchange_events_type;
+static GType exchange_todos_type;
 
 static const gchar *
 _get_protocol (ECalBackendFactory *factory)
@@ -84,51 +83,79 @@ events_backend_exchange_factory_class_init (ECalBackendExchangeFactoryClass *kla
 }
 
 GType
-events_backend_exchange_factory_get_type (void)
+e_cal_backend_exchange_events_factory_get_type (void)
+{
+	return exchange_events_type;
+}
+
+void
+e_cal_backend_exchange_events_factory_register_type (GTypeModule *type_module)
 {
-	static GType type = 0;
-
-	if (!type) {
-		GTypeInfo info = {
-			sizeof (ECalBackendExchangeFactoryClass),
-			NULL, /* base_class_init */
-			NULL, /* base_class_finalize */
-			(GClassInitFunc)  events_backend_exchange_factory_class_init,
-			NULL, /* class_finalize */
-			NULL, /* class_data */
-			sizeof (ECalBackend),
-			0,    /* n_preallocs */
-			(GInstanceInitFunc) e_cal_backend_exchange_factory_instance_init
-		};
-
-		type = g_type_register_static (E_TYPE_CAL_BACKEND_FACTORY,
-					       "ECalBackendExchangeEventsFactory",
-					       &info, 0);
-	}
-	return type;
+	static const GTypeInfo type_info = {
+		sizeof (ECalBackendExchangeFactoryClass),
+		(GBaseInitFunc) NULL,
+		(GBaseFinalizeFunc) NULL,
+		(GClassInitFunc) events_backend_exchange_factory_class_init,
+		(GClassFinalizeFunc) NULL,
+		NULL,  /* class_data */
+		sizeof (ECalBackendExchangeFactory),
+		0,     /* n_preallocs */
+		(GInstanceInitFunc) NULL,
+		NULL   /* value_table */
+	};
+
+	exchange_events_type = g_type_module_register_type (
+		type_module, E_TYPE_CAL_BACKEND_FACTORY,
+		"ECalBackendExchangeEventsFactory", &type_info, 0);
 }
 
 GType
-todos_backend_exchange_factory_get_type (void)
+e_cal_backend_exchange_todos_factory_get_type (void)
+{
+	return exchange_todos_type;
+}
+
+void
+e_cal_backend_exchange_todos_factory_register_type (GTypeModule *type_module)
+{
+	static const GTypeInfo type_info = {
+		sizeof (ECalBackendExchangeFactoryClass),
+		(GBaseInitFunc) NULL,
+		(GBaseFinalizeFunc) NULL,
+		(GClassInitFunc)  todos_backend_exchange_factory_class_init,
+		(GClassFinalizeFunc) NULL,
+		NULL,  /* class_data */
+		sizeof (ECalBackendExchangeFactory),
+		0,     /* n_preallocs */
+		(GInstanceInitFunc) NULL,
+		NULL   /* value_table */
+	};
+
+	exchange_todos_type = g_type_module_register_type (
+		type_module, E_TYPE_CAL_BACKEND_FACTORY,
+		"ECalBackendExchangeTodosFactory", &type_info, 0);
+}
+
+void
+eds_module_initialize (GTypeModule *type_module)
+{
+	e_cal_backend_exchange_events_factory_register_type (type_module);
+	e_cal_backend_exchange_todos_factory_register_type (type_module);
+}
+
+void
+eds_module_shutdown (void)
 {
-	static GType type = 0;
-
-	if (!type) {
-		GTypeInfo info = {
-			sizeof (ECalBackendExchangeFactoryClass),
-			NULL, /* base_class_init */
-			NULL, /* base_class_finalize */
-			(GClassInitFunc)  todos_backend_exchange_factory_class_init,
-			NULL, /* class_finalize */
-			NULL, /* class_data */
-			sizeof (ECalBackend),
-			0,    /* n_preallocs */
-			(GInstanceInitFunc) e_cal_backend_exchange_factory_instance_init
-		};
-
-		type = g_type_register_static (E_TYPE_CAL_BACKEND_FACTORY,
-					       "ECalBackendExchangeTodosFactory",
-					       &info, 0);
-	}
-	return type;
+}
+
+void
+eds_module_list_types (const GType **types, gint *num_types)
+{
+	static GType module_types[2];
+
+	module_types[0] = E_TYPE_CAL_BACKEND_EXCHANGE_EVENTS_FACTORY;
+	module_types[1] = E_TYPE_CAL_BACKEND_EXCHANGE_TODOS_FACTORY;
+
+	*types = module_types;
+	*num_types = G_N_ELEMENTS (module_types);
 }
diff --git a/calendar/e-cal-backend-exchange-factory.h b/calendar/e-cal-backend-exchange-factory.h
index 7a1bbcf..609ad0f 100644
--- a/calendar/e-cal-backend-exchange-factory.h
+++ b/calendar/e-cal-backend-exchange-factory.h
@@ -26,25 +26,64 @@
 #include <glib-object.h>
 #include <libedata-cal/e-cal-backend-factory.h>
 
+/* Standard GObject macros */
+#define E_TYPE_CAL_BACKEND_EXCHANGE_EVENTS_FACTORY \
+	(e_cal_backend_exchange_events_factory_get_type ())
+#define E_CAL_BACKEND_EXCHANGE_EVENTS_FACTORY(obj) \
+	(G_TYPE_CHECK_INSTANCE_CAST \
+	((obj), E_TYPE_CAL_BACKEND_EXCHANGE_EVENTS_FACTORY, ECalBackendExchangeFactory))
+#define E_CAL_BACKEND_EXCHANGE_EVENTS_FACTORY_CLASS(cls) \
+	(G_TYPE_CHECK_CLASS_CAST \
+	((cls), E_TYPE_CAL_BACKEND_EXCHANGE_EVENTS_FACTORY, ECalBackendExchangeFactoryClass))
+#define E_IS_CAL_BACKEND_EXCHANGE_EVENTS_FACTORY(obj) \
+	(G_TYPE_CHECK_INSTANCE_TYPE \
+	((obj), E_TYPE_CAL_BACKEND_EXCHANGE_EVENTS_FACTORY))
+#define E_IS_CAL_BACKEND_EXCHANGE_EVENTS_FACTORY_CLASS(cls) \
+	(G_TYPE_CHECK_CLASS_TYPE \
+	((cls), E_TYPE_CAL_BACKEND_EXCHANGE_EVENTS_FACTORY))
+#define E_CAL_BACKEND_EXCHANGE_EVENTS_FACTORY_GET_CLASS(cls) \
+	(G_TYPE_INSTANCE_GET_CLASS \
+	((obj), E_TYPE_CAL_BACKEND_EXCHANGE_EVENTS_FACTORY, ECalBackendExchangeFactoryClass))
+
+/* Standard GObject macros */
+#define E_TYPE_CAL_BACKEND_EXCHANGE_TODOS_FACTORY \
+	(e_cal_backend_exchange_todos_factory_get_type ())
+#define E_CAL_BACKEND_EXCHANGE_TODOS_FACTORY(obj) \
+	(G_TYPE_CHECK_INSTANCE_CAST \
+	((obj), E_TYPE_CAL_BACKEND_EXCHANGE_TODOS_FACTORY, ECalBackendExchangeFactory))
+#define E_CAL_BACKEND_EXCHANGE_TODOS_FACTORY_CLASS(cls) \
+	(G_TYPE_CHECK_CLASS_CAST \
+	((cls), E_TYPE_CAL_BACKEND_EXCHANGE_TODOS_FACTORY, ECalBackendExchangeFactoryClass))
+#define E_IS_CAL_BACKEND_EXCHANGE_TODOS_FACTORY(obj) \
+	(G_TYPE_CHECK_INSTANCE_TYPE \
+	((obj), E_TYPE_CAL_BACKEND_EXCHANGE_TODOS_FACTORY))
+#define E_IS_CAL_BACKEND_EXCHANGE_TODOS_FACTORY_CLASS(cls) \
+	(G_TYPE_CHECK_CLASS_TYPE \
+	((cls), E_TYPE_CAL_BACKEND_EXCHANGE_TODOS_FACTORY))
+#define E_CAL_BACKEND_EXCHANGE_TODOS_FACTORY_GET_CLASS(cls) \
+	(G_TYPE_INSTANCE_GET_CLASS \
+	((obj), E_TYPE_CAL_BACKEND_EXCHANGE_TODOS_FACTORY, ECalBackendExchangeFactoryClass))
+
 G_BEGIN_DECLS
 
-#define E_TYPE_CAL_BACKEND_EXCHANGE_FACTORY        (e_cal_backend_exchange_factory_get_type ())
-#define E_CAL_BACKEND_EXCHANGE_FACTORY(o)          (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TYPE_CAL_BACKEND_EXCHANGE_FACTORY, ECalBackendExchangeFactory))
-#define E_CAL_BACKEND_EXCHANGE_FACTORY_CLASS(k)    (G_TYPE_CHECK_CLASS_CAST((k), E_TYPE_CAL_BACKEND_EXCHANGE_FACTORY, ECalBackendExchangeFactoryClass))
-#define E_IS_CAL_BACKEND_EXCHANGE_FACTORY(o)       (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TYPE_CAL_BACKEND_EXCHANGE_FACTORY))
-#define E_IS_CAL_BACKEND_EXCHANGE_FACTORY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TYPE_CAL_BACKEND_EXCHANGE_FACTORY))
-#define E_CAL_BACKEND_EXCHANGE_FACTORY_GET_CLASS(k) (G_TYPE_INSTANCE_GET_CLASS ((obj), E_TYPE_CAL_BACKEND_EXCHANGE_FACTORY, ECalBackendExchangeFactoryClass))
+typedef struct _ECalBackendExchangeFactory ECalBackendExchangeFactory;
+typedef struct _ECalBackendExchangeFactoryClass ECalBackendExchangeFactoryClass;
 
-typedef struct {
-	ECalBackendFactory            parent_object;
-} ECalBackendExchangeFactory;
+struct _ECalBackendExchangeFactory {
+	ECalBackendFactory parent;
+};
 
-typedef struct {
+struct _ECalBackendExchangeFactoryClass {
 	ECalBackendFactoryClass parent_class;
-} ECalBackendExchangeFactoryClass;
+};
+
+GType		e_cal_backend_exchange_events_factory_get_type (void);
+void		e_cal_backend_exchange_events_factory_register_type
+						(GTypeModule *type_module);
 
-GType	events_backend_exchange_factory_get_type (void);
-GType	todos_backend_exchange_factory_get_type (void);
+GType		e_cal_backend_exchange_todos_factory_get_type (void);
+void		e_cal_backend_exchange_todos_factory_register_type
+						(GTypeModule *type_module);
 
 G_END_DECLS
 
diff --git a/camel/Makefile.am b/camel/Makefile.am
index 0195f84..78a82ea 100644
--- a/camel/Makefile.am
+++ b/camel/Makefile.am
@@ -13,7 +13,7 @@ AM_CPPFLAGS = \
 	-DCONNECTOR_LOCALEDIR=\"$(localedir)\" \
 	-DG_LOG_DOMAIN=\"camel-exchange-provider\"
 
-libcamelexchange_la_SOURCES =  \
+libcamelexchange_la_SOURCES = \
 	camel-exchange-folder.c \
 	camel-exchange-provider.c \
 	camel-exchange-journal.c \
@@ -35,9 +35,10 @@ noinst_HEADERS = \
 	camel-stub-marshal.h \
 	camel-stub.h
 
-libcamelexchange_la_LDFLAGS = -avoid-version -module $(NO_UNDEFINED)
+libcamelexchange_la_LDFLAGS = \
+	-avoid-version -module $(NO_UNDEFINED)
 
-libcamelexchange_la_LIBADD =  \
+libcamelexchange_la_LIBADD = \
 	$(LDAP_LIBS) \
 	$(LIBEXCHANGE_LIBS) \
 	$(EXCHANGE_STORAGE_LIBS) \
diff --git a/configure.ac b/configure.ac
index b658a59..9ff0ad1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -197,6 +197,9 @@ if test "x$EXCHANGE_PACKAGE" != "x"; then
 	exit 1
 fi
 
+extensiondir="`pkg-config --variable=extensiondir evolution-data-server-$EDS_API_VERSION`"
+AC_SUBST(extensiondir)
+
 EVOLUTION_idldir="`pkg-config --variable=idldir evolution-shell`"
 AC_SUBST(EVOLUTION_idldir)
 
diff --git a/storage/GNOME_Evolution_Exchange_Storage.server.in.in b/storage/GNOME_Evolution_Exchange_Storage.server.in.in
index 97a2ec0..bf45b93 100644
--- a/storage/GNOME_Evolution_Exchange_Storage.server.in.in
+++ b/storage/GNOME_Evolution_Exchange_Storage.server.in.in
@@ -38,40 +38,4 @@
 -->
 </oaf_server>
 
-<oaf_server iid="OAFIID:GNOME_Evolution_Exchange_Connector_BookFactory:@API_VERSION@"
-            type="exe"
-            location="@CONNECTOR_PATH@/evolution-exchange-storage@EXEEXT@">
-
-	<oaf_attribute name="repo_ids" type="stringv">
-		<item value="IDL:GNOME/Evolution/DataServer/BookFactory:@API_VERSION@"/>
-		<item value="IDL:Bonobo/Unknown:1.0"/>
-	</oaf_attribute>
-
-	<oaf_attribute name="name" type="string"
-                       _value="Evolution Addressbook Exchange backend"/>
-
-        <oaf_attribute name="addressbook:supported_protocols" type="stringv">
-		<item value="exchange"/>
-		<item value="gal"/>
-        </oaf_attribute>
-</oaf_server>
-
-<oaf_server iid="OAFIID:GNOME_Evolution_Exchange_Connector_CalFactory:@API_VERSION@"
-            type="exe"
-            location="@CONNECTOR_PATH@/evolution-exchange-storage@EXEEXT@">
-
-	<oaf_attribute name="repo_ids" type="stringv">
-		<item value="IDL:GNOME/Evolution/DataServer/CalFactory:@API_VERSION@"/>
-		<item value="IDL:Bonobo/Unknown:1.0"/>
-	</oaf_attribute>
-
-        <oaf_attribute name="calendar:supported_protocols" type="stringv">
-		<item value="exchange"/>
-	</oaf_attribute>
-
-	<oaf_attribute name="name" type="string"
-                       _value="Evolution Calendar Exchange backend"/>
-
-</oaf_server>
-
 </oaf_info>
diff --git a/storage/Makefile.am b/storage/Makefile.am
index 20f3cd9..e621570 100644
--- a/storage/Makefile.am
+++ b/storage/Makefile.am
@@ -2,15 +2,14 @@ AM_CPPFLAGS = \
 	-I$(top_srcdir) \
 	-I$(top_srcdir)/mail \
 	-I$(top_srcdir)/camel \
-	-I$(top_srcdir)/calendar \
 	-DG_LOG_DOMAIN=\"evolution-exchange-storage\" \
 	$(LIBEXCHANGE_CFLAGS) \
 	$(EXCHANGE_STORAGE_CFLAGS) \
 	$(LDAP_CFLAGS) \
 	-DPREFIX=\"$(prefix)\" \
-	-DSYSCONFDIR=\""$(sysconfdir)"\"  \
-	-DDATADIR=\""$(datadir)"\"	  \
-	-DLIBDIR=\""$(datadir)"\"	  \
+	-DSYSCONFDIR=\""$(sysconfdir)"\" \
+	-DDATADIR=\""$(datadir)"\" \
+	-DLIBDIR=\""$(datadir)"\" \
 	-DCONNECTOR_GLADEDIR=\""$(gladedir)"\" \
 	-DCONNECTOR_IMAGESDIR=\""$(imagesdir)"\" \
 	-DCONNECTOR_UIDIR=\""$(uidir)"\" \
@@ -40,8 +39,6 @@ evolution_exchange_storage_SOURCES = \
 
 evolution_exchange_storage_LDADD = \
 	$(top_builddir)/mail/libexchangemail.la  \
-	$(top_builddir)/addressbook/libexchangeaddressbook.la \
-	$(top_builddir)/calendar/libexchangecalendar.la \
 	$(top_builddir)/camel/camel-stub-marshal.lo \
 	$(LDAP_LIBS) \
 	$(EXCHANGE_STORAGE_LIBS) \
@@ -74,7 +71,7 @@ migr_test_SOURCES = \
 	exchange-migrate.c \
 	exchange-migrate.h
 
-migr_test_LDADD =  \
+migr_test_LDADD = \
 	$(LDAP_LIBS) \
 	$(EXCHANGE_STORAGE_LIBS) \
 	$(LIBEXCHANGE_LIBS)
diff --git a/storage/main.c b/storage/main.c
index c26a8e6..d207b2b 100644
--- a/storage/main.c
+++ b/storage/main.c
@@ -49,13 +49,6 @@
 
 #include <e2k-utils.h>
 #include <exchange-constants.h>
-#include "addressbook/e-book-backend-exchange.h"
-#include "addressbook/e-book-backend-exchange-factory.h"
-#include "addressbook/e-book-backend-gal.h"
-#include "addressbook/e-book-backend-gal-factory.h"
-#include "calendar/e-cal-backend-exchange-calendar.h"
-#include "calendar/e-cal-backend-exchange-tasks.h"
-#include "calendar/e-cal-backend-exchange-factory.h"
 
 #include "exchange-autoconfig-wizard.h"
 #include "exchange-component.h"
@@ -93,92 +86,6 @@ setup_component_factory (void)
 	return TRUE;
 }
 
-static void
-last_calendar_gone_cb (EDataCalFactory *factory, gpointer data)
-{
-	/* FIXME: what to do? */
-}
-
-/* Creates the calendar factory object and registers it */
-static gboolean
-setup_calendar_factory (void)
-{
-	gint mode;
-
-	cal_factory = e_data_cal_factory_new ();
-	if (!cal_factory) {
-		g_message ("setup_calendar_factory(): Could not create the calendar factory");
-		return FALSE;
-	}
-
-	exchange_component_is_offline (global_exchange_component, &mode);
-
-	if (mode == ONLINE_MODE)
-		e_data_cal_factory_set_backend_mode (cal_factory, ONLINE_MODE);
-	else if (mode == OFFLINE_MODE)
-		e_data_cal_factory_set_backend_mode (cal_factory, OFFLINE_MODE);
-
-	e_data_cal_factory_register_backend (cal_factory,
-					     (g_object_new (events_backend_exchange_factory_get_type(),
-							    NULL)));
-
-	e_data_cal_factory_register_backend (cal_factory,
-					     (g_object_new (todos_backend_exchange_factory_get_type(),
-							    NULL)));
-
-	/* register the factory with bonobo */
-	if (!e_data_cal_factory_register_storage (cal_factory, EXCHANGE_CALENDAR_FACTORY_ID)) {
-		bonobo_object_unref (BONOBO_OBJECT (cal_factory));
-		cal_factory = NULL;
-		return FALSE;
-	}
-
-	g_signal_connect (cal_factory, "last_calendar_gone",
-			  G_CALLBACK (last_calendar_gone_cb), NULL);
-	return TRUE;
-}
-
-static void
-last_book_gone_cb (EDataBookFactory *factory, gpointer data)
-{
-        /* FIXME: what to do? */
-}
-
-static gboolean
-setup_addressbook_factory (void)
-{
-	gint mode;
-
-        book_factory = e_data_book_factory_new ();
-        if (!book_factory)
-                return FALSE;
-
-	exchange_component_is_offline (global_exchange_component, &mode);
-
-	if (mode == ONLINE_MODE)
-		e_data_book_factory_set_backend_mode (book_factory, ONLINE_MODE);
-	else if (mode == OFFLINE_MODE)
-		e_data_book_factory_set_backend_mode (book_factory, OFFLINE_MODE);
-
-	e_data_book_factory_register_backend (book_factory,
-					      (g_object_new (e_book_backend_exchange_factory_get_type(),
-							     NULL)));
-	e_data_book_factory_register_backend (book_factory,
-					      (g_object_new (e_book_backend_gal_factory_get_type(),
-							     NULL)));
-
-        g_signal_connect (book_factory, "last_book_gone",
-			  G_CALLBACK (last_book_gone_cb), NULL);
-
-        if (!e_data_book_factory_activate (book_factory, EXCHANGE_ADDRESSBOOK_FACTORY_ID)) {
-                bonobo_object_unref (BONOBO_OBJECT (book_factory));
-                book_factory = NULL;
-                return FALSE;
-        }
-
-        return TRUE;
-}
-
 gint
 main (gint argc, gchar **argv)
 {
@@ -252,10 +159,6 @@ main (gint argc, gchar **argv)
 	/* register factories */
 	if (!setup_component_factory ())
 		goto failed;
-	if (!setup_calendar_factory ())
-		goto failed;
-        if (!setup_addressbook_factory ())
-		goto failed;
 
 	exchange_component_set_factories (global_exchange_component,
 					  cal_factory,
