]> granicus.if.org Git - transmission/commitdiff
(trunk) #4041 "FTBFS with enabled uTP on Debian" -- revised patch from taem which...
authorJordan Lee <jordan@transmissionbt.com>
Wed, 2 Mar 2011 07:31:14 +0000 (07:31 +0000)
committerJordan Lee <jordan@transmissionbt.com>
Wed, 2 Mar 2011 07:31:14 +0000 (07:31 +0000)
configure.ac

index 34206e3836cd77254a81adba99553c88eeb52551..31635c76af200f88f7192b08756a03746d89d2e1 100644 (file)
@@ -195,16 +195,6 @@ AC_TRY_LINK([#include <stdarg.h>], [va_list ap1, ap2; va_copy(ap1, ap2);],
 ])
 
 
-dnl libevent likes to link against librt if possible
-dnl for clock_gettime() and clock_settime()
-dnl TODO(libevent2): this can probably be removed after
-dnl we switch to libevent2, since it will have PKG_CONFIG
-AC_CHECK_LIB([rt],
-             [clock_gettime],
-             [libevent_extra_libs="-lrt"],
-             [libevent_extra_libs=""])
-
-
 dnl ----------------------------------------------------------------------------
 dnl
 dnl  dht
@@ -219,6 +209,11 @@ dnl ----------------------------------------------------------------------------
 dnl
 dnl  utp
 
+AC_CHECK_LIB([rt],
+             [clock_gettime],
+             [libutp_extra_libs="-lrt"],
+             [libutp_extra_libs=""])
+
 AC_MSG_CHECKING([µTP])
 build_utp="no"
 if test "x$CXX" = "x" ; then
@@ -233,7 +228,10 @@ AC_ARG_ENABLE([utp],
 if test "x$want_utp" = "xyes" ; then
     if test "x$have_utp" = "xyes"; then 
         LIBUTP_CFLAGS="-I\$(top_srcdir)/third-party/"
-        LIBUTP_LIBS="\$(top_builddir)/third-party/libutp/libutp.a -lrt"
+        LIBUTP_LIBS="\$(top_builddir)/third-party/libutp/libutp.a"
+       if test "x$libutp_extra_libs" != "x" ; then
+          LIBUTP_LIBS="$LIBUTP_LIBS $libutp_extra_libs"
+       fi
         AC_DEFINE([WITH_UTP],[1])
         build_utp="yes"
     else