Instead of testing for different versions of GTK in increasing order
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sat, 20 Aug 2011 08:18:56 +0000 (08:18 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sat, 20 Aug 2011 08:18:56 +0000 (08:18 +0000)
of preference so that the later ones overwrite the configured stuff
from the older ones, test in decreasing order of preference and stop
as soon as one is successful. Fixes a problem in which
autoconfiguration on a system containing only GTK 1 would go wrong
because the _failed_ test for GTK 2 would overwrite some but not all
of the variables set by the successful test for v1.

git-svn-id: svn://svn.tartarus.org/sgt/putty@9270 cda61777-01e9-0310-a592-d414129be87e

unix/configure.ac

index e755812..a518540 100644 (file)
@@ -68,27 +68,27 @@ AC_CHECK_HEADERS([utmpx.h sys/select.h],,,[
 #include <sys/types.h>
 #include <utmp.h>])
 
-# Look for both GTK 1 and GTK 2. If we can't find either, have the
-# makefile only build the CLI programs.
+# Look for both GTK 2 and GTK 1, in descending order of preference. If
+# we can't find either, have the makefile only build the CLI programs.
 
 gtk=none
 
-case "$gtk_version_desired" in
-  1 | any)
-    ifdef([AM_PATH_GTK],[
-    AM_PATH_GTK([1.2.0], [gtk=1], [])
-    ],[AC_WARNING([generating configure script without GTK 1 autodetection])])
-    ;;
-esac
-
-case "$gtk_version_desired" in
-  2 | any)
+case "$gtk_version_desired:$gtk" in
+  2:none | any:none)
     ifdef([AM_PATH_GTK_2_0],[
     AM_PATH_GTK_2_0([2.0.0], [gtk=2], [])
     ],[AC_WARNING([generating configure script without GTK 2 autodetection])])
     ;;
 esac
 
+case "$gtk_version_desired:$gtk" in
+  1:none | any:none)
+    ifdef([AM_PATH_GTK],[
+    AM_PATH_GTK([1.2.0], [gtk=1], [])
+    ],[AC_WARNING([generating configure script without GTK 1 autodetection])])
+    ;;
+esac
+
 AM_CONDITIONAL(HAVE_GTK, [test "$gtk" != "none"])
 
 if test "$gtk" = "2"; then