From a84abdae2e07242f4b6e80f172ce1c49be60aa2a Mon Sep 17 00:00:00 2001 From: simon Date: Sun, 17 Jul 2011 22:17:40 +0000 Subject: [PATCH] --with-gtk-version option to configure, so you can explicitly tell it 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 | 37 +++++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/unix/configure.ac b/unix/configure.ac index 4b30fb09..12329172 100644 --- a/unix/configure.ac +++ b/unix/configure.ac @@ -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 #include ]) # 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" -- 2.11.0