Index: configure.in
===================================================================
--- configure.in	(revision 9080)
+++ configure.in	(working copy)
@@ -991,13 +991,32 @@
 
 if test "x${enable_calendar}" != "xno"; then
         AC_DEFINE(ENABLE_CALENDAR, 1, [Define if Calendar should be built])
-	AC_DEFINE(HANDLE_LIBICAL_MEMORY, 1, [Define it once memory returned by libical is free'ed properly])
 fi
 AM_CONDITIONAL(ENABLE_CALENDAR, test x$enable_calendar = xyes)
 AC_MSG_RESULT($enable_calendar)
 msg_calendar=$enable_calendar
 
 dnl **************************************************
+dnl LibiCal support
+dnl **************************************************
+AC_MSG_CHECKING(if we should build LibiCal)
+AC_ARG_ENABLE(libical, 
+  AC_HELP_STRING( [--enable-libical=@<:@yes/no@:>@],
+		  [Build bundled LibiCal (default yes)(--enable-calendar=yes implies --enable-libical=yes)]),
+  enable_libical="$enableval", enable_libical="yes")
+
+if test "x${enable_calendar}" != "xno"; then
+	enable_libical="yes"
+fi
+if test "x${enable_libical}" != "xno"; then
+	AC_DEFINE(ENABLE_LIBICAL, 1, [Define if LibiCal should be built])
+	AC_DEFINE(HANDLE_LIBICAL_MEMORY, 1, [Define it once memory returned by LibiCal is free'ed properly])
+fi
+AM_CONDITIONAL(ENABLE_LIBICAL, test x$enable_libical = xyes)
+AC_MSG_RESULT($enable_libical)
+msg_libical=$enable_libical
+
+dnl **************************************************
 dnl NNTP support.
 dnl **************************************************
 AC_ARG_ENABLE(nntp, 
@@ -1643,8 +1662,8 @@
 export privincludedir
 export privdatadir
 
-if test $enable_calendar = yes; then
-        AC_CONFIG_SUBDIRS(calendar/libical)
+if test $enable_libical = yes; then
+        AC_CONFIG_SUBDIRS(libical)
 fi
 if test $dynamic_libdb = no; then
         AC_CONFIG_SUBDIRS(libdb/dist)
@@ -1754,6 +1773,7 @@
 echo "
 	evolution-data-server has been configured as follows:
 	Calendar:         $msg_calendar
+	LibiCal:          $msg_libical
 	Mail Directory:   $system_mail_dir, $system_mail_perm
 	LDAP support:     $msg_ldap"
 if test "$msg_nntp" = "yes"; then
Index: src/Makefile.am
===================================================================
--- src/Makefile.am	(revision 9080)
+++ src/Makefile.am	(working copy)
@@ -10,10 +10,10 @@
 	-I$(top_srcdir)/calendar			\
 	-I$(top_srcdir)/calendar			\
 	-I$(top_builddir)/calendar			\
-	-I$(top_srcdir)/calendar/libical/src		\
-	-I$(top_builddir)/calendar/libical/src		\
-	-I$(top_srcdir)/calendar/libical/src/libical	\
-	-I$(top_builddir)/calendar/libical/src/libical	\
+	-I$(top_srcdir)/libical/src			\
+	-I$(top_builddir)/libical/src			\
+	-I$(top_srcdir)/libical/src/libical		\
+	-I$(top_builddir)/libical/src/libical		\
 	-DEVOLUTION_LOCALEDIR=\""$(localedir)"\"	\
 	$(SOUP_CFLAGS)					\
 	$(E_FACTORY_CFLAGS)				\
Index: calendar/libedata-cal/Makefile.am
===================================================================
--- calendar/libedata-cal/Makefile.am	(revision 9080)
+++ calendar/libedata-cal/Makefile.am	(working copy)
@@ -1,13 +1,13 @@
-INCLUDES =						\
-	-DG_LOG_DOMAIN=\"libedata-cal\"			\
-	-I$(top_srcdir)					\
-	-I$(top_builddir)				\
-	-I$(top_srcdir)/calendar			\
-	-I$(top_builddir)/calendar			\
-	-I$(top_srcdir)/calendar/libical/src		\
-	-I$(top_builddir)/calendar/libical/src		\
-	-I$(top_srcdir)/calendar/libical/src/libical	\
-	-I$(top_builddir)/calendar/libical/src/libical	\
+INCLUDES =					\
+	-DG_LOG_DOMAIN=\"libedata-cal\"		\
+	-I$(top_srcdir)				\
+	-I$(top_builddir)			\
+	-I$(top_srcdir)/calendar		\
+	-I$(top_builddir)/calendar		\
+	-I$(top_srcdir)/libical/src		\
+	-I$(top_builddir)/libical/src		\
+	-I$(top_srcdir)/libical/src/libical	\
+	-I$(top_builddir)/libical/src/libical	\
 	$(EVOLUTION_CALENDAR_CFLAGS)
 
 CORBA_GENERATED_H =				\
Index: calendar/tests/ecal/Makefile.am
===================================================================
--- calendar/tests/ecal/Makefile.am	(revision 9080)
+++ calendar/tests/ecal/Makefile.am	(working copy)
@@ -4,10 +4,10 @@
 	-I$(top_builddir)				\
 	-I$(top_srcdir)/calendar			\
 	-I$(top_builddir)/calendar			\
-	-I$(top_srcdir)/calendar/libical/src		\
-	-I$(top_builddir)/calendar/libical/src		\
-	-I$(top_srcdir)/calendar/libical/src/libical	\
-	-I$(top_builddir)/calendar/libical/src/libical	\
+	-I$(top_srcdir)/libical/src			\
+	-I$(top_builddir)/libical/src			\
+	-I$(top_srcdir)/libical/src/libical		\
+	-I$(top_builddir)/libical/src/libical		\
 	$(EVOLUTION_CALENDAR_CFLAGS)
 
 EXTRA_DIST =                          \
@@ -27,7 +27,7 @@
 	-DG_LOG_DOMAIN=\"test-ecal\"
 test_ecal_LDADD =								\
 	$(top_builddir)/calendar/libecal/libecal-1.2.la				\
-	$(top_builddir)/calendar/libical/src/libical/libical-evolution.la	\
+	$(top_builddir)/libical/src/libical/libical-evolution.la		\
 	$(EVOLUTION_CALENDAR_LIBS)
 
 test_recur_SOURCES = test-recur.c
@@ -36,7 +36,7 @@
 	-DG_LOG_DOMAIN=\"test-ecal\"
 test_recur_LDADD =								\
 	$(top_builddir)/calendar/libecal/libecal-1.2.la				\
-	$(top_builddir)/calendar/libical/src/libical/libical-evolution.la	\
+	$(top_builddir)/libical/src/libical/libical-evolution.la	\
 	$(EVOLUTION_CALENDAR_LIBS)
 
 test_search_SOURCES = test-search.c
@@ -45,5 +45,5 @@
 	-DG_LOG_DOMAIN=\"test-ecal\"
 test_search_LDADD =								\
 	$(top_builddir)/calendar/libecal/libecal-1.2.la				\
-	$(top_builddir)/calendar/libical/src/libical/libical-evolution.la	\
+	$(top_builddir)/libical/src/libical/libical-evolution.la	\
 	$(EVOLUTION_CALENDAR_LIBS)
Index: calendar/Makefile.am
===================================================================
--- calendar/Makefile.am	(revision 9080)
+++ calendar/Makefile.am	(working copy)
@@ -1 +1,2 @@
-SUBDIRS = libical idl libecal libedata-cal backends tests
\ No newline at end of file
+SUBDIRS = idl libecal libedata-cal backends tests
+
Index: calendar/backends/file/Makefile.am
===================================================================
--- calendar/backends/file/Makefile.am	(revision 9080)
+++ calendar/backends/file/Makefile.am	(working copy)
@@ -4,10 +4,10 @@
 	-I$(top_builddir)				\
 	-I$(top_srcdir)/calendar			\
 	-I$(top_builddir)/calendar			\
-	-I$(top_srcdir)/calendar/libical/src		\
-	-I$(top_builddir)/calendar/libical/src		\
-	-I$(top_srcdir)/calendar/libical/src/libical	\
-	-I$(top_builddir)/calendar/libical/src/libical	\
+	-I$(top_srcdir)/libical/src			\
+	-I$(top_builddir)/libical/src			\
+	-I$(top_srcdir)/libical/src/libical		\
+	-I$(top_builddir)/libical/src/libical		\
 	$(EVOLUTION_CALENDAR_CFLAGS)
 
 extension_LTLIBRARIES = libecalbackendfile.la
Index: calendar/backends/http/Makefile.am
===================================================================
--- calendar/backends/http/Makefile.am	(revision 9080)
+++ calendar/backends/http/Makefile.am	(working copy)
@@ -4,10 +4,10 @@
 	-I$(top_builddir)				\
 	-I$(top_srcdir)/calendar			\
 	-I$(top_builddir)/calendar			\
-	-I$(top_srcdir)/calendar/libical/src		\
-	-I$(top_builddir)/calendar/libical/src		\
-	-I$(top_srcdir)/calendar/libical/src/libical	\
-	-I$(top_builddir)/calendar/libical/src/libical	\
+	-I$(top_srcdir)/libical/src			\
+	-I$(top_builddir)/libical/src			\
+	-I$(top_srcdir)/libical/src/libical		\
+	-I$(top_builddir)/libical/src/libical		\
 	$(EVOLUTION_CALENDAR_CFLAGS)			\
 	$(SOUP_CFLAGS)
 
Index: calendar/backends/weather/Makefile.am
===================================================================
--- calendar/backends/weather/Makefile.am	(revision 9080)
+++ calendar/backends/weather/Makefile.am	(working copy)
@@ -4,10 +4,10 @@
 	-I$(top_builddir)				\
 	-I$(top_srcdir)/calendar			\
 	-I$(top_builddir)/calendar			\
-	-I$(top_srcdir)/calendar/libical/src		\
-	-I$(top_builddir)/calendar/libical/src		\
-	-I$(top_srcdir)/calendar/libical/src/libical	\
-	-I$(top_builddir)/calendar/libical/src/libical	\
+	-I$(top_srcdir)/libical/src			\
+	-I$(top_builddir)/libical/src			\
+	-I$(top_srcdir)/libical/src/libical		\
+	-I$(top_builddir)/libical/src/libical		\
 	-I$(top_srcdir)/addressbook			\
 	-I$(top_builddir)/addressbook			\
 	-DE_DATA_SERVER_PREFIX=\"$(prefix)\"		\
Index: calendar/backends/groupwise/Makefile.am
===================================================================
--- calendar/backends/groupwise/Makefile.am	(revision 9080)
+++ calendar/backends/groupwise/Makefile.am	(working copy)
@@ -4,10 +4,10 @@
 	-I$(top_builddir)				\
 	-I$(top_srcdir)/calendar			\
 	-I$(top_builddir)/calendar			\
-	-I$(top_srcdir)/calendar/libical/src		\
-	-I$(top_builddir)/calendar/libical/src		\
-	-I$(top_srcdir)/calendar/libical/src/libical	\
-	-I$(top_builddir)/calendar/libical/src/libical	\
+	-I$(top_srcdir)/libical/src			\
+	-I$(top_builddir)/libical/src			\
+	-I$(top_srcdir)/libical/src/libical		\
+	-I$(top_builddir)/libical/src/libical		\
 	-I$(top_srcdir)/servers/groupwise		\
 	-I$(top_builddir)/servers/groupwise		\
 	$(EVOLUTION_CALENDAR_CFLAGS)			\
Index: calendar/backends/caldav/Makefile.am
===================================================================
--- calendar/backends/caldav/Makefile.am	(revision 9080)
+++ calendar/backends/caldav/Makefile.am	(working copy)
@@ -1,13 +1,13 @@
-INCLUDES =                                                      \
-	$(EVOLUTION_CALENDAR_CFLAGS)				\
-	-I$(top_srcdir)						\
-	-I$(top_srcdir)/calendar                                \
-	-I$(top_builddir)/calendar                              \
-	-I$(top_srcdir)/calendar/libical/src		        \
-	-I$(top_builddir)/calendar/libical/src		        \
-	-I$(top_srcdir)/calendar/libical/src/libical	        \
-	-I$(top_builddir)/calendar/libical/src/libical	        \
-	$(SOUP_CFLAGS)					        \
+INCLUDES =                                              \
+	$(EVOLUTION_CALENDAR_CFLAGS)			\
+	-I$(top_srcdir)					\
+	-I$(top_srcdir)/calendar                        \
+	-I$(top_builddir)/calendar                      \
+	-I$(top_srcdir)/libical/src		        \
+	-I$(top_builddir)/libical/src		        \
+	-I$(top_srcdir)/libical/src/libical	        \
+	-I$(top_builddir)/libical/src/libical	        \
+	$(SOUP_CFLAGS)					\
 	-DG_LOG_DOMAIN=\"e-cal-backend-caldav\"
 
 extension_LTLIBRARIES = libecalbackendcaldav.la
Index: calendar/backends/google/Makefile.am
===================================================================
--- calendar/backends/google/Makefile.am	(revision 9080)
+++ calendar/backends/google/Makefile.am	(working copy)
@@ -4,10 +4,10 @@
 	-I$(top_builddir)				\
 	-I$(top_srcdir)/calendar			\
 	-I$(top_builddir)/calendar			\
-	-I$(top_srcdir)/calendar/libical/src		\
-	-I$(top_builddir)/calendar/libical/src		\
-	-I$(top_srcdir)/calendar/libical/src/libical	\
-	-I$(top_builddir)/calendar/libical/src/libical	\
+	-I$(top_srcdir)/libical/src			\
+	-I$(top_builddir)/libical/src			\
+	-I$(top_srcdir)/libical/src/libical		\
+	-I$(top_builddir)/libical/src/libical		\
 	-I$(top_srcdir)/servers/google/libgdata		\
 	-I$(top_builddir)/servers/google/libgdata	\
 	-I$(top_srcdir)/servers/google/libgdata-google	\
Index: calendar/backends/contacts/Makefile.am
===================================================================
--- calendar/backends/contacts/Makefile.am	(revision 9080)
+++ calendar/backends/contacts/Makefile.am	(working copy)
@@ -4,10 +4,10 @@
 	-I$(top_builddir)				\
 	-I$(top_srcdir)/calendar			\
 	-I$(top_builddir)/calendar			\
-	-I$(top_srcdir)/calendar/libical/src		\
-	-I$(top_builddir)/calendar/libical/src		\
-	-I$(top_srcdir)/calendar/libical/src/libical	\
-	-I$(top_builddir)/calendar/libical/src/libical	\
+	-I$(top_srcdir)/libical/src			\
+	-I$(top_builddir)/libical/src			\
+	-I$(top_srcdir)/libical/src/libical		\
+	-I$(top_builddir)/libical/src/libical		\
 	-I$(top_srcdir)/addressbook			\
 	-I$(top_builddir)/addressbook			\
 	$(EVOLUTION_CALENDAR_CFLAGS)
Index: calendar/libecal/Makefile.am
===================================================================
--- calendar/libecal/Makefile.am	(revision 9080)
+++ calendar/libecal/Makefile.am	(working copy)
@@ -7,9 +7,9 @@
 	-I$(top_builddir)				\
 	-I$(top_builddir)/calendar/libecal		\
 	-I$(top_srcdir)/calendar/libical/src		\
-	-I$(top_builddir)/calendar/libical/src		\
-	-I$(top_srcdir)/calendar/libical/src/libical	\
-	-I$(top_builddir)/calendar/libical/src/libical	\
+	-I$(top_builddir)/libical/src			\
+	-I$(top_srcdir)/libical/src/libical		\
+	-I$(top_builddir)/libical/src/libical		\
 	$(EVOLUTION_CALENDAR_CFLAGS)
 
 # The corba stubs and skels
@@ -55,11 +55,11 @@
 	e-cal-view-listener.h	\
 	e-cal-view-private.h
 
-libecal_1_2_la_LIBADD =									\
-	$(top_builddir)/calendar/libical/src/libical/libical-evolution.la		\
-	$(top_builddir)/calendar/libical/src/libicalvcal/libicalvcal-evolution.la	\
-	$(top_builddir)/calendar/libical/src/libicalss/libicalss-evolution.la		\
-	$(top_builddir)/libedataserver/libedataserver-1.2.la \
+libecal_1_2_la_LIBADD =								\
+	$(top_builddir)/libical/src/libical/libical-evolution.la		\
+	$(top_builddir)/libical/src/libicalvcal/libicalvcal-evolution.la	\
+	$(top_builddir)/libical/src/libicalss/libicalss-evolution.la		\
+	$(top_builddir)/libedataserver/libedataserver-1.2.la 			\
 	$(EVOLUTION_CALENDAR_LIBS)
 
 libecal_1_2_la_LDFLAGS = 								\
Index: Makefile.am
===================================================================
--- Makefile.am	(revision 9080)
+++ Makefile.am	(working copy)
@@ -5,12 +5,17 @@
 LIBDB = libdb
 endif
 
+if ENABLE_LIBICAL
+LIBICAL = libical
+endif
+
 if ENABLE_CALENDAR
 CALENDAR_DIR = calendar
 endif
 
-SUBDIRS = $(LIBDB) win32 libedataserver libebackend servers camel addressbook $(CALENDAR_DIR) libedataserverui src docs art po
-DIST_SUBDIRS= win32 libedataserver libebackend servers camel addressbook calendar libedataserverui src docs art po	
+SUBDIRS = $(LIBDB) $(LIBICAL) win32 libedataserver libebackend servers camel addressbook $(CALENDAR_DIR) libedataserverui src docs art po
+DIST_SUBDIRS = $(LIBICAL) win32 libedataserver libebackend servers camel addressbook calendar libedataserverui src docs art po	
+
 changelogs =			\
 	ChangeLog
 
