Changeset 2431


Ignore:
Timestamp:
Jul 19, 2007, 2:06:50 PM (15 years ago)
Author:
charles
Message:

first baby steps of wx client. currently just a window with menus and a toolbar, and unusuable.

Location:
trunk
Files:
11 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Makefile.am

    r2407 r2431  
    1111  MAC_DIR = macosx
    1212endif
     13if HAVE_WX
     14  WX_DIR = wx
     15endif
    1316
    14 SUBDIRS = libtransmission $(DAEMON_DIR) cli $(GTK_DIR) $(BEOS_DIR) $(MAC_DIR)
     17SUBDIRS = libtransmission $(DAEMON_DIR) cli $(GTK_DIR) $(BEOS_DIR) $(MAC_DIR) $(WX_DIR)
    1518
    1619DISTCLEANFILES = \
  • trunk/acinclude.m4

    r2400 r2431  
    199199
    200200
     201dnl
     202dnl  nicked from wxwin.m4
     203dnl
     204
     205
     206dnl ---------------------------------------------------------------------------
     207dnl Macros for wxWidgets detection. Typically used in configure.in as:
     208dnl
     209dnl     AC_ARG_ENABLE(...)
     210dnl     AC_ARG_WITH(...)
     211dnl        ...
     212dnl     AM_OPTIONS_WXCONFIG
     213dnl        ...
     214dnl        ...
     215dnl     AM_PATH_WXCONFIG(2.6.0, wxWin=1)
     216dnl     if test "$wxWin" != 1; then
     217dnl        AC_MSG_ERROR([
     218dnl                wxWidgets must be installed on your system
     219dnl                but wx-config script couldn't be found.
     220dnl
     221dnl                Please check that wx-config is in path, the directory
     222dnl                where wxWidgets libraries are installed (returned by
     223dnl                'wx-config --libs' command) is in LD_LIBRARY_PATH or
     224dnl                equivalent variable and wxWidgets version is 2.3.4 or above.
     225dnl        ])
     226dnl     fi
     227dnl     CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS"
     228dnl     CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY"
     229dnl     CFLAGS="$CFLAGS $WX_CFLAGS_ONLY"
     230dnl
     231dnl     LIBS="$LIBS $WX_LIBS"
     232dnl ---------------------------------------------------------------------------
     233
     234dnl ---------------------------------------------------------------------------
     235dnl AM_OPTIONS_WXCONFIG
     236dnl
     237dnl adds support for --wx-prefix, --wx-exec-prefix, --with-wxdir and
     238dnl --wx-config command line options
     239dnl ---------------------------------------------------------------------------
     240
     241AC_DEFUN([AM_OPTIONS_WXCONFIG],
     242[
     243    AC_ARG_WITH(wxdir,
     244                [  --with-wxdir=PATH       Use uninstalled version of wxWidgets in PATH],
     245                [ wx_config_name="$withval/wx-config"
     246                  wx_config_args="--inplace"])
     247    AC_ARG_WITH(wx-config,
     248                [  --with-wx-config=CONFIG wx-config script to use (optional)],
     249                wx_config_name="$withval" )
     250    AC_ARG_WITH(wx-prefix,
     251                [  --with-wx-prefix=PREFIX Prefix where wxWidgets is installed (optional)],
     252                wx_config_prefix="$withval", wx_config_prefix="")
     253    AC_ARG_WITH(wx-exec-prefix,
     254                [  --with-wx-exec-prefix=PREFIX
     255                          Exec prefix where wxWidgets is installed (optional)],
     256                wx_config_exec_prefix="$withval", wx_config_exec_prefix="")
     257])
     258
     259dnl Helper macro for checking if wx version is at least $1.$2.$3, set's
     260dnl wx_ver_ok=yes if it is:
     261AC_DEFUN([_WX_PRIVATE_CHECK_VERSION],
     262[
     263    wx_ver_ok=""
     264    if test "x$WX_VERSION" != x ; then
     265      if test $wx_config_major_version -gt $1; then
     266        wx_ver_ok=yes
     267      else
     268        if test $wx_config_major_version -eq $1; then
     269           if test $wx_config_minor_version -gt $2; then
     270              wx_ver_ok=yes
     271           else
     272              if test $wx_config_minor_version -eq $2; then
     273                 if test $wx_config_micro_version -ge $3; then
     274                    wx_ver_ok=yes
     275                 fi
     276              fi
     277           fi
     278        fi
     279      fi
     280    fi
     281])
     282
     283dnl ---------------------------------------------------------------------------
     284dnl AM_PATH_WXCONFIG(VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND
     285dnl                  [, WX-LIBS [, ADDITIONAL-WX-CONFIG-FLAGS]]]])
     286dnl
     287dnl Test for wxWidgets, and define WX_C*FLAGS, WX_LIBS and WX_LIBS_STATIC
     288dnl (the latter is for static linking against wxWidgets). Set WX_CONFIG_NAME
     289dnl environment variable to override the default name of the wx-config script
     290dnl to use. Set WX_CONFIG_PATH to specify the full path to wx-config - in this
     291dnl case the macro won't even waste time on tests for its existence.
     292dnl
     293dnl Optional WX-LIBS argument contains comma- or space-separated list of
     294dnl wxWidgets libraries to link against (it may include contrib libraries). If
     295dnl it is not specified then WX_LIBS and WX_LIBS_STATIC will contain flags to
     296dnl link with all of the core wxWidgets libraries.
     297dnl
     298dnl Optional ADDITIONAL-WX-CONFIG-FLAGS argument is appended to wx-config
     299dnl invocation command in present. It can be used to fine-tune lookup of
     300dnl best wxWidgets build available.
     301dnl
     302dnl Example use:
     303dnl   AM_PATH_WXCONFIG([2.6.0], [wxWin=1], [wxWin=0], [html,core,net]
     304dnl                    [--unicode --debug])
     305dnl ---------------------------------------------------------------------------
     306
     307dnl
     308dnl Get the cflags and libraries from the wx-config script
     309dnl
     310AC_DEFUN([AM_PATH_WXCONFIG],
     311[
     312  dnl do we have wx-config name: it can be wx-config or wxd-config or ...
     313  if test x${WX_CONFIG_NAME+set} != xset ; then
     314     WX_CONFIG_NAME=wx-config
     315  fi
     316
     317  if test "x$wx_config_name" != x ; then
     318     WX_CONFIG_NAME="$wx_config_name"
     319  fi
     320
     321  dnl deal with optional prefixes
     322  if test x$wx_config_exec_prefix != x ; then
     323     wx_config_args="$wx_config_args --exec-prefix=$wx_config_exec_prefix"
     324     WX_LOOKUP_PATH="$wx_config_exec_prefix/bin"
     325  fi
     326  if test x$wx_config_prefix != x ; then
     327     wx_config_args="$wx_config_args --prefix=$wx_config_prefix"
     328     WX_LOOKUP_PATH="$WX_LOOKUP_PATH:$wx_config_prefix/bin"
     329  fi
     330  if test "$cross_compiling" = "yes"; then
     331     wx_config_args="$wx_config_args --host=$host_alias"
     332  fi
     333
     334  dnl don't search the PATH if WX_CONFIG_NAME is absolute filename
     335  if test -x "$WX_CONFIG_NAME" ; then
     336     AC_MSG_CHECKING(for wx-config)
     337     WX_CONFIG_PATH="$WX_CONFIG_NAME"
     338     AC_MSG_RESULT($WX_CONFIG_PATH)
     339  else
     340     AC_PATH_PROG(WX_CONFIG_PATH, $WX_CONFIG_NAME, no, "$WX_LOOKUP_PATH:$PATH")
     341  fi
     342
     343  if test "$WX_CONFIG_PATH" != "no" ; then
     344    WX_VERSION=""
     345
     346    min_wx_version=ifelse([$1], ,2.2.1,$1)
     347    if test -z "$5" ; then
     348      AC_MSG_CHECKING([for wxWidgets version >= $min_wx_version])
     349    else
     350      AC_MSG_CHECKING([for wxWidgets version >= $min_wx_version ($5)])
     351    fi
     352
     353    WX_CONFIG_WITH_ARGS="$WX_CONFIG_PATH $wx_config_args $5 $4"
     354
     355    WX_VERSION=`$WX_CONFIG_WITH_ARGS --version 2>/dev/null`
     356    wx_config_major_version=`echo $WX_VERSION | \
     357           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
     358    wx_config_minor_version=`echo $WX_VERSION | \
     359           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
     360    wx_config_micro_version=`echo $WX_VERSION | \
     361           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
     362
     363    wx_requested_major_version=`echo $min_wx_version | \
     364           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
     365    wx_requested_minor_version=`echo $min_wx_version | \
     366           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
     367    wx_requested_micro_version=`echo $min_wx_version | \
     368           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
     369
     370    _WX_PRIVATE_CHECK_VERSION([$wx_requested_major_version],
     371                              [$wx_requested_minor_version],
     372                              [$wx_requested_micro_version])
     373
     374    if test -n "$wx_ver_ok"; then
     375
     376      AC_MSG_RESULT(yes (version $WX_VERSION))
     377      WX_LIBS=`$WX_CONFIG_WITH_ARGS --libs`
     378
     379      dnl is this even still appropriate?  --static is a real option now
     380      dnl and WX_CONFIG_WITH_ARGS is likely to contain it if that is
     381      dnl what the user actually wants, making this redundant at best.
     382      dnl For now keep it in case anyone actually used it in the past.
     383      AC_MSG_CHECKING([for wxWidgets static library])
     384      WX_LIBS_STATIC=`$WX_CONFIG_WITH_ARGS --static --libs 2>/dev/null`
     385      if test "x$WX_LIBS_STATIC" = "x"; then
     386        AC_MSG_RESULT(no)
     387      else
     388        AC_MSG_RESULT(yes)
     389      fi
     390
     391      dnl starting with version 2.2.6 wx-config has --cppflags argument
     392      wx_has_cppflags=""
     393      if test $wx_config_major_version -gt 2; then
     394        wx_has_cppflags=yes
     395      else
     396        if test $wx_config_major_version -eq 2; then
     397           if test $wx_config_minor_version -gt 2; then
     398              wx_has_cppflags=yes
     399           else
     400              if test $wx_config_minor_version -eq 2; then
     401                 if test $wx_config_micro_version -ge 6; then
     402                    wx_has_cppflags=yes
     403                 fi
     404              fi
     405           fi
     406        fi
     407      fi
     408
     409      dnl starting with version 2.7.0 wx-config has --rescomp option
     410      wx_has_rescomp=""
     411      if test $wx_config_major_version -gt 2; then
     412        wx_has_rescomp=yes
     413      else
     414        if test $wx_config_major_version -eq 2; then
     415           if test $wx_config_minor_version -ge 7; then
     416              wx_has_rescomp=yes
     417           fi
     418        fi
     419      fi
     420      if test "x$wx_has_rescomp" = x ; then
     421         dnl cannot give any useful info for resource compiler
     422         WX_RESCOMP=
     423      else
     424         WX_RESCOMP=`$WX_CONFIG_WITH_ARGS --rescomp`
     425      fi
     426
     427      if test "x$wx_has_cppflags" = x ; then
     428         dnl no choice but to define all flags like CFLAGS
     429         WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags`
     430         WX_CPPFLAGS=$WX_CFLAGS
     431         WX_CXXFLAGS=$WX_CFLAGS
     432
     433         WX_CFLAGS_ONLY=$WX_CFLAGS
     434         WX_CXXFLAGS_ONLY=$WX_CFLAGS
     435      else
     436         dnl we have CPPFLAGS included in CFLAGS included in CXXFLAGS
     437         WX_CPPFLAGS=`$WX_CONFIG_WITH_ARGS --cppflags`
     438         WX_CXXFLAGS=`$WX_CONFIG_WITH_ARGS --cxxflags`
     439         WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags`
     440
     441         WX_CFLAGS_ONLY=`echo $WX_CFLAGS | sed "s@^$WX_CPPFLAGS *@@"`
     442         WX_CXXFLAGS_ONLY=`echo $WX_CXXFLAGS | sed "s@^$WX_CFLAGS *@@"`
     443      fi
     444
     445      ifelse([$2], , :, [$2])
     446
     447    else
     448
     449       if test "x$WX_VERSION" = x; then
     450          dnl no wx-config at all
     451          AC_MSG_RESULT(no)
     452       else
     453          AC_MSG_RESULT(no (version $WX_VERSION is not new enough))
     454       fi
     455
     456       WX_CFLAGS=""
     457       WX_CPPFLAGS=""
     458       WX_CXXFLAGS=""
     459       WX_LIBS=""
     460       WX_LIBS_STATIC=""
     461       WX_RESCOMP=""
     462       ifelse([$3], , :, [$3])
     463
     464    fi
     465  else
     466
     467    WX_CFLAGS=""
     468    WX_CPPFLAGS=""
     469    WX_CXXFLAGS=""
     470    WX_LIBS=""
     471    WX_LIBS_STATIC=""
     472    WX_RESCOMP=""
     473
     474    ifelse([$3], , :, [$3])
     475
     476  fi
     477
     478  AC_SUBST(WX_CPPFLAGS)
     479  AC_SUBST(WX_CFLAGS)
     480  AC_SUBST(WX_CXXFLAGS)
     481  AC_SUBST(WX_CFLAGS_ONLY)
     482  AC_SUBST(WX_CXXFLAGS_ONLY)
     483  AC_SUBST(WX_LIBS)
     484  AC_SUBST(WX_LIBS_STATIC)
     485  AC_SUBST(WX_VERSION)
     486  AC_SUBST(WX_RESCOMP)
     487])
     488
     489dnl ---------------------------------------------------------------------------
     490dnl Get information on the wxrc program for making C++, Python and xrs
     491dnl resource files.
     492dnl
     493dnl     AC_ARG_ENABLE(...)
     494dnl     AC_ARG_WITH(...)
     495dnl        ...
     496dnl     AM_OPTIONS_WXCONFIG
     497dnl        ...
     498dnl     AM_PATH_WXCONFIG(2.6.0, wxWin=1)
     499dnl     if test "$wxWin" != 1; then
     500dnl        AC_MSG_ERROR([
     501dnl                wxWidgets must be installed on your system
     502dnl                but wx-config script couldn't be found.
     503dnl
     504dnl                Please check that wx-config is in path, the directory
     505dnl                where wxWidgets libraries are installed (returned by
     506dnl                'wx-config --libs' command) is in LD_LIBRARY_PATH or
     507dnl                equivalent variable and wxWidgets version is 2.6.0 or above.
     508dnl        ])
     509dnl     fi
     510dnl
     511dnl     AM_PATH_WXRC([HAVE_WXRC=1], [HAVE_WXRC=0])
     512dnl     if test "x$HAVE_WXRC" != x1; then
     513dnl         AC_MSG_ERROR([
     514dnl                The wxrc program was not installed or not found.
     515dnl     
     516dnl                Please check the wxWidgets installation.
     517dnl         ])
     518dnl     fi
     519dnl
     520dnl     CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS"
     521dnl     CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY"
     522dnl     CFLAGS="$CFLAGS $WX_CFLAGS_ONLY"
     523dnl
     524dnl     LDFLAGS="$LDFLAGS $WX_LIBS"
     525dnl ---------------------------------------------------------------------------
     526
     527
     528
     529dnl ---------------------------------------------------------------------------
     530dnl AM_PATH_WXRC([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
     531dnl
     532dnl Test for wxWidgets' wxrc program for creating either C++, Python or XRS
     533dnl resources.  The variable WXRC will be set and substituted in the configure
     534dnl script and Makefiles.
     535dnl
     536dnl Example use:
     537dnl   AM_PATH_WXRC([wxrc=1], [wxrc=0])
     538dnl ---------------------------------------------------------------------------
     539
     540dnl
     541dnl wxrc program from the wx-config script
     542dnl
     543AC_DEFUN([AM_PATH_WXRC],
     544[
     545  AC_ARG_VAR([WXRC], [Path to wxWidget's wxrc resource compiler])
     546   
     547  if test "x$WX_CONFIG_NAME" = x; then
     548    AC_MSG_ERROR([The wxrc tests must run after wxWidgets test.])
     549  else
     550   
     551    AC_MSG_CHECKING([for wxrc])
     552   
     553    if test "x$WXRC" = x ; then
     554      dnl wx-config --utility is a new addition to wxWidgets:
     555      _WX_PRIVATE_CHECK_VERSION(2,5,3)
     556      if test -n "$wx_ver_ok"; then
     557        WXRC=`$WX_CONFIG_WITH_ARGS --utility=wxrc`
     558      fi
     559    fi
     560
     561    if test "x$WXRC" = x ; then
     562      AC_MSG_RESULT([not found])
     563      ifelse([$2], , :, [$2])
     564    else
     565      AC_MSG_RESULT([$WXRC])
     566      ifelse([$1], , :, [$1])
     567    fi
     568   
     569    AC_SUBST(WXRC)
     570  fi
     571])
  • trunk/autogen.sh

    r2400 r2431  
    11#!/bin/sh
    2 autoreconf --force --install -I config -I m4 --verbose
     2autoreconf --force --install -I config -I m4
  • trunk/configure.ac

    r2422 r2431  
    6060dnl ----------------------------------------------------------------------------
    6161dnl
    62 dnl  GTK+ detection for the GTK+ client
     62dnl  detection for the GTK+ client
    6363
    6464AM_PATH_GTK_2_0($GTK_MINIMUM,[have_gtk=yes],[have_gtk=no][gthread])
     
    7777fi
    7878AM_CONDITIONAL([WITH_GTK],[test "x$use_gtk" = "xyes"])
     79
     80
     81dnl ----------------------------------------------------------------------------
     82dnl
     83dnl  wxWidgets detection for the wxWidgets client
     84
     85
     86AM_OPTIONS_WXCONFIG
     87AM_PATH_WXCONFIG($WX_MINIMUM,[have_wx=yes],[have_wx=no])
     88AC_ARG_WITH(wx, AC_HELP_STRING([--with-wx], [Build wxWidgets client]),
     89                [want_wx=$withval],
     90                [want_wx=$have_wx])
     91use_wx=no
     92if test "x$want_wx" = "xyes" ; then
     93    if test "x$have_wx" = "xyes"; then
     94      use_wx=yes
     95    else
     96      AC_MSG_ERROR("wxWidgets not found!")
     97    fi
     98fi
     99AM_CONDITIONAL([HAVE_WX],[test "x$use_wx" = "xyes"])
    79100
    80101
     
    202223                 libtransmission/version.h
    203224                 macosx/Makefile
    204                  macosx/Info.plist])
     225                 macosx/Info.plist
     226                 wx/Makefile
     227                 wx/xpm/Makefile])
    205228
    206229AC_OUTPUT
     
    210233Configuration:
    211234
    212         Source code location:  ${srcdir}
    213         Compiler:              ${CXX}
    214         Build BeOS client:     ${beos}
    215         Build Daemon:          ${use_libevent}
    216         Build GTK+ client:     ${use_gtk}
    217         Build OS X client:     ${darwin}
     235        Source code location:    ${srcdir}
     236        Compiler:                ${CXX}
     237        Build BeOS client:       ${beos}
     238        Build Daemon:            ${use_libevent}
     239        Build GTK+ client:       ${use_gtk}
     240        Build OS X client:       ${darwin}
     241        Build wxWidgets client:  ${use_wx}
    218242
    219243"
Note: See TracChangeset for help on using the changeset viewer.