Changeset 13006 for branches


Ignore:
Timestamp:
Oct 20, 2011, 1:18:31 AM (10 years ago)
Author:
jordan
Message:

(2.4x) backport autoconf support for GTK+ 2 and GTK+ 3 from r12964 and r12972

Location:
branches/2.4x
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2.4x/NEWS

    r12951 r13006  
    33==== Mac ====
    44  * Fix crasher on 10.5 Leopard
     5==== GTK+ ====
     6  * Fix crasher on systems not running DBus
     7  * Support GTK+ 3.2
     8==== Web Client ====
     9  * Fix bug which broke Opera support
    510
    611=== Transmission 2.40 (2011/10/05) ===
  • branches/2.4x/configure.ac

    r13005 r13006  
    5151##
    5252##
    53 GTK_MINIMUM=2.22.0
    54 AC_SUBST(GTK_MINIMUM)
     53
     54GTK2_MINIMUM=2.22.0
     55AC_SUBST(GTK2_MINIMUM)
     56GTK3_MINIMUM=3.2.0
     57AC_SUBST(GTK3_MINIMUM)
    5558GLIB_MINIMUM=2.28.0
    5659AC_SUBST(GLIB_MINIMUM)
     
    239242dnl  detection for the GTK+ client
    240243
    241 PKG_CHECK_MODULES(GTK,
    242                   [gtk+-2.0 >= $GTK_MINIMUM
    243                    glib-2.0 >= $GLIB_MINIMUM
    244                    gio-2.0 >= $GIO_MINIMUM,
    245                    gmodule-2.0 >= $GLIB_MINIMUM
    246                    gthread-2.0 >= $GLIB_MINIMUM],
    247                   [have_gtk=yes],
    248                   [have_gtk=no])
    249 AC_ARG_ENABLE([gtk],
    250               AS_HELP_STRING([--enable-gtk],[build gtk client]),
    251               [want_gtk=${enableval}],
    252               [want_gtk=${have_gtk}])
    253 build_gtk=no
     244
     245gtk_version="none"
     246with_gtk_default="no"
     247PKG_CHECK_EXISTS([gtk+-2.0 >= $GTK2_MINIMUM],[gtk_version="2" with_gtk_default="yes"])
     248PKG_CHECK_EXISTS([gtk+-3.0 >= $GTK3_MINIMUM],[gtk_version="3" with_gtk_default="yes"])
     249AC_ARG_WITH([gtk], AC_HELP_STRING([--with-gtk],[with Gtk]),
     250            [with_gtk=$withval],
     251            [with_gtk=$with_gtk_default])
     252AC_ARG_ENABLE([nls],
     253              [AS_HELP_STRING([--enable-nls],[enable native language support])],,
     254              [enable_nls=yes])
     255AM_CONDITIONAL([BUILD_GTK],[test "x$with_gtk" = "xyes"])
    254256use_libappindicator=no
    255 if test "x$want_gtk" = "xyes" ; then
    256     if test "x$have_gtk" = "xyes"; then
    257       build_gtk=yes
     257if test "x$with_gtk" = "xyes" ; then
     258
     259    if test "x$gtk_version" = "xnone" ; then
     260        AC_MSG_ERROR("GTK+ not found!")
     261    fi
     262    if test "x$enable_nls" = "xno" ; then
     263        AC_MSG_ERROR("The gtk client cannot be built without nls support.  Try adding either --enable-nls or --disable-gtk" )
     264    fi
     265
     266    if test "x$gtk_version" = "x3"; then
     267
     268        PKG_CHECK_MODULES([GTK], [gtk+-3.0 >= $GTK3_MINIMUM
     269                                  glib-2.0 >= $GLIB_MINIMUM
     270                                  gio-2.0 >= $GIO_MINIMUM,
     271                                  gmodule-2.0 >= $GLIB_MINIMUM
     272                                  gthread-2.0 >= $GLIB_MINIMUM])
     273        PKG_CHECK_MODULES([LIBAPPINDICATOR],
     274                          [appindicator3-0.1 >= $LIBAPPINDICATOR_MINIMUM],
     275                          [have_libappindicator=yes],
     276                          [have_libappindicator=no])
     277        AC_MSG_NOTICE([using GTK+ 3])
    258278    else
    259       AC_MSG_ERROR("GTK+ not found!")
    260     fi
    261 fi
    262 AM_CONDITIONAL([BUILD_GTK],[test "x$build_gtk" = "xyes"])
    263 
    264 if test "x$build_gtk" = "xyes"; then
    265 
    266     PKG_CHECK_MODULES([LIBAPPINDICATOR],
    267                       [appindicator-0.1 >= $LIBAPPINDICATOR_MINIMUM],
    268                       [have_libappindicator=yes],
    269                       [have_libappindicator=no])
    270 
    271     AC_ARG_ENABLE([libappindicator],
    272                   AS_HELP_STRING([--enable-libappindicator],[enable AppIndicator support]),,
    273                   [enable_libappindicator=yes])
    274     use_libappindicator=no
     279
     280        PKG_CHECK_MODULES([GTK], [gtk+-2.0 >= $GTK2_MINIMUM
     281                                  glib-2.0 >= $GLIB_MINIMUM
     282                                  gio-2.0 >= $GIO_MINIMUM,
     283                                  gmodule-2.0 >= $GLIB_MINIMUM
     284                                  gthread-2.0 >= $GLIB_MINIMUM])
     285        PKG_CHECK_MODULES([LIBAPPINDICATOR],
     286                          [appindicator-0.1 >= $LIBAPPINDICATOR_MINIMUM],
     287                          [have_libappindicator=yes],
     288                          [have_libappindicator=no])
     289        AC_MSG_NOTICE([using GTK+ 2])
     290
     291    fi
     292
    275293    if test "x$have_libappindicator" = "xyes"; then
    276         if test "x$enable_libappindicator" = "xyes" ; then
    277             use_libappindicator=yes
    278             AC_DEFINE([HAVE_LIBAPPINDICATOR], 1)
    279         else
    280             LIBAPPINDICATOR_CFLAGS=
    281             LIBAPPINDICATOR_LIBS=
    282         fi
    283     fi
    284 fi
    285 
    286 AC_ARG_ENABLE([nls],
    287               AS_HELP_STRING([--enable-nls],[enable native language support]),,
    288               [enable_nls=yes])
    289 
    290 if test "x$build_gtk" = "xyes" -a  "x$enable_nls" = "xno" ; then
    291     AC_MSG_ERROR("The gtk client cannot be built without nls support.  Try adding either --enable-nls or --disable-gtk" )
     294        use_libappindicator=yes
     295        AC_DEFINE([HAVE_LIBAPPINDICATOR], 1)
     296    else
     297        LIBAPPINDICATOR_CFLAGS=
     298        LIBAPPINDICATOR_LIBS=
     299    fi
    292300fi
    293301
     
    441449   Build Command-Line client:                         ${build_cli}
    442450
    443    Build GTK+ client:                                 ${build_gtk}
     451   Build GTK+ client:                                 ${with_gtk}
    444452      * libappindicator for an Ubuntu-style tray:     ${use_libappindicator}
    445453
Note: See TracChangeset for help on using the changeset viewer.