Line 0
Link Here
|
|
|
1 |
Index: configure.ac |
2 |
=================================================================== |
3 |
--- configure.ac (revision 14339) |
4 |
+++ configure.ac (working copy) |
5 |
@@ -196,8 +196,23 @@ dnl dht |
6 |
|
7 |
DHT_CFLAGS="-I\$(top_srcdir)/third-party/dht" |
8 |
DHT_LIBS="\$(top_builddir)/third-party/dht/libdht.a" |
9 |
+DHT_LIBS_QT="\$(top_builddir)/third-party/dht/libdht.a" |
10 |
+build_bundled_dht="yes" |
11 |
+AC_ARG_ENABLE([external-dht], |
12 |
+ AS_HELP_STRING([--enable-external-dht],[Use system external-dht]), |
13 |
+ [want_external_dht=${enableval}], |
14 |
+ [want_external_dht=no]) |
15 |
+if test "x$want_external_dht" != "xno" ; then |
16 |
+ dnl Would be lovely if it had pkgconfig |
17 |
+ DHT_CFLAGS="" |
18 |
+ DHT_LIBS="-ldht" |
19 |
+ DHT_LIBS_QT="-ldht" |
20 |
+ build_bundled_dht="no" |
21 |
+fi |
22 |
+AM_CONDITIONAL([BUILD_DHT],[test "x$build_bundled_dht" = "xyes"]) |
23 |
AC_SUBST(DHT_CFLAGS) |
24 |
AC_SUBST(DHT_LIBS) |
25 |
+AC_SUBST(DHT_LIBS_QT) |
26 |
|
27 |
|
28 |
dnl ---------------------------------------------------------------------------- |
29 |
@@ -211,17 +226,30 @@ AC_CHECK_LIB([rt], |
30 |
|
31 |
AC_MSG_CHECKING([µTP]) |
32 |
build_utp="no" |
33 |
-if test "x$CXX" != "x" ; then |
34 |
- have_utp="yes" |
35 |
-else |
36 |
- have_utp="no" |
37 |
-fi |
38 |
+ |
39 |
+ac_save_LIBS="$LIBS" |
40 |
+LIBS="-lutp" |
41 |
+AC_LINK_IFELSE( |
42 |
+ [AC_LANG_PROGRAM([#include <libutp/utp.h>], |
43 |
+ [struct UTPFunctionTable func;])], |
44 |
+ [have_utp="yes"], |
45 |
+ [have_utp="no"] |
46 |
+) |
47 |
+LIBS=$ac_save_LIBS |
48 |
+ |
49 |
AC_ARG_ENABLE([utp], |
50 |
AS_HELP_STRING([--enable-utp],[build µTP support]), |
51 |
[want_utp=${enableval}], |
52 |
- [want_utp=${have_utp}]) |
53 |
-if test "x$want_utp" = "xyes" ; then |
54 |
+ [want_utp=yes]) |
55 |
+if test "x$want_utp" = "xyes"; then |
56 |
if test "x$have_utp" = "xyes"; then |
57 |
+ dnl Would be lovely if it had pkgconfig |
58 |
+ LIBUTP_CFLAGS="" |
59 |
+ LIBUTP_LIBS="-lutp" |
60 |
+ LIBUTP_LIBS_QT="-lutp" |
61 |
+ AC_DEFINE([WITH_UTP],[1]) |
62 |
+ build_utp="system" |
63 |
+ elif test "x$CXX" != "x"; then |
64 |
LIBUTP_CFLAGS="-I\$(top_srcdir)/third-party/" |
65 |
LIBUTP_LIBS="\$(top_builddir)/third-party/libutp/libutp.a" |
66 |
LIBUTP_LIBS_QT="\$\${TRANSMISSION_TOP}/third-party/libutp/libutp.a" |
67 |
Index: qt/config.pri.in |
68 |
=================================================================== |
69 |
--- qt/config.pri.in (revision 14339) |
70 |
+++ qt/config.pri.in (working copy) |
71 |
@@ -1,3 +1,4 @@ |
72 |
+DHT_LIBS = @DHT_LIBS_QT@ |
73 |
LIBUTP_LIBS = @LIBUTP_LIBS_QT@ |
74 |
LIBUPNP_LIBS = @LIBUPNP_LIBS_QT@ |
75 |
LIBNATPMP_LIBS = @LIBNATPMP_LIBS_QT@ |
76 |
Index: qt/qtr.pro |
77 |
=================================================================== |
78 |
--- qt/qtr.pro (revision 14339) |
79 |
+++ qt/qtr.pro (working copy) |
80 |
@@ -27,7 +27,7 @@ INCLUDEPATH = $${EVENT_TOP}/include $${INCLUDEPATH |
81 |
INCLUDEPATH += $${TRANSMISSION_TOP} |
82 |
LIBS += $${TRANSMISSION_TOP}/libtransmission/libtransmission.a |
83 |
LIBS += $${LIBUTP_LIBS} |
84 |
-LIBS += $${TRANSMISSION_TOP}/third-party/dht/libdht.a |
85 |
+LIBS += $${DHT_LIBS} |
86 |
LIBS += $${LIBUPNP_LIBS} |
87 |
LIBS += $${LIBNATPMP_LIBS} |
88 |
unix: LIBS += -L$${EVENT_TOP}/lib -lz -lrt |
89 |
Index: third-party/Makefile.am |
90 |
=================================================================== |
91 |
--- third-party/Makefile.am (revision 14339) |
92 |
+++ third-party/Makefile.am (working copy) |
93 |
@@ -1,3 +1,6 @@ |
94 |
+if BUILD_DHT |
95 |
+ DHT_DIR = dht |
96 |
+endif |
97 |
if BUILD_UTP |
98 |
UTP_DIR = libutp |
99 |
endif |
100 |
@@ -9,7 +12,7 @@ if BUILD_NATPMP |
101 |
endif |
102 |
|
103 |
SUBDIRS = \ |
104 |
- dht \ |
105 |
+ $(DHT_DIR) \ |
106 |
$(NATPMP_DIR) \ |
107 |
$(MINIUPNP_DIR) \ |
108 |
$(UTP_DIR) |