]> granicus.if.org Git - transmission/commitdiff
(trunk) #4490 "Transmission 2.40b1 fails to build: undefined references" -- fixed.
authorJordan Lee <jordan@transmissionbt.com>
Sat, 8 Oct 2011 23:53:27 +0000 (23:53 +0000)
committerJordan Lee <jordan@transmissionbt.com>
Sat, 8 Oct 2011 23:53:27 +0000 (23:53 +0000)
configure.ac
libtransmission/net.c
libtransmission/peer-io.c
libtransmission/peer-mgr.c
libtransmission/tr-utp.c
libtransmission/tr-utp.h
qt/qtr.pro
third-party/libutp/utypes.h

index 37cb99d90d1798766f485b39e5705622c3657950..02701f75a2243345e8b65275a7e81cda1367ab50 100644 (file)
@@ -70,6 +70,7 @@ AC_SUBST(LIBAPPINDICATOR_MINIMUM)
 
 AC_PROG_CC
 AC_PROG_CXX
+AC_CHECK_PROG([HAVE_CXX],[$CXX],[yes],[no])
 AC_C_INLINE
 if test "x$GCC" = "xyes" ; then
 
@@ -205,10 +206,10 @@ AC_CHECK_LIB([rt],
 
 AC_MSG_CHECKING([µTP])
 build_utp="no"
-if test "x$CXX" = "x" ; then
-    have_utp="no"
-else
+if test "x$HAVE_CXX" = "xyes" ; then
     have_utp="yes"
+else
+    have_utp="no"
 fi
 AC_ARG_ENABLE([utp],
               AS_HELP_STRING([--enable-utp],[build µTP support]),
@@ -409,7 +410,6 @@ AC_CONFIG_FILES([Makefile
                  third-party/Makefile
                  third-party/miniupnp/Makefile
                  third-party/libnatpmp/Makefile
-                 third-party/libutp/Makefile
                  third-party/dht/Makefile
                  macosx/Makefile
                  gtk/Makefile
@@ -424,6 +424,11 @@ AC_CONFIG_FILES([Makefile
                  web/stylesheets/Makefile
                  po/Makefile.in])
 
+dnl Maybe build libutp...
+AM_CONDITIONAL([CONDITIONAL],[test "x$build_utp" = "xyes"])
+AM_COND_IF([CONDITIONAL],
+           [AC_CONFIG_FILES([third-party/libutp/Makefile])])
+
 AC_OUTPUT
 
 echo "
index eb05de633b68c170f75f40184e44e156c7e75a2c..bc70c8cdea2999167e1aeb41967903ad0cef8696 100644 (file)
@@ -38,8 +38,6 @@
 
 #include <event2/util.h>
 
-#include <libutp/utp.h>
-
 #include "transmission.h"
 #include "fdlimit.h" /* tr_fdSocketClose() */
 #include "net.h"
index 891ab9fbd7f4a77cced8ddff70dcaba203c8b308..7b073cef536a9e79e22ea12eb4884d9a62014324 100644 (file)
@@ -18,8 +18,6 @@
 #include <event2/buffer.h>
 #include <event2/bufferevent.h>
 
-#include <libutp/utp.h>
-
 #include "transmission.h"
 #include "session.h"
 #include "bandwidth.h"
@@ -28,6 +26,7 @@
 #include "peer-common.h" /* MAX_BLOCK_SIZE */
 #include "peer-io.h"
 #include "trevent.h" /* tr_runInEventThread() */
+#include "tr-utp.h"
 #include "utils.h"
 
 
index 1a773df530a106fbd6b80a72eae747233ba4d8ec..162656d325f593b50f0c8a889da44498696b57fc 100644 (file)
@@ -17,7 +17,6 @@
 #include <stdlib.h> /* qsort */
 
 #include <event2/event.h>
-#include <libutp/utp.h>
 
 #include "transmission.h"
 #include "announcer.h"
@@ -36,6 +35,7 @@
 #include "session.h"
 #include "stats.h" /* tr_statsAddUploaded, tr_statsAddDownloaded */
 #include "torrent.h"
+#include "tr-utp.h"
 #include "utils.h"
 #include "webseed.h"
 
index 2d78e67bf242e9051147195aa84ef6d9a770cb9b..de94d53a961dfb57382fa3780c18920043b42256 100644 (file)
@@ -25,8 +25,6 @@ THE SOFTWARE.
 
 #include <event2/event.h>
 
-#include <libutp/utp.h>
-
 #include "transmission.h"
 #include "net.h"
 #include "session.h"
index c46ec407dbe80ade6c43c35f840726f31d53f924..09b95edf01125cefe22a607f5b1c360118580b7a 100644 (file)
@@ -28,6 +28,9 @@ THE SOFTWARE.
 #ifndef _TR_UTP_H_
 #define _TR_UTP_H_
 
+/* this is included *after* transmission.h s.t. we get bool defined */
+#include <libutp/utp.h>
+
 int tr_utpPacket(const unsigned char *buf, size_t buflen,
                  const struct sockaddr *from, socklen_t fromlen,
                  tr_session *ss);
index 5c41aa9a59a8aca5af47bdddcf3f4f717223fb86..7c13dcb352bc5c9da6eda0aebb622fab32377396 100644 (file)
@@ -19,7 +19,7 @@ TRANSMISSION_TOP = ..
 INCLUDEPATH = $${EVENT_TOP}/include $${INCLUDEPATH}
 INCLUDEPATH += $${TRANSMISSION_TOP}
 LIBS += $${TRANSMISSION_TOP}/libtransmission/libtransmission.a
-exists( $${TRANSMISSION_TOP}/third-party/libutp/libutp.a ) { 
+exists( $${TRANSMISSION_TOP}/third-party/libutp/Makefile ) { 
     LIBS += $${TRANSMISSION_TOP}/third-party/libutp/libutp.a
 }
 LIBS += $${TRANSMISSION_TOP}/third-party/dht/libdht.a
index 673554e240ed109a20ed5407dae3e07b1bcfe8e6..e9b7712858b95351d024749c7fbdb298b3278d54 100644 (file)
@@ -35,8 +35,4 @@ CASSERT(8 == sizeof(int64), sizeof_int64_is_8)
 typedef const char * cstr;
 typedef char * str;
 
-#ifndef __cplusplus
-typedef uint8 bool;
-#endif
-
 #endif //__UTYPES_H__