diff --git a/Makefile.am b/Makefile.am
index a5e763c..4632196 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -11,8 +11,10 @@ endif
 
 if BUILD_GNOME
 SUBDIRS += libtinymailui-gnome-keyring
+if !BUILD_GIO
 SUBDIRS += libtinymail-gnomevfs
 endif
+endif
 
 if BUILD_UIGTK
 SUBDIRS += libtinymailui-gtk 
@@ -31,8 +33,10 @@ SUBDIRS += libtinymailui-gtkhtml
 endif
 
 if BUILD_MAEMO
+if !BUILD_GIO
 SUBDIRS += libtinymail-gnomevfs
 endif
+endif
 
 SUBDIRS += libtinymail-camel $(PLATFORMDIR) 
 
diff --git a/configure.ac b/configure.ac
index 7112827..460edb6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -416,8 +416,8 @@ AC_SUBST(LIBTINYMAIL_TP_LIBS)
 
 dnl ### libtinymail-gio, a tnystreamiface for gio ##
 build_gio="false"
-PKG_CHECK_MODULES(GIO, gio-2.0, [have_gio="true"],
-				[have_gio="false"])
+PKG_CHECK_MODULES(LIBTINYMAIL_GIO, gio-2.0, [have_gio="true"],
+					    [have_gio="false"])
 AC_ARG_ENABLE(gio,
 AC_HELP_STRING([--enable-gio],
 	       [Build using Gio support (yes, no)]),
@@ -440,16 +440,9 @@ dnl ### Enable gio or gnome-vfs support ##
 extragtkpkgs=
 extratnypkgs=
 if test x$build_gio = xtrue; then
+  extratnypkgs="gio-2.0"
   if test x$build_gnome = xtrue; then
     extragtkpkgs="libgnomeui-2.0 gnome-keyring-1"
-    extratnypkgs="gio-2.0"
-    PKG_CHECK_MODULES(LIBTINYMAIL_GIO, gio-2.0)
-  elif test x$build_maemo = xtrue; then
-    extratnypkgs="gio-2.0"
-    PKG_CHECK_MODULES(LIBTINYMAIL_GIO, gio-2.0)
-  else
-    LIBTINYMAIL_GIO_CFLAGS=
-    LIBTINYMAIL_GIO_LIBS=
   fi
   AC_SUBST(LIBTINYMAIL_GIO_CFLAGS)
   AC_SUBST(LIBTINYMAIL_GIO_LIBS)
