--with-gtk-version option to configure, so you can explicitly tell it
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sun, 17 Jul 2011 22:17:40 +0000 (22:17 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sun, 17 Jul 2011 22:17:40 +0000 (22:17 +0000)
which GTK version you want to build with if both are installed. Based
on a patch by Malcolm Smith, though somewhat modified.

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

unix/configure.ac

index 4b30fb0..1232917 100644 (file)
@@ -27,22 +27,47 @@ WITH_GSSAPI=
 AS_IF([test "x$with_gssapi" != xno],
   [AC_DEFINE([WITH_GSSAPI], [1], [Define if building with GSSAPI support.])])
 
+AC_ARG_WITH([gtk-version],
+  [AS_HELP_STRING([--with-gtk-version],
+                  [specify GTK version to use (1 or 2) (optional)])],
+  [gtk_version_desired="$withval"],
+  [gtk_version_desired="any"])
+
+case "$gtk_version_desired" in
+  1 | 2 | any) ;;
+  *) AC_ERROR([Invalid GTK version specified])
+esac
+
 AC_CHECK_HEADERS([utmpx.h sys/select.h],,,[
 #include <sys/types.h>
 #include <utmp.h>])
 
 # Look for both GTK 1 and GTK 2.
-ifdef([AM_PATH_GTK],[
-AM_PATH_GTK([1.2.0], [gtk=1], [gtk=none])
-],[AC_WARNING([generating configure script without GTK 1 autodetection])])
-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])])
+
+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)
+    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
+
 if test "$gtk" = "none"; then
   all_targets="all-cli"
 else
   all_targets="all-cli all-gtk"
 fi
+
 if test "$gtk" = "2"; then
   ac_save_CFLAGS="$CFLAGS"
   ac_save_LIBS="$LIBS"