Index: configure.in
===================================================================
--- configure.in	(revision 9805)
+++ configure.in	(working copy)
@@ -32,7 +32,6 @@
 m4_define([libsoup_minimum_version], [2.3.0])
 m4_define([gnome_keyring_minimum_version], [2.20.1])
 m4_define([sqlite_minimum_version], [3.5])
-m4_define([gweather_minimum_version], [2.25.3])
 
 dnl *************************************************************************************************
 dnl Base Version
@@ -240,8 +239,7 @@
          libglade-2.0 >= libglade_minimum_version
          libgnome-2.0 >= libgnome_minimum_version
          libxml-2.0 >= libxml_minimum_version
-         libsoup-2.4 >= libsoup_minimum_version
-	 gweather >= gweather_minimum_version])
+         libsoup-2.4 >= libsoup_minimum_version])
 
 dnl **************************************************
 dnl * regex checking
@@ -1002,6 +1000,30 @@
 msg_calendar=$enable_calendar
 
 dnl **************************************************
+dnl Weather calendar backend support
+dnl **************************************************
+
+m4_define([gweather_minimum_version], [2.25.3])
+
+AC_MSG_CHECKING(if we should build the weather calendar backend)
+AC_ARG_ENABLE(weather, 
+  AC_HELP_STRING( [--enable-weather=@<:@yes/no@:>@],
+		  [Enable the weather calendar backend (this requires --enable-calendar) (default yes)]),
+  enable_weather="$enableval", enable_weather="yes")
+
+if test "x${enable_weather}" != "xno"; then
+	if test $enable_calendar = yes; then
+		AC_MSG_RESULT([yes (requires gweather >= gweather_minimum_version)])
+		PKG_CHECK_MODULES(LIBGWEATHER, gweather >= gweather_minimum_version)
+	else
+		AC_MSG_RESULT([calendar support is disabled])
+		AC_MSG_ERROR([Please re-configure with the option --enable-calendar to build the weather calendar backend. Alternatively, you may disable this with --disable-weather ])
+	fi
+fi
+AM_CONDITIONAL(ENABLE_WEATHER, test x$enable_weather = xyes)
+msg_weather=$enable_weather
+
+dnl **************************************************
 dnl NNTP support.
 dnl **************************************************
 AC_ARG_ENABLE(nntp, 
@@ -1626,8 +1648,10 @@
 gladedir="$privdatadir/glade"
 AC_SUBST(gladedir)
 
-weatherdatadir="$privdatadir/weather"
-AC_SUBST(weatherdatadir)
+if test $enable_weather = yes; then
+	weatherdatadir="$privdatadir/weather"
+	AC_SUBST(weatherdatadir)
+fi
 
 dnl separate camel from e-d-s?  or should it be under the same spot?  same for now.
 camel_providerdir='${libdir}'/evolution-data-server-$API_VERSION/camel-providers
@@ -1777,7 +1801,12 @@
 
 echo "
 	evolution-data-server has been configured as follows:
-	Calendar:         $msg_calendar
+	Calendar:         $msg_calendar"
+if test "$msg_calendar" = "yes"; then
+echo "\
+	Weather calendar: $msg_weather"
+fi
+echo "\
 	Mail Directory:   $system_mail_dir, $system_mail_perm
 	LDAP support:     $msg_ldap"
 if test "$msg_nntp" = "yes"; then
Index: calendar/backends/weather/Makefile.am
===================================================================
--- calendar/backends/weather/Makefile.am	(revision 9805)
+++ calendar/backends/weather/Makefile.am	(working copy)
@@ -14,7 +14,7 @@
 	-DWEATHER_DATADIR=\""$(weatherdatadir)"\"	\
 	$(EVOLUTION_CALENDAR_CFLAGS)			\
 	$(SOUP_CFLAGS)					\
-	`pkg-config --cflags gweather`
+	$(LIBGWEATHER_CFLAGS)
 
 extension_LTLIBRARIES = libecalbackendweather.la
 
@@ -32,14 +32,14 @@
 	$(top_builddir)/calendar/libecal/libecal-1.2.la				\
 	$(top_builddir)/calendar/libedata-cal/libedata-cal-1.2.la		\
 	$(top_builddir)/libedataserver/libedataserver-1.2.la			\
-	$(top_builddir)/libebackend/libebackend-1.2.la			\
+	$(top_builddir)/libebackend/libebackend-1.2.la				\
 	$(EVOLUTION_CALENDAR_LIBS)						\
 	$(SOUP_LIBS)								\
-	-lgweather
+	$(LIBGWEATHER_LIBS)
 
 libecalbackendweather_la_LDFLAGS =		\
 	-module -avoid-version $(NO_UNDEFINED)	\
-	`pkg-config --libs gweather`
+	$(LIBGWEATHER_LIBS)
 	
 
 weatherdata_in_files = Locations.xml.in
Index: calendar/backends/Makefile.am
===================================================================
--- calendar/backends/Makefile.am	(revision 9805)
+++ calendar/backends/Makefile.am	(working copy)
@@ -1 +1,7 @@
-SUBDIRS = file groupwise http contacts weather caldav google
+if ENABLE_WEATHER
+WEATHER_SUBDIR = weather
+else
+WEATHER_SUBDIR =
+endif
+
+SUBDIRS = file groupwise http contacts $(WEATHER_SUBDIR) caldav google
