xref: /OK3568_Linux_fs/buildroot/package/transmission/0002-fix-utp-include.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1Fix compilation when using system libminiupnpc with libutp disabled
2
3If transmission uses its own copy of libminiupnpc in third-party/ then
4the configure script adds that path to CFLAGS:
5https://trac.transmissionbt.com/browser/trunk/configure.ac#L455
6
7This path is also added if transmission uses its own copy of libutp:
8https://trac.transmissionbt.com/browser/trunk/configure.ac#L349
9
10But if a system-provided libminiupnpc is used and utp-support is
11disabled using --disable-utp the result is a build error, detected by
12buildroot autobuilders:
13http://autobuild.buildroot.net/results/b79/b79e51140cb0320554a58ce59dcb33f53cd9211a/build-end.log
14
15net.c:40:24: fatal error: libutp/utp.h: No such file or directory
16
17Patch proposed by Yann E. MORIN:
18http://lists.busybox.net/pipermail/buildroot/2016-July/167896.html
19
20Patch sent upstream: https://trac.transmissionbt.com/ticket/6163
21
22Signed-off-by: Bernd Kuhls <berndkuhls@hotmail.com>
23
24diff -uNr transmission-2.92.org/configure.ac transmission-2.92/configure.ac
25--- transmission-2.92.org/configure.ac	2016-03-06 21:23:45.336198393 +0100
26+++ transmission-2.92/configure.ac	2016-07-31 12:13:40.921660078 +0200
27@@ -358,6 +358,10 @@
28     else
29       AC_MSG_ERROR("Unable to build uTP support -- C++ compiler not found")
30     fi
31+else
32+    # For the system libminiupnpc with UTC disabled,
33+    # point to our bundled UTP headers
34+    LIBUTP_CFLAGS="-I\$(top_srcdir)/third-party/"
35 fi
36 AC_SUBST(LIBUTP_CFLAGS)
37 AC_SUBST(LIBUTP_LIBS)
38@@ -457,7 +461,7 @@
39     LIBUPNP_LIBS_QT="\$\${TRANSMISSION_TOP}/third-party/miniupnp/libminiupnp.a"
40 else
41     AC_DEFINE([SYSTEM_MINIUPNP])
42-    LIBUPNP_CFLAGS=""
43+    LIBUPNP_CFLAGS="${LIBUTP_CFLAGS}"
44     LIBUPNP_LIBS="-lminiupnpc"
45     LIBUPNP_LIBS_QT="-lminiupnpc"
46 fi
47