Changeset 8967


Ignore:
Timestamp:
Aug 18, 2009, 4:02:16 PM (13 years ago)
Author:
charles
Message:

(trunk) un-remove the conditional DHT compiling for now for reasons discussed @ http://lists.opensuse.org/opensuse-gnome/2009-08/msg00033.html. I'll re-remove it for 1.80. :)

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure.ac

    r8901 r8967  
    204204dnl  dht
    205205
    206 DHT_CFLAGS="-I\$(top_srcdir)/third-party/dht"
    207 DHT_LIBS="\$(top_builddir)/third-party/dht/libdht.a"
     206
     207AC_ARG_ENABLE([dht],
     208              AS_HELP_STRING([--disable-dht],[omit DHT support]),
     209              [enable_dht=${enableval}],
     210              [enable_dht=yes])
     211if test "x$enable_dht" = "xno" ; then
     212    AC_DEFINE([WITHOUT_DHT], 1)
     213    DHT_CFLAGS=""
     214    DHT_LIBS=""
     215else
     216    DHT_CFLAGS="-I\$(top_srcdir)/third-party/dht"
     217    DHT_LIBS="\$(top_builddir)/third-party/dht/libdht.a"
     218fi
     219AM_CONDITIONAL(DHT, test "x$enable_dht" = "xyes")
    208220AC_SUBST(DHT_CFLAGS)
    209221AC_SUBST(DHT_LIBS)
     
    416428        Compiler:                      ${CXX}
    417429        System or bundled libevent:    ${libevent_source}
     430        DHT support:                   ${enable_dht}
    418431
    419432        Build Mac client:              ${build_mac}
  • trunk/libtransmission/session.c

    r8910 r8967  
    881881    if( session->isDHTEnabled )
    882882    {
     883#ifdef WITHOUT_DHT
     884        tr_inf( "DHT disabled by packager." );
     885#else
    883886        tr_dhtInit( session, &session->public_ipv4->addr );
     887#endif
    884888    }
    885889}
     
    16421646tr_sessionAllowsDHT( const tr_session * session UNUSED )
    16431647{
     1648#ifdef WITHOUT_DHT
     1649    return 0;
     1650#else
    16441651    return tr_sessionIsDHTEnabled( session );
     1652#endif
    16451653}
    16461654
  • trunk/libtransmission/tr-dht.c

    r8903 r8967  
    5050#include "utils.h"
    5151#include "version.h"
     52
     53#ifdef WITHOUT_DHT
     54
     55  /* These are the stubs for when we're building without DHT support */
     56  int tr_dhtInit( tr_session * session UNUSED ) { return TR_DHT_STOPPED; }
     57  void tr_dhtUninit( tr_session * session UNUSED ) { }
     58  tr_bool tr_dhtEnabled( const tr_session * session UNUSED ) { return FALSE; }
     59  tr_port tr_dhtPort ( const tr_session * sesssion UNUSED ) { return 0; }
     60  int tr_dhtStatus( tr_session * session     UNUSED,
     61                    int        * setmeCount  UNUSED ) { return TR_DHT_STOPPED; }
     62  int tr_dhtAddNode( tr_session * session    UNUSED,
     63                     tr_address * addr       UNUSED,
     64                     tr_port      port       UNUSED,
     65                     tr_bool      bootstrap  UNUSED ) { return 0; }
     66  int tr_dhtAnnounce( tr_torrent * session UNUSED,
     67                      tr_bool announce UNUSED ) { return -1; }
     68
     69
     70#else
    5271
    5372static int dht_socket;
     
    440459    return size;
    441460}
     461
     462#endif
  • trunk/third-party/Makefile.am

    r8888 r8967  
    1 SUBDIRS = libnatpmp miniupnp libevent dht
     1if DHT
     2  DHT_DIR = dht
     3else
     4  DHT_DIR =
     5endif
     6
     7SUBDIRS = libnatpmp miniupnp libevent $(DHT_DIR)
    28
    39EXTRA_DIST = \
Note: See TracChangeset for help on using the changeset viewer.