#5805: Allow building against system libutp (patch by jbeich)

This commit is contained in:
Mike Gelfand 2014-12-27 23:21:01 +00:00
parent 8c550a2734
commit d254312cb1
1 changed files with 19 additions and 6 deletions

View File

@ -211,17 +211,30 @@ AC_CHECK_LIB([rt],
AC_MSG_CHECKING([µTP])
build_utp="no"
if test "x$CXX" != "x" ; then
have_utp="yes"
else
have_utp="no"
fi
ac_save_LIBS="$LIBS"
LIBS="-lutp"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([#include <libutp/utp.h>],
[struct UTPFunctionTable func;])],
[have_utp="yes"],
[have_utp="no"]
)
LIBS=$ac_save_LIBS
AC_ARG_ENABLE([utp],
AS_HELP_STRING([--enable-utp],[build µTP support]),
[want_utp=${enableval}],
[want_utp=${have_utp}])
if test "x$want_utp" = "xyes" ; then
if test "x$want_utp" = "xyes"; then
if test "x$have_utp" = "xyes"; then
dnl Would be lovely if it had pkgconfig
LIBUTP_CFLAGS=""
LIBUTP_LIBS="-lutp $libutp_extra_libs"
LIBUTP_LIBS_QT="-lutp $libutp_extra_libs"
AC_DEFINE([WITH_UTP],[1])
build_utp="system"
elif test "x$CXX" != "x"; then
LIBUTP_CFLAGS="-I\$(top_srcdir)/third-party/"
LIBUTP_LIBS="\$(top_builddir)/third-party/libutp/libutp.a"
LIBUTP_LIBS_QT="\$\${TRANSMISSION_TOP}/third-party/libutp/libutp.a"