Ticket #6163: 0004-fix-utp-include.patch

File 0004-fix-utp-include.patch, 1.6 KB (added by bkuhls, 5 years ago)
  • transmission-2.92

    Fix compilation when using system libminiupnpc with libutp disabled
    
    If transmission uses its own copy of libminiupnpc in third-party/ then
    the configure script adds that path to CFLAGS:
    https://trac.transmissionbt.com/browser/trunk/configure.ac#L455
    
    This patch is also added if transmission uses its own copy of libutp:
    https://trac.transmissionbt.com/browser/trunk/configure.ac#L349
    
    But if a system-provided libminiupnpc is used and utp-support is
    disabled using --disable-utp the result is a build error, detected by
    buildroot autobuilders:
    http://autobuild.buildroot.net/results/b79/b79e51140cb0320554a58ce59dcb33f53cd9211a/build-end.log
    
    net.c:40:24: fatal error: libutp/utp.h: No such file or directory
    
    Patch proposed by Yann E. MORIN:
    http://lists.busybox.net/pipermail/buildroot/2016-July/167896.html
    
    Signed-off-by: Bernd Kuhls <berndkuhls@hotmail.com>
    
    diff -uNr transmission-2.92.org/configure.ac transmission-2.92/configure.ac
    old new  
    358358    else
    359359      AC_MSG_ERROR("Unable to build uTP support -- C++ compiler not found")
    360360    fi
     361else
     362    # For the system libminiupnpc with UTC disabled,
     363    # point to our bundled UTP headers
     364    LIBUTP_CFLAGS="-I\$(top_srcdir)/third-party/"
    361365fi
    362366AC_SUBST(LIBUTP_CFLAGS)
    363367AC_SUBST(LIBUTP_LIBS)
     
    457461    LIBUPNP_LIBS_QT="\$\${TRANSMISSION_TOP}/third-party/miniupnp/libminiupnp.a"
    458462else
    459463    AC_DEFINE([SYSTEM_MINIUPNP])
    460     LIBUPNP_CFLAGS=""
     464    LIBUPNP_CFLAGS="${LIBUTP_CFLAGS}"
    461465    LIBUPNP_LIBS="-lminiupnpc"
    462466    LIBUPNP_LIBS_QT="-lminiupnpc"
    463467fi