From d1f30f6952fea1fb0eb00cde2f8cd9bd4a8f7af1 Mon Sep 17 00:00:00 2001
From: Martin Stjernholm <mast@lysator.liu.se>
Date: Wed, 17 Mar 2004 18:34:34 +0100
Subject: [PATCH] Do the link check only if GTK was detected by earlier tests.

Rev: src/post_modules/GTK/configure.in:1.50
---
 src/post_modules/GTK/configure.in | 61 ++++++++++++++++---------------
 1 file changed, 31 insertions(+), 30 deletions(-)

diff --git a/src/post_modules/GTK/configure.in b/src/post_modules/GTK/configure.in
index c6f9b9e7ee..76e8b69cfd 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)
-- 
GitLab