From 27861360153c8e995f2203a548aa147372410056 Mon Sep 17 00:00:00 2001 From: Jordan Lee Date: Sat, 8 Oct 2011 23:53:27 +0000 Subject: [PATCH] (trunk) #4490 "Transmission 2.40b1 fails to build: undefined references" -- fixed. --- configure.ac | 13 +++++++++---- libtransmission/net.c | 2 -- libtransmission/peer-io.c | 3 +-- libtransmission/peer-mgr.c | 2 +- libtransmission/tr-utp.c | 2 -- libtransmission/tr-utp.h | 3 +++ qt/qtr.pro | 2 +- third-party/libutp/utypes.h | 4 ---- 8 files changed, 15 insertions(+), 16 deletions(-) diff --git a/configure.ac b/configure.ac index 37cb99d90..02701f75a 100644 --- a/configure.ac +++ b/configure.ac @@ -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 " diff --git a/libtransmission/net.c b/libtransmission/net.c index eb05de633..bc70c8cde 100644 --- a/libtransmission/net.c +++ b/libtransmission/net.c @@ -38,8 +38,6 @@ #include -#include - #include "transmission.h" #include "fdlimit.h" /* tr_fdSocketClose() */ #include "net.h" diff --git a/libtransmission/peer-io.c b/libtransmission/peer-io.c index 891ab9fbd..7b073cef5 100644 --- a/libtransmission/peer-io.c +++ b/libtransmission/peer-io.c @@ -18,8 +18,6 @@ #include #include -#include - #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" diff --git a/libtransmission/peer-mgr.c b/libtransmission/peer-mgr.c index 1a773df53..162656d32 100644 --- a/libtransmission/peer-mgr.c +++ b/libtransmission/peer-mgr.c @@ -17,7 +17,6 @@ #include /* qsort */ #include -#include #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" diff --git a/libtransmission/tr-utp.c b/libtransmission/tr-utp.c index 2d78e67bf..de94d53a9 100644 --- a/libtransmission/tr-utp.c +++ b/libtransmission/tr-utp.c @@ -25,8 +25,6 @@ THE SOFTWARE. #include -#include - #include "transmission.h" #include "net.h" #include "session.h" diff --git a/libtransmission/tr-utp.h b/libtransmission/tr-utp.h index c46ec407d..09b95edf0 100644 --- a/libtransmission/tr-utp.h +++ b/libtransmission/tr-utp.h @@ -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 + int tr_utpPacket(const unsigned char *buf, size_t buflen, const struct sockaddr *from, socklen_t fromlen, tr_session *ss); diff --git a/qt/qtr.pro b/qt/qtr.pro index 5c41aa9a5..7c13dcb35 100644 --- a/qt/qtr.pro +++ b/qt/qtr.pro @@ -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 diff --git a/third-party/libutp/utypes.h b/third-party/libutp/utypes.h index 673554e24..e9b771285 100644 --- a/third-party/libutp/utypes.h +++ b/third-party/libutp/utypes.h @@ -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__ -- 2.40.0