diff --git a/src/post_modules/GTK/configure.in b/src/post_modules/GTK/configure.in
index c6f9b9e7eedfc2ef7873818c9df0150d54156661..76e8b69cfd561c1462e451cbe492827eecdd82ec 100644
--- a/src/post_modules/GTK/configure.in
+++ b/src/post_modules/GTK/configure.in
@@ -790,38 +790,39 @@ if test "x$WITH_GTK" = x1 ; then
   CFLAGS="$oCFLAGS"
 
   fi
-else
-  WITH_GTK=0
-fi
 
-# On some systems, gtk-config et al points to uninstalled 
-# libraries. Use this to be able to detect a faulty installation
-# of GTK, ie try a real link. If it fails, warn and don't try
-# to use GTK or the detected libs.
-AC_MSG_CHECKING([if GTK really links])
-AC_CACHE_VAL(pgtk_cv_gtk_really_links,[
-   saved_CFLAGS="$CFLAGS"
-   saved_LIBS="$LIBS"
-   CFLAGS="$CFLAGS $GTK_CFLAGS"
-   LIBS="$LIBS $GTK_LIBS"
-   AC_TRY_LINK([int gtk_init();],
-               [gtk_init();],
-	       pgtk_cv_gtk_really_links=yes,
-	       pgtk_cv_gtk_really_links=no)
-   CFLAGS="$saved_CFLAGS"
-   LIBS="$saved_LIBS"
-])
-AC_MSG_RESULT($pgtk_cv_gtk_really_links)
-if test "x$pgtk_cv_gtk_really_links" = "xno" ; then
-  WITH_GTK=0
-  PGTK_LIBS=""
-  GNOME_LIBS=""
-  LIBGLADE_LIBS=""
-  LIBS=""
-  
-  PIKE_FEATURE(GTK,[no (linking failed, erroneous installation?)])
-  PIKE_MSG_WARN([GTK found, but linking failed. Your installation seems to 
+  if test "x$WITH_GTK" = x1 -o "x$WITH_GTK" = x2 ; then
+    # On some systems, gtk-config et al points to uninstalled 
+    # libraries. Use this to be able to detect a faulty installation
+    # of GTK, ie try a real link. If it fails, warn and don't try
+    # to use GTK or the detected libs.
+    AC_MSG_CHECKING([if GTK really links])
+    AC_CACHE_VAL(pgtk_cv_gtk_really_links,[
+       saved_CFLAGS="$CFLAGS"
+       saved_LIBS="$LIBS"
+       CFLAGS="$CFLAGS $GTK_CFLAGS"
+       LIBS="$LIBS $GTK_LIBS"
+       AC_TRY_LINK([int gtk_init();],
+		   [gtk_init();],
+		   pgtk_cv_gtk_really_links=yes,
+		   pgtk_cv_gtk_really_links=no)
+       CFLAGS="$saved_CFLAGS"
+       LIBS="$saved_LIBS"
+    ])
+    AC_MSG_RESULT($pgtk_cv_gtk_really_links)
+    if test "x$pgtk_cv_gtk_really_links" = "xno" ; then
+      WITH_GTK=0
+      PGTK_LIBS=""
+      GNOME_LIBS=""
+      LIBGLADE_LIBS=""
+      LIBS=""
+      PIKE_FEATURE(GTK,[no (linking failed, erroneous installation?)])
+      PIKE_MSG_WARN([GTK found, but linking failed. Your installation seems to 
 be missing pieces. See .../post_modules/GTK/config.log.])
+    fi
+  fi
+else
+  WITH_GTK=0
 fi
 
 AC_OUTPUT(Makefile options)