Ticket #4041: librt-fix.patch

File librt-fix.patch, 1.4 KB (added by taem, 11 years ago)
  • configure.ac

    diff --git a/configure.ac b/configure.ac
    index 34206e3..31635c7 100644
    a b AC_TRY_LINK([#include <stdarg.h>], [va_list ap1, ap2; va_copy(ap1, ap2);], 
    195195])
    196196
    197197
    198 dnl libevent likes to link against librt if possible
    199 dnl for clock_gettime() and clock_settime()
    200 dnl TODO(libevent2): this can probably be removed after
    201 dnl we switch to libevent2, since it will have PKG_CONFIG
    202 AC_CHECK_LIB([rt],
    203              [clock_gettime],
    204              [libevent_extra_libs="-lrt"],
    205              [libevent_extra_libs=""])
    206 
    207 
    208198dnl ----------------------------------------------------------------------------
    209199dnl
    210200dnl  dht
    dnl ---------------------------------------------------------------------------- 
    219209dnl
    220210dnl  utp
    221211
     212AC_CHECK_LIB([rt],
     213             [clock_gettime],
     214             [libutp_extra_libs="-lrt"],
     215             [libutp_extra_libs=""])
     216
    222217AC_MSG_CHECKING([µTP])
    223218build_utp="no"
    224219if test "x$CXX" = "x" ; then
    AC_ARG_ENABLE([utp], 
    233228if test "x$want_utp" = "xyes" ; then
    234229    if test "x$have_utp" = "xyes"; then
    235230        LIBUTP_CFLAGS="-I\$(top_srcdir)/third-party/"
    236         LIBUTP_LIBS="\$(top_builddir)/third-party/libutp/libutp.a -lrt"
     231        LIBUTP_LIBS="\$(top_builddir)/third-party/libutp/libutp.a"
     232        if test "x$libutp_extra_libs" != "x" ; then
     233           LIBUTP_LIBS="$LIBUTP_LIBS $libutp_extra_libs"
     234        fi
    237235        AC_DEFINE([WITH_UTP],[1])
    238236        build_utp="yes"
    239237    else