Skip to contentSkip to conversation

package/transmission: Fix compilation when using system libminiupnpc with libutp disabled

PATCH Superseded Bernd Kuhls 3 participants 4 messages Jul 7, 2016 – Jul 27, 2016

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/transmission: Fix compilation when using system libminiupnpc with libutp disabled

Fixes
http://autobuild.buildroot.net/results/b79/b79e51140cb0320554a58ce59dcb33f53cd9211a/

---
Sending the patch upstream failed until now because I could not finish my registration on trac.transmissionbt.com for over 12h. I will continue to try to send the patch upstream, but I need to receive a security token from upstream to finish my registration.

 package/transmission/0004-fix-utp-include.patch | 41 +++++++++++++++++++++++++
 1 file changed, 41 insertions(+)
 create mode 100644 package/transmission/0004-fix-utp-include.patch
package/transmission/0004-fix-utp-include.patch new file +41 -0
new file mode 100644
index 0000000..e693bf9
@@ -0,0 +1,41 @@
+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
+
+This patch moves LIBUTP_CFLAGS outside the if-condition because
+transmission needs utp.h regardless whether support for libutp is
+enabled or not.
+
+Signed-off-by: Bernd Kuhls <[email protected]>
+
+diff -uNr transmission-2.92.org/configure.ac transmission-2.92/configure.ac
+--- transmission-2.92.org/configure.ac	2016-03-06 21:23:45.336198393 +0100
++++ transmission-2.92/configure.ac	2016-07-06 22:27:25.809613723 +0200
+@@ -333,6 +333,7 @@
+     want_utp_default="no"
+ fi
+ 
++LIBUTP_CFLAGS="-I\$(top_srcdir)/third-party/"
+ AC_ARG_ENABLE([utp],
+               AS_HELP_STRING([--enable-utp],[build ?TP support]),
+               [want_utp=${enableval}],
+@@ -346,7 +347,6 @@
+         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"
+         if test "x$libutp_extra_libs" != "x" ; then
Signature · 1 line
2.8.1
#1 lore raw

PATCH 1/1 package/transmission: Fix compilation when using system libminiupnpc with libutp disabled

Bernd, All,

On 2016-07-07 07:13 +0200, Bernd Kuhls spake thusly:

Quoted 4 lines

Fixes
http://autobuild.buildroot.net/results/b79/b79e51140cb0320554a58ce59dcb33f53cd9211a/

Regards,
Yann E. MORIN.

Quoted 64 lines

---
Sending the patch upstream failed until now because I could not finish my registration on trac.transmissionbt.com for over 12h. I will continue to try to send the patch upstream, but I need to receive a security token from upstream to finish my registration.

 package/transmission/0004-fix-utp-include.patch | 41 +++++++++++++++++++++++++
 1 file changed, 41 insertions(+)
 create mode 100644 package/transmission/0004-fix-utp-include.patch
package/transmission/0004-fix-utp-include.patch new file +41 -0
new file mode 100644
index 0000000..e693bf9
@@ -0,0 +1,41 @@
+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
+
+This patch moves LIBUTP_CFLAGS outside the if-condition because
+transmission needs utp.h regardless whether support for libutp is
+enabled or not.
+
+Signed-off-by: Bernd Kuhls <[email protected]>
+
+diff -uNr transmission-2.92.org/configure.ac transmission-2.92/configure.ac
+--- transmission-2.92.org/configure.ac	2016-03-06 21:23:45.336198393 +0100
++++ transmission-2.92/configure.ac	2016-07-06 22:27:25.809613723 +0200
+@@ -333,6 +333,7 @@
+     want_utp_default="no"
+ fi
+ 
++LIBUTP_CFLAGS="-I\$(top_srcdir)/third-party/"
+ AC_ARG_ENABLE([utp],
+               AS_HELP_STRING([--enable-utp],[build ?TP support]),
+               [want_utp=${enableval}],
+@@ -346,7 +347,6 @@
+         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"
+         if test "x$libutp_extra_libs" != "x" ; then
Signature · 6 lines
2.8.1

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#2 lore raw

PATCH 1/1 package/transmission: Fix compilation when using system libminiupnpc with libutp disabled

Bernd, All,

On 2016-07-12 18:42 +0200, Yann E. MORIN spake thusly:

Quoted 7 lines

On 2016-07-07 07:13 +0200, Bernd Kuhls spake thusly:

Quoted 4 lines

Fixes
http://autobuild.buildroot.net/results/b79/b79e51140cb0320554a58ce59dcb33f53cd9211a/

Well, I withdraw this review of mine... :-(

See below...

[--SNIP--]

Quoted 8 lines

package/transmission/0004-fix-utp-include.patch line 30

Quoted 8 lines
package/transmission/0004-fix-utp-include.patch new file +8 -0
+diff -uNr transmission-2.92.org/configure.ac transmission-2.92/configure.ac
+--- transmission-2.92.org/configure.ac	2016-03-06 21:23:45.336198393 +0100
++++ transmission-2.92/configure.ac	2016-07-06 22:27:25.809613723 +0200
+@@ -333,6 +333,7 @@
+     want_utp_default="no"
+ fi
+ 
++LIBUTP_CFLAGS="-I\$(top_srcdir)/third-party/"

So it means that headers from the internal libutp will always be used, even if an external one is found. This is probably not very good...

Instead, I think the fix is probably something like:

--- configure.ac(revision 14736)
+++ configure.a c)(working copy)
@@ -358,6 +358,10 @@
else
AC_MSG_ERROR("Unable to build uTP support -- C++ compiler not found")
fi
+else
+ # For the system libminiupnpc with UTC disabled,
+ # point to our bundled UTP headers
+ LIBUTP_CFLAGS="-I\$(top_srcdir)/third-party/"
fi
AC_SUBST(LIBUTP_CFLAGS)
AC_SUBST(LIBUTP_LIBS)
@@ -457,7 +461,7 @@
LIBUPNP_LIBS_QT="\$\${TRANSMISSION_TOP}/third-party/miniupnp/libminiupnp.a"
else
AC_DEFINE([SYSTEM_MINIUPNP])
- LIBUPNP_CFLAGS=""
+ LIBUPNP_CFLAGS="${LIBUTP_CFLAGS}"
LIBUPNP_LIBS="-lminiupnpc"
LIBUPNP_LIBS_QT="-lminiupnpc"
fi

Can you test and respin if OK, please? Thanks! :-)

Regards,
Yann E. MORIN.

Quoted 30 lines
Quoted 18 lines

+ AC_ARG_ENABLE([utp],

package/transmission/0004-fix-utp-include.patch new file +10 -0
+               AS_HELP_STRING([--enable-utp],[build ?TP support]),
+               [want_utp=${enableval}],
+@@ -346,7 +347,6 @@
+         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"
+         if test "x$libutp_extra_libs" != "x" ; then
Signature · 6 lines
2.8.1

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#3 lore raw

PATCH 1/1 package/transmission: Fix compilation when using system libminiupnpc with libutp disabled

Hello,

Quoted 28 lines · Yann E. MORIN

So it means that headers from the internal libutp will always be used, even if an external one is found. This is probably not very good...

Instead, I think the fix is probably something like:

--- configure.ac(revision 14736)
+++ configure.a c)(working copy)
@@ -358,6 +358,10 @@
else
AC_MSG_ERROR("Unable to build uTP support -- C++ compiler not found")
fi
+else
+ # For the system libminiupnpc with UTC disabled,
+ # point to our bundled UTP headers
+ LIBUTP_CFLAGS="-I\$(top_srcdir)/third-party/"
fi
AC_SUBST(LIBUTP_CFLAGS)
AC_SUBST(LIBUTP_LIBS)
@@ -457,7 +461,7 @@
LIBUPNP_LIBS_QT="\$\${TRANSMISSION_TOP}/third-party/miniupnp/libminiupnp.a"
else
AC_DEFINE([SYSTEM_MINIUPNP])
- LIBUPNP_CFLAGS=""
+ LIBUPNP_CFLAGS="${LIBUTP_CFLAGS}"
LIBUPNP_LIBS="-lminiupnpc"
LIBUPNP_LIBS_QT="-lminiupnpc"
fi

Quoted 1 line

Can you test and respin if OK, please? Thanks! :-)

Bernd, I'll mark your patch as Changes Requested in patchwork. Could you respin a new version that takes into account Yann's comment?

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com