Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 376795
Collapse All | Expand All

(-)a/cli/Makefile.am (-1 / +1 lines)
Lines 18-25 transmission_cli_SOURCES = cli.c Link Here
18
18
19
transmission_cli_LDADD = \
19
transmission_cli_LDADD = \
20
    $(top_builddir)/libtransmission/libtransmission.a \
20
    $(top_builddir)/libtransmission/libtransmission.a \
21
    @LIBUPNP_LIBS@ \
21
    $(top_builddir)/third-party/libnatpmp/libnatpmp.a \
22
    $(top_builddir)/third-party/libnatpmp/libnatpmp.a \
22
    $(top_builddir)/third-party/miniupnp/libminiupnp.a \
23
    @DHT_LIBS@ \
23
    @DHT_LIBS@ \
24
    @LIBUTP_LIBS@ \
24
    @LIBUTP_LIBS@ \
25
    @LIBEVENT_LIBS@ \
25
    @LIBEVENT_LIBS@ \
(-)a/configure.ac (-1 / +72 lines)
Lines 241-246 AC_MSG_RESULT([$build_utp]) Link Here
241
241
242
dnl ----------------------------------------------------------------------------
242
dnl ----------------------------------------------------------------------------
243
dnl
243
dnl
244
dnl  Allow usage of system miniupnp library
245
LIBUPNP_CFLAGS="-I\$(top_srcdir)/third-party/"
246
LIBUPNP_LIBS="\$(top_builddir)/third-party/miniupnp/libminiupnp.a"
247
LIBUPNP_LIBS_QT="\$\${TRANSMISSION_TOP}/third-party/miniupnp/libminiupnp.a"
248
build_bundled_miniupnp="yes"
249
AC_ARG_ENABLE([external-miniupnp],
250
              AS_HELP_STRING([--enable-external-miniupnp],[Use system external-miniupnp]),
251
              [want_external_miniupnp=${enableval}],
252
              [want_external_miniupnp=no])
253
if test "x$want_external_miniupnp" != "xno" ; then
254
    AC_DEFINE([SYSTEM_MINIUPNP])
255
    ac_save_LIBS="$LIBS"
256
    LIBS="-lminiupnpc"
257
    # Check miniupnp 1.5
258
    AC_TRY_LINK([
259
    #include <stdlib.h>
260
    #include <miniupnpc/miniupnpc.h>
261
    #include <miniupnpc/upnpcommands.h>
262
    ],[
263
        struct UPNPDev * devlist;
264
        struct UPNPUrls    urls;
265
        struct IGDdatas    data;
266
        char lanaddr[16];
267
        char portStr[8];
268
        char intPort[8];
269
        char intClient[16];
270
        upnpDiscover( 2000, NULL, NULL, 0 );
271
        UPNP_GetValidIGD( devlist, &urls, &data, lanaddr, sizeof( lanaddr ) ); 
272
        UPNP_GetSpecificPortMappingEntry( urls.controlURL, data.first.servicetype,
273
                            portStr, "TCP", intClient, intPort );
274
    ],[
275
    AC_DEFINE(HAVE_MINIUPNP_15, 1, [Define to 1 if you have miniupnpc version 1.5])
276
    build_bundled_miniupnp="no"])
277
    
278
    # Check miniupnp 1.6
279
    AC_TRY_LINK([
280
    #include <stdlib.h>
281
    #include <errno.h>
282
    #include <miniupnpc/miniupnpc.h>
283
    #include <miniupnpc/upnpcommands.h>
284
    ],[
285
        struct UPNPDev * devlist;
286
        struct UPNPUrls    urls;
287
        struct IGDdatas    data;
288
        char lanaddr[16];
289
        char portStr[8];
290
        char intPort[8];
291
        char intClient[16];
292
	upnpDiscover( 2000, NULL, NULL, 0, 0, &errno );
293
        UPNP_GetValidIGD( devlist, &urls, &data, lanaddr, sizeof( lanaddr ) ); 
294
        UPNP_GetSpecificPortMappingEntry( urls.controlURL, data.first.servicetype,
295
                            portStr, "TCP", intClient, intPort, NULL, NULL, NULL );
296
    ],[
297
    AC_DEFINE(HAVE_MINIUPNP_16, 1, [Define to 1 if you have miniupnpc version 1.6])
298
    build_bundled_miniupnp="no"])
299
300
    if test "x$build_bundled_miniupnp" = "xno" ; then
301
        LIBUPNP_CFLAGS="" 
302
        LIBUPNP_LIBS="-lminiupnpc"
303
        LIBUPNP_LIBS_QT="-lminiupnpc"
304
    else
305
        AC_MSG_ERROR("Requested system libminiupnp but it is not found")
306
    fi
307
    LIBS="$ac_save_LIBS"
308
fi
309
AM_CONDITIONAL([BUILD_MINIUPNP],[test "x$build_bundled_miniupnp" = "xyes"])
310
AC_SUBST(LIBUPNP_CFLAGS)
311
AC_SUBST(LIBUPNP_LIBS)
312
AC_SUBST(LIBUPNP_LIBS_QT)
313
dnl ----------------------------------------------------------------------------
314
dnl
244
dnl  detection for the GTK+ client
315
dnl  detection for the GTK+ client
245
316
246
PKG_CHECK_MODULES(GTK,
317
PKG_CHECK_MODULES(GTK,
Lines 492-498 AC_CONFIG_FILES([Makefile Link Here
492
                 libtransmission/Makefile
563
                 libtransmission/Makefile
493
                 utils/Makefile
564
                 utils/Makefile
494
                 third-party/Makefile
565
                 third-party/Makefile
495
                 third-party/miniupnp/Makefile
566
		 third-party/miniupnp/Makefile
496
                 third-party/libnatpmp/Makefile
567
                 third-party/libnatpmp/Makefile
497
                 third-party/libutp/Makefile
568
                 third-party/libutp/Makefile
498
                 third-party/dht/Makefile
569
                 third-party/dht/Makefile
(-)a/daemon/Makefile.am (-1 / +1 lines)
Lines 20-26 bin_PROGRAMS = \ Link Here
20
20
21
LDADD = \
21
LDADD = \
22
    $(top_builddir)/libtransmission/libtransmission.a \
22
    $(top_builddir)/libtransmission/libtransmission.a \
23
    $(top_builddir)/third-party/miniupnp/libminiupnp.a \
23
    @LIBUPNP_LIBS@ \
24
    $(top_builddir)/third-party/libnatpmp/libnatpmp.a \
24
    $(top_builddir)/third-party/libnatpmp/libnatpmp.a \
25
    @DHT_LIBS@ \
25
    @DHT_LIBS@ \
26
    @LIBUTP_LIBS@ \
26
    @LIBUTP_LIBS@ \
(-)a/gtk/Makefile.am (-1 / +1 lines)
Lines 93-99 dist_man_MANS = transmission-gtk.1 Link Here
93
93
94
transmission_gtk_LDADD = \
94
transmission_gtk_LDADD = \
95
    $(top_builddir)/libtransmission/libtransmission.a \
95
    $(top_builddir)/libtransmission/libtransmission.a \
96
    $(top_builddir)/third-party/miniupnp/libminiupnp.a \
96
    @LIBUPNP_LIBS@ \
97
    $(top_builddir)/third-party/libnatpmp/libnatpmp.a \
97
    $(top_builddir)/third-party/libnatpmp/libnatpmp.a \
98
    @LIBCANBERRA_LIBS@ \
98
    @LIBCANBERRA_LIBS@ \
99
    @GCONF2_LIBS@ \
99
    @GCONF2_LIBS@ \
(-)a/libtransmission/Makefile.am (-1 / +2 lines)
Lines 8-13 AM_CPPFLAGS = \ Link Here
8
AM_CFLAGS = \
8
AM_CFLAGS = \
9
    @DHT_CFLAGS@ \
9
    @DHT_CFLAGS@ \
10
    @LIBUTP_CFLAGS@ \
10
    @LIBUTP_CFLAGS@ \
11
    @LIBUPNP_CFLAGS@ \
11
    @LIBEVENT_CFLAGS@ \
12
    @LIBEVENT_CFLAGS@ \
12
    @LIBCURL_CFLAGS@ \
13
    @LIBCURL_CFLAGS@ \
13
    @OPENSSL_CFLAGS@ \
14
    @OPENSSL_CFLAGS@ \
Lines 139-145 apps_ldflags = \ Link Here
139
140
140
apps_ldadd = \
141
apps_ldadd = \
141
    ./libtransmission.a  \
142
    ./libtransmission.a  \
142
    $(top_builddir)/third-party/miniupnp/libminiupnp.a \
143
    @LIBUPNP_LIBS@ \
143
    $(top_builddir)/third-party/libnatpmp/libnatpmp.a \
144
    $(top_builddir)/third-party/libnatpmp/libnatpmp.a \
144
    @INTLLIBS@ \
145
    @INTLLIBS@ \
145
    @DHT_LIBS@ \
146
    @DHT_LIBS@ \
(-)a/libtransmission/upnp.c (+25 lines)
Lines 13-20 Link Here
13
#include <assert.h>
13
#include <assert.h>
14
#include <errno.h>
14
#include <errno.h>
15
15
16
#ifdef SYSTEM_MINIUPNP
17
#include <miniupnpc/miniupnpc.h>
18
#include <miniupnpc/upnpcommands.h>
19
#else
16
#include <miniupnp/miniupnpc.h>
20
#include <miniupnp/miniupnpc.h>
17
#include <miniupnp/upnpcommands.h>
21
#include <miniupnp/upnpcommands.h>
22
#endif
18
23
19
#include "transmission.h"
24
#include "transmission.h"
20
#include "port-forwarding.h"
25
#include "port-forwarding.h"
Lines 97-103 tr_upnpPulse( tr_upnp * handle, Link Here
97
    {
102
    {
98
        struct UPNPDev * devlist;
103
        struct UPNPDev * devlist;
99
        errno = 0;
104
        errno = 0;
105
#ifdef HAVE_MINIUPNP_16
106
	devlist = upnpDiscover( 2000, NULL, NULL, 0, 0, &errno );
107
#else
100
        devlist = upnpDiscover( 2000, NULL, NULL, 0 );
108
        devlist = upnpDiscover( 2000, NULL, NULL, 0 );
109
#endif
101
        if( devlist == NULL )
110
        if( devlist == NULL )
102
        {
111
        {
103
            tr_ndbg(
112
            tr_ndbg(
Lines 144-152 tr_upnpPulse( tr_upnp * handle, Link Here
144
153
145
        tr_snprintf( portStr, sizeof( portStr ), "%d", handle->port );
154
        tr_snprintf( portStr, sizeof( portStr ), "%d", handle->port );
146
        if( UPNP_GetSpecificPortMappingEntry( handle->urls.controlURL, handle->data.first.servicetype,
155
        if( UPNP_GetSpecificPortMappingEntry( handle->urls.controlURL, handle->data.first.servicetype,
156
#ifdef HAVE_MINIUPNP_16
157
            portStr, "TCP", intClient, intPort, NULL, NULL, NULL ) != UPNPCOMMAND_SUCCESS  ||
158
#else	    
147
            portStr, "TCP", intClient, intPort ) != UPNPCOMMAND_SUCCESS  ||
159
            portStr, "TCP", intClient, intPort ) != UPNPCOMMAND_SUCCESS  ||
160
#endif
148
            UPNP_GetSpecificPortMappingEntry( handle->urls.controlURL, handle->data.first.servicetype,
161
            UPNP_GetSpecificPortMappingEntry( handle->urls.controlURL, handle->data.first.servicetype,
162
#ifdef HAVE_MINIUPNP_16
163
            portStr, "UDP", intClient, intPort, NULL, NULL, NULL ) != UPNPCOMMAND_SUCCESS )
164
#else	    
149
            portStr, "UDP", intClient, intPort ) != UPNPCOMMAND_SUCCESS )
165
            portStr, "UDP", intClient, intPort ) != UPNPCOMMAND_SUCCESS )
166
#endif
150
        {
167
        {
151
            tr_ninf( getKey( ), _( "Port %d isn't forwarded" ), handle->port );
168
            tr_ninf( getKey( ), _( "Port %d isn't forwarded" ), handle->port );
152
            handle->isMapped = false;
169
            handle->isMapped = false;
Lines 198-204 tr_upnpPulse( tr_upnp * handle, Link Here
198
            err_tcp = UPNP_AddPortMapping( handle->urls.controlURL,
215
            err_tcp = UPNP_AddPortMapping( handle->urls.controlURL,
199
                                       handle->data.first.servicetype,
216
                                       handle->data.first.servicetype,
200
                                       portStr, portStr, handle->lanaddr,
217
                                       portStr, portStr, handle->lanaddr,
218
#ifdef HAVE_MINIUPNP_16
219
				       desc, "TCP", NULL, NULL );
220
#else
201
                                       desc, "TCP", NULL );
221
                                       desc, "TCP", NULL );
222
#endif
202
            if( err_tcp )
223
            if( err_tcp )
203
                tr_ndbg( getKey( ), "TCP Port forwarding failed with error %d (errno %d - %s)",
224
                tr_ndbg( getKey( ), "TCP Port forwarding failed with error %d (errno %d - %s)",
204
                         err_tcp, errno, tr_strerror( errno ) );
225
                         err_tcp, errno, tr_strerror( errno ) );
Lines 207-213 tr_upnpPulse( tr_upnp * handle, Link Here
207
            err_udp = UPNP_AddPortMapping( handle->urls.controlURL,
228
            err_udp = UPNP_AddPortMapping( handle->urls.controlURL,
208
                                       handle->data.first.servicetype,
229
                                       handle->data.first.servicetype,
209
                                       portStr, portStr, handle->lanaddr,
230
                                       portStr, portStr, handle->lanaddr,
231
#ifdef HAVE_MINIUPNP_16
232
				       desc, "UDP", NULL, NULL );
233
#else
210
                                       desc, "UDP", NULL );
234
                                       desc, "UDP", NULL );
235
#endif
211
            if( err_udp )
236
            if( err_udp )
212
                tr_ndbg( getKey( ), "UDP Port forwarding failed with error %d (errno %d - %s)",
237
                tr_ndbg( getKey( ), "UDP Port forwarding failed with error %d (errno %d - %s)",
213
                         err_udp, errno, tr_strerror( errno ) );
238
                         err_udp, errno, tr_strerror( errno ) );
(-)a/qt/config.in (+2 lines)
Line 1 Link Here
1
LIBUTP_LIBS = @LIBUTP_LIBS_QT@
1
LIBUTP_LIBS = @LIBUTP_LIBS_QT@
2
MINIUPNP_LIBS = @LIBUPNP_LIBS_QT@
3
(-)a/qt/qtr.pro (-1 / +1 lines)
Lines 23-29 INCLUDEPATH += $${TRANSMISSION_TOP} Link Here
23
LIBS += $${TRANSMISSION_TOP}/libtransmission/libtransmission.a
23
LIBS += $${TRANSMISSION_TOP}/libtransmission/libtransmission.a
24
LIBS += $${LIBUTP_LIBS}
24
LIBS += $${LIBUTP_LIBS}
25
LIBS += $${TRANSMISSION_TOP}/third-party/dht/libdht.a
25
LIBS += $${TRANSMISSION_TOP}/third-party/dht/libdht.a
26
LIBS += $${TRANSMISSION_TOP}/third-party/miniupnp/libminiupnp.a
26
LIBS += $${MINIUPNP_LIBS}
27
LIBS += $${TRANSMISSION_TOP}/third-party/libnatpmp/libnatpmp.a
27
LIBS += $${TRANSMISSION_TOP}/third-party/libnatpmp/libnatpmp.a
28
unix: LIBS += -L$${EVENT_TOP}/lib -lz -lrt
28
unix: LIBS += -L$${EVENT_TOP}/lib -lz -lrt
29
win32:DEFINES += QT_DBUS
29
win32:DEFINES += QT_DBUS
(-)a/third-party/Makefile.am (-1 / +4 lines)
Lines 1-11 Link Here
1
if BUILD_UTP
1
if BUILD_UTP
2
  UTP_DIR = libutp
2
  UTP_DIR = libutp
3
endif
3
endif
4
if BUILD_MINIUPNP
5
  MINIUPNP_DIR = miniupnp
6
endif
4
7
5
SUBDIRS = \
8
SUBDIRS = \
6
  dht \
9
  dht \
7
  libnatpmp \
10
  libnatpmp \
8
  miniupnp \
11
  $(MINIUPNP_DIR) \
9
  $(UTP_DIR)
12
  $(UTP_DIR)
10
13
11
EXTRA_DIST = \
14
EXTRA_DIST = \
(-)a/utils/Makefile.am (-2 / +1 lines)
Lines 26-32 dist_man_MANS = \ Link Here
26
26
27
transmission_create_LDADD = \
27
transmission_create_LDADD = \
28
    $(top_builddir)/libtransmission/libtransmission.a \
28
    $(top_builddir)/libtransmission/libtransmission.a \
29
    $(top_builddir)/third-party/miniupnp/libminiupnp.a \
29
    @LIBUPNP_LIBS@ \
30
    $(top_builddir)/third-party/libnatpmp/libnatpmp.a \
30
    $(top_builddir)/third-party/libnatpmp/libnatpmp.a \
31
    @INTLLIBS@ \
31
    @INTLLIBS@ \
32
    @DHT_LIBS@ \
32
    @DHT_LIBS@ \
33
- 

Return to bug 376795