Skip to contentSkip to conversation

libv4l: add optional sdl2_image dependency

PATCH New Fabrice Fontaine 3 participants 5 messages Jun 29, 2018 – Jul 19, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 libv4l: add optional sdl2_image dependency

---
 package/libv4l/libv4l.mk | 4 ++++
 1 file changed, 4 insertions(+)
package/libv4l/libv4l.mk +4 -0
index 11061306c7..95a700b2d5 100644
@@ -73,6 +73,10 @@ else
 LIBV4L_CONF_OPTS += --disable-v4l-utils
 endif
 
+ifeq ($(BR2_PACKAGE_SDL2_IMAGE),y)
+LIBV4L_DEPENDENCIES += sdl2_image
+endif
+
 LIBV4L_CONF_ENV += LIBS="$(LIBV4L_LIBS)"
 
 $(eval $(autotools-package))
Signature · 1 line
2.14.1
#1 lore raw

PATCH 2/2 libv4l: fix build with sdl2_image

sdlcam test includes jpeglib.h so add an option to disable tests

Fixes:
- http://autobuild.buildroot.net/results/1eded8b44cc369550566c6ce0b3c042f1aec8d44

---
 package/libv4l/0004-Add-disable-tests-option.patch | 59 ++++++++++++++++++++++
 package/libv4l/libv4l.mk                           |  8 ++-
 2 files changed, 66 insertions(+), 1 deletion(-)
 create mode 100644 package/libv4l/0004-Add-disable-tests-option.patch
package/libv4l/0004-Add-disable-tests-option.patch new file +59 -0
new file mode 100644
index 0000000000..7d1e458112
@@ -0,0 +1,59 @@
+From d244fc440dd18dacf9b820f333134cd842e2f970 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <[email protected]>
+Date: Fri, 29 Jun 2018 21:15:10 +0200
+Subject: [PATCH] Add --disable-tests option
+
+Offer the possibiity to disable tests especially sdlcam test which
+includes jpeglib.h
+
+Signed-off-by: Fabrice Fontaine <[email protected]>
+---
+ configure.ac        | 11 +++++++++++
+ contrib/Makefile.am |  6 +++++-
+ 2 files changed, 16 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index dc1e9cbf..45c7b1fc 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -431,6 +431,16 @@ AC_ARG_ENABLE(gconv,
+    esac]
+ )
+ 
++AC_ARG_ENABLE(tests,
++   AS_HELP_STRING([--disable-tests], [disable tests compilation]),
++   [case "${enableval}" in
++     yes | no ) ;;
++     *) AC_MSG_ERROR(bad value ${enableval} for --disable-tests) ;;
++   esac],
++   enable_tests=yes
++)
++AM_CONDITIONAL([HAVE_TESTS], [test x$enable_tests = xyes])
++
+ PKG_CHECK_MODULES([SDL2], [sdl2 SDL2_image], [sdl_pc=yes], [sdl_pc=no])
+ AM_CONDITIONAL([HAVE_SDL], [test x$sdl_pc = xyes])
+ 
+@@ -518,4 +528,5 @@ compile time options summary
+     qv4l2                      : $USE_QV4L2
+     v4l2-ctl uses libv4l       : $USE_V4L2_CTL_LIBV4L
+     v4l2-compliance uses libv4l: $USE_V4L2_COMPLIANCE_LIBV4L
++    tests                      : $enable_tests
+ EOF
+diff --git a/contrib/Makefile.am b/contrib/Makefile.am
+index d41dc539..ed83d71c 100644
+--- a/contrib/Makefile.am
++++ b/contrib/Makefile.am
+@@ -1,5 +1,9 @@
+ if LINUX_OS
+-SUBDIRS = test xc3028-firmware
++SUBDIRS = xc3028-firmware
++
++if HAVE_TESTS
++SUBDIRS += test
++endif
+ 
+ if HAVE_LINUX_I2C_DEV
+ SUBDIRS += \
+-- 
+2.14.1
+
package/libv4l/libv4l.mk +7 -1
index 95a700b2d5..dc24b90114 100644
@@ -9,7 +9,13 @@ LIBV4L_SOURCE = v4l-utils-$(LIBV4L_VERSION).tar.bz2
 LIBV4L_SITE = https://linuxtv.org/downloads/v4l-utils
 LIBV4L_INSTALL_STAGING = YES
 LIBV4L_DEPENDENCIES = host-pkgconf
-LIBV4L_CONF_OPTS = --disable-doxygen-doc
+LIBV4L_CONF_OPTS = \
+	--disable-doxygen-doc \
+	--disable-tests
+# We're patching configure.ac
+LIBV4L_AUTORECONF = YES
+# add host-gettext for AM_ICONV macro
+LIBV4L_DEPENDENCIES += host-gettext
 
 # fix uclibc-ng configure/compile
 LIBV4L_CONF_ENV = ac_cv_prog_cc_c99='-std=gnu99'
Signature · 1 line
2.14.1
#2 lore raw

PATCH 2/2 libv4l: fix build with sdl2_image

Hello,

Quoted 18 lines · Fabrice Fontaine

sdlcam test includes jpeglib.h so add an option to disable tests

Fixes:
- http://autobuild.buildroot.net/results/1eded8b44cc369550566c6ce0b3c042f1aec8d44

---
 package/libv4l/0004-Add-disable-tests-option.patch | 59 ++++++++++++++++++++++
 package/libv4l/libv4l.mk                           |  8 ++-
 2 files changed, 66 insertions(+), 1 deletion(-)
 create mode 100644 package/libv4l/0004-Add-disable-tests-option.patch
package/libv4l/0004-Add-disable-tests-option.patch new file +0 -0
new file mode 100644
index 0000000000..7d1e458112

package/libv4l/0004-Add-disable-tests-option.patch line 9

Quoted 9 lines
package/libv4l/0004-Add-disable-tests-option.patch new file +9 -0
@@ -0,0 +1,59 @@
+From d244fc440dd18dacf9b820f333134cd842e2f970 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <[email protected]>
+Date: Fri, 29 Jun 2018 21:15:10 +0200
+Subject: [PATCH] Add --disable-tests option
+
+Offer the possibiity to disable tests especially sdlcam test which
+includes jpeglib.h
+
+Signed-off-by: Fabrice Fontaine <[email protected]>

This patch is not the right/best solution to the problem. configure.ac already checks for the availability of the jpeg library, and defines HAVE_JPEG accordingly.

So in contrib/test/Makefile.am, just replace:

if HAVE_SDL
noinst_PROGRAMS += sdlcam
endif

by:

if HAVE_SDL
if HAVE_JPEG
noinst_PROGRAMS += sdlcam
endif
endif

Perhaps there is an automake "and" or "&&" operator, but I'm not sure.

Also, please submit this change upstream.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
#3 lore raw

PATCH 1/2 libv4l: add optional sdl2_image dependency

In reply to Fabrice Fontaine

Hello,

Quoted 4 lines · Fabrice Fontaine
---
 package/libv4l/libv4l.mk | 4 ++++
 1 file changed, 4 insertions(+)

I've explained explicitly in the commit log that there is no --enable/--disable option, as the configure.ac script simply uses PKG_CHECK_MODULES() to detect the availability of sdl2_image.

Applied with this updated commit log. Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com