Skip to contentSkip to conversation

package/libv4l: disable libraries build if no fork() support

PATCH New Hugues Fruchet 2 participants 4 messages Jul 25, 2017 – Jul 26, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/libv4l: disable libraries build if no fork() support

Some no-MMU platforms have shared libraries support but no fork() support, which is required by libv4lconvert. Fix this by disabling libv4l libraries build in case of no fork() support.
This fix the build issue reported here:
http://lists.buildroot.org/pipermail/buildroot/2017-July/197571.html

Hugues Fruchet (1):
package/libv4l: disable libraries build if no fork() support

 ...c-disable-libv4l-build-if-no-fork-support.patch | 48 ++++++++++++++++++++++
 1 file changed, 48 insertions(+)
 create mode 100644 package/libv4l/0010-configure.ac-disable-libv4l-build-if-no-fork-support.patch
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 package/libv4l: disable libraries build if no fork() support

Some no-MMU platforms have shared libraries support but no fork() support, which is required by libv4lconvert. Fix this by disabling libv4l libraries build in case of no fork() support.
This fix the build issue reported here:
http://lists.buildroot.org/pipermail/buildroot/2017-July/197571.html

---
 ...c-disable-libv4l-build-if-no-fork-support.patch | 48 ++++++++++++++++++++++
 1 file changed, 48 insertions(+)
 create mode 100644 package/libv4l/0010-configure.ac-disable-libv4l-build-if-no-fork-support.patch
package/libv4l/0010-configure.ac-disable-libv4l-build-if-no-fork-support.patch new file +48 -0
new file mode 100644
index 0000000..23f9f99
@@ -0,0 +1,48 @@
+From 3a68a60e3ee425b68d29d435d0733a7db0cdfc18 Mon Sep 17 00:00:00 2001
+From: Hugues Fruchet <[email protected]>
+Date: Tue, 25 Jul 2017 11:23:38 +0200
+Subject: [PATCH 10/10] configure.ac: disable libv4l build if no fork() support
+
+Some no-MMU platforms have shared libraries support
+but no fork() support, which is required by libv4lconvert.
+Fix this by disabling libv4l build in case of no fork() support.
+
+Signed-off-by: Hugues Fruchet <[email protected]>
+---
+ configure.ac | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 9031b42..2996ebc 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -298,6 +298,9 @@ argp_saved_libs=$LIBS
+   AC_SUBST([ARGP_LIBS])
+ LIBS=$argp_saved_libs
+ 
++# Check for fork(), needed by libv4lconvert
++AC_CHECK_FUNCS([fork], have_fork=yes, have_fork=no)
++
+ AC_CHECK_HEADER([linux/i2c-dev.h], [linux_i2c_dev=yes], [linux_i2c_dev=no])
+ AM_CONDITIONAL([HAVE_LINUX_I2C_DEV], [test x$linux_i2c_dev = xyes])
+ 
+@@ -436,7 +439,7 @@ AM_CONDITIONAL([WITH_LIBDVBV5],     [test x$enable_libdvbv5  != xno -a x$have_li
+ AM_CONDITIONAL([WITH_DVBV5_REMOTE], [test x$enable_libdvbv5  != xno -a x$have_libudev = xyes -a x$have_pthread = xyes])
+ 
+ AM_CONDITIONAL([WITH_DYN_LIBV4L],   [test x$enable_dyn_libv4l != xno])
+-AM_CONDITIONAL([WITH_LIBV4L],       [test x$enable_libv4l    != xno -a x$enable_shared != xno])
++AM_CONDITIONAL([WITH_LIBV4L],       [test x$enable_libv4l    != xno -a x$enable_shared != xno -a x$have_fork != xno])
+ AM_CONDITIONAL([WITH_V4LUTILS],	    [test x$enable_v4l_utils != xno -a x$linux_os = xyes])
+ AM_CONDITIONAL([WITH_QV4L2],	    [test x${qt_pkgconfig} = xtrue -a x$enable_qv4l2 != xno])
+ AM_CONDITIONAL([WITH_V4L_PLUGINS],  [test x$enable_dyn_libv4l != xno -a x$enable_shared != xno])
+@@ -492,6 +495,7 @@ compile time options summary
+     libjpeg                    : $have_jpeg
+     libudev                    : $have_libudev
+     pthread                    : $have_pthread
++    fork                       : $have_fork
+     QT version                 : $QT_VERSION
+     ALSA support               : $USE_ALSA
+ 
+-- 
+1.9.1
+
Signature · 1 line
1.9.1
#2 lore raw

PATCH 1/1 package/libv4l: disable libraries build if no fork() support

Hello,

Quoted 8 lines · Hugues Fruchet

Some no-MMU platforms have shared libraries support but no fork() support, which is required by libv4lconvert. Fix this by disabling libv4l libraries build in case of no fork() support.
This fix the build issue reported here:
http://lists.buildroot.org/pipermail/buildroot/2017-July/197571.html

I'm sorry, but I'm not sure this is the right solution. Indeed, this entirely disables the build of all libv4l libraries.

Therefore, if you for example re-enable the v4l2grab package by dropping its BR2_USE_MMU dependency, it fails to build with:

v4l2grab.c:59:21: fatal error: libv4l2.h: No such file or directory
#include <libv4l2.h>

So things work today because the libv4l package used to have a BR2_USE_MMU dependency, which was propagated to its reverse dependencies. But as you can see, it doesn't really work properly.

I believe the attached patch for libv4l is better. It keeps building all libraries, and only disables the one specific libv4lconvert feature that needs fork(): using external helpers for decompressing frames. This is only needed for the OV511 and OV518 formats, so only for very specific webcams if I understood correctly.

If you're happy with this patch, could you submit it upstream, and submit it to Buildroot as well ?

Thanks!

Thomas

Signature · 10 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Build-libv4lconvert-helper-support-only-when-fork-is.patch
Type: text/x-patch
Size: 3795 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20170725/d6c540bf/attachment.bin>
#3 lore raw

PATCH 1/1 package/libv4l: disable libraries build if no fork() support

Hi Thomas,

Your patch is definitely better for sure ;)

Tested OK on my side, I will push it on media list.
Peter, could you test on your side to be sure that build issue is fixed on your side ?

Best regards,
Hugues.

Quoted 38 lines · Thomas Petazzoni

Hello,

Quoted 8 lines · Hugues Fruchet

Some no-MMU platforms have shared libraries support but no fork() support, which is required by libv4lconvert. Fix this by disabling libv4l libraries build in case of no fork() support.
This fix the build issue reported here:
http://lists.buildroot.org/pipermail/buildroot/2017-July/197571.html

I'm sorry, but I'm not sure this is the right solution. Indeed, this entirely disables the build of all libv4l libraries.

Therefore, if you for example re-enable the v4l2grab package by dropping its BR2_USE_MMU dependency, it fails to build with:

v4l2grab.c:59:21: fatal error: libv4l2.h: No such file or directory
#include <libv4l2.h>

So things work today because the libv4l package used to have a BR2_USE_MMU dependency, which was propagated to its reverse dependencies. But as you can see, it doesn't really work properly.

I believe the attached patch for libv4l is better. It keeps building all libraries, and only disables the one specific libv4lconvert feature that needs fork(): using external helpers for decompressing frames. This is only needed for the OV511 and OV518 formats, so only for very specific webcams if I understood correctly.

If you're happy with this patch, could you submit it upstream, and submit it to Buildroot as well ?

Thanks!

Thomas