Index: configure.in
===================================================================
--- configure.in	(revision 9816)
+++ configure.in	(working copy)
@@ -240,8 +240,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 +1001,28 @@
 msg_calendar=$enable_calendar
 
 dnl **************************************************
+dnl Weather calendar backend support
+dnl **************************************************
+AC_MSG_CHECKING(if we should build the weather calendar backend)
+AC_ARG_WITH([weather], 
+  [AS_HELP_STRING([--without-weather], [Build without the weather calendar backend])],
+  [use_gweather=$withval], 
+  [use_gweather=yes])
+if test $enable_calendar = no; then
+	use_gweather="no (calendar support is disabled)"
+fi
+AC_MSG_RESULT($use_gweather)
+
+if test $use_gweather = yes; then
+	PKG_CHECK_MODULES([LIBGWEATHER], 
+	   [gweather >= gweather_minimum_version],
+	   [], 
+	   [AC_MSG_ERROR([The weather calendar backend requires GWeather >= gweather_minimum_version. Alternatively, you may specify --without-weather as a configure option to avoid building the backend.])])
+fi
+
+AM_CONDITIONAL(ENABLE_WEATHER, test $use_gweather = yes)
+
+dnl **************************************************
 dnl NNTP support.
 dnl **************************************************
 AC_ARG_ENABLE(nntp, 
@@ -1626,8 +1647,10 @@
 gladedir="$privdatadir/glade"
 AC_SUBST(gladedir)
 
-weatherdatadir="$privdatadir/weather"
-AC_SUBST(weatherdatadir)
+if test $use_gweather = 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
@@ -1778,6 +1801,7 @@
 echo "
 	evolution-data-server has been configured as follows:
 	Calendar:         $msg_calendar
+	Weather calendar: $use_gweather
 	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 9816)
+++ 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 9816)
+++ 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
