AC_ARG_WITH([gtk],
[AS_HELP_STRING([--with-gtk=VER],
- [specify GTK version to use (`1' or `2')])
+ [specify GTK version to use (`1', `2' or `3')])
AS_HELP_STRING([--without-gtk],
[do not use GTK (build command-line tools only)])],
[gtk_version_desired="$withval"],
[gtk_version_desired="any"])
case "$gtk_version_desired" in
- 1 | 2 | any | no) ;;
+ 1 | 2 | 3 | any | no) ;;
yes) gtk_version_desired="any" ;;
*) AC_ERROR([Invalid GTK version specified])
esac
#include <sys/types.h>
#include <utmp.h>])
-# 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.
+# Look for GTK 2, GTK 3 and GTK 1, in descending order of preference.
+#
+# (I like GTK 2 for its faster support for X server-side fonts due to
+# not being required to do all its drawing via Cairo; GTK 3 is
+# tolerable if GTK 2 can't be had, and GTK 1 is an extreme fallback
+# for platforms - of which I've heard of at least one - to which
+# nothing newer has ever been ported.)
+#
+# If we can't find any, have the makefile only build the CLI programs.
gtk=none
;;
esac
+case "$gtk_version_desired:$gtk" in
+ 3:none | any:none)
+ ifdef([AM_PATH_GTK_3_0],[
+ AM_PATH_GTK_3_0([3.0.0], [
+ gtk=3
+ GTK_CFLAGS="$GTK_CFLAGS -Wno-deprecated-declarations"
+ ], [])
+ ],[AC_WARNING([generating configure script without GTK 3 autodetection])])
+ ;;
+esac
+
case "$gtk_version_desired:$gtk" in
1:none | any:none)
ifdef([AM_PATH_GTK],[
AM_CONDITIONAL(HAVE_GTK, [test "$gtk" != "none"])
-if test "$gtk" = "2"; then
+if test "$gtk" = "2" -o "$gtk" = "3"; then
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $GTK_CFLAGS"
EOF
elif test "$gtk" = "none"; then cat <<EOF
-'configure' was unable to find either the GTK 1 or GTK 2 libraries on
+'configure' was unable to find any version of the GTK libraries on
your system. Therefore, PuTTY itself and the other GUI utilities will
not be built by the generated Makefile: only the command-line tools
such as puttygen, plink and psftp will be built.
+EOF
+elif test "$gtk" = "3"; then cat <<EOF
+
+PuTTY will be built with GTK 3. Be aware that the GTK 3 support in
+this codebase is UNFINISHED AND EXPERIMENTAL! Many deprecated
+functions are used, and there are known layout bugs.
+
EOF
fi