Skip to contentSkip to conversation

package/libv4l: v4l-utils needs C++11 support

PATCH In review Peter Seiderer 2 participants 2 messages Feb 11, 2022 – Feb 14, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/libv4l: v4l-utils needs C++11 support

Fixes:

- http://autobuild.buildroot.net/results/cacd73e08cfb359d608bca807189b7bd3c5c79bd

v4l2-ctl.cpp:53:2: warning: identifier 'nullptr' is a keyword in C++11 [-Wc++0x-compat] v4l2-ctl.cpp:53:37: error: 'nullptr' was not declared in this scope
[...]
v4l2-ctl-tuner.cpp: In function 'void parse_freq_seek(char*, v4l2_hw_freq_seek&)':
v4l2-ctl-tuner.cpp:160:10: error: 'constexpr' does not name a type

     static constexpr const char *subopts[] = {
            ^

v4l2-ctl-tuner.cpp:160:10: note: C++11 'constexpr' only available with -std=c++11 or -std=gnu++11

---
 package/libv4l/Config.in | 4 ++++
 package/libv4l/libv4l.mk | 6 ++++--
 2 files changed, 8 insertions(+), 2 deletions(-)
package/libv4l/Config.in +4 -0
index 57ddde1dfb..c88f280c3b 100644
@@ -20,6 +20,7 @@ comment "libv4l JPEG support not enabled"
 
 config BR2_PACKAGE_LIBV4L_UTILS
 	bool "v4l-utils tools"
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 # C++11
 	help
 	  v4l-utils is a collection of various video4linux and DVB
 	  utilities.
@@ -35,6 +36,9 @@ config BR2_PACKAGE_LIBV4L_UTILS
 	  - rds-ctl
 	  - qv4l2 (if Qt is enabled)
 
+comment "v4l-utils tools needs a toolchain w/ C++11"
+	depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
+
 endif
 
 comment "libv4l needs a toolchain w/ threads, C++ and headers >= 3.0"
package/libv4l/libv4l.mk +4 -2
index 4dc0f15f94..ee5a1f2241 100644
@@ -59,6 +59,10 @@ ifeq ($(BR2_PACKAGE_LIBV4L_UTILS),y)
 LIBV4L_CONF_OPTS += --enable-v4l-utils
 LIBV4L_DEPENDENCIES += $(TARGET_NLS_DEPENDENCIES)
 
+# v4l2-ctl needs c++11, qt5 needs c++11 (since qt-5.7)/use gnu++11 for
+# typeof support
+LIBV4L_CONF_ENV += CXXFLAGS="$(TARGET_CXXFLAGS) -std=gnu++11"
+
 # IR BPF decoder support needs toolchain with linux-headers >= 3.18
 # libelf and clang support
 LIBV4L_CONF_OPTS += --disable-bpf
@@ -71,8 +75,6 @@ LIBV4L_CONF_ENV += \
 	ac_cv_prog_MOC=$(HOST_DIR)/bin/moc \
 	ac_cv_prog_RCC=$(HOST_DIR)/bin/rcc \
 	ac_cv_prog_UIC=$(HOST_DIR)/bin/uic
-# qt5 needs c++11 (since qt-5.7)/use gnu++11 for typeof support
-LIBV4L_CONF_ENV += CXXFLAGS="$(TARGET_CXXFLAGS) -std=gnu++11"
 else
 LIBV4L_CONF_OPTS += --disable-qv4l2
 endif
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 46 lines · Peter Seiderer

Fixes:

- http://autobuild.buildroot.net/results/cacd73e08cfb359d608bca807189b7bd3c5c79bd

v4l2-ctl.cpp:53:2: warning: identifier 'nullptr' is a keyword in C++11 [-Wc++0x-compat] v4l2-ctl.cpp:53:37: error: 'nullptr' was not declared in this scope [...]
v4l2-ctl-tuner.cpp: In function 'void parse_freq_seek(char*, v4l2_hw_freq_seek&)':
v4l2-ctl-tuner.cpp:160:10: error: 'constexpr' does not name a type

      static constexpr const char *subopts[] = {
             ^

v4l2-ctl-tuner.cpp:160:10: note: C++11 'constexpr' only available with -std=c++11 or -std=gnu++11

---
  package/libv4l/Config.in | 4 ++++
  package/libv4l/libv4l.mk | 6 ++++--
  2 files changed, 8 insertions(+), 2 deletions(-)
package/libv4l/Config.in +4 -0
index 57ddde1dfb..c88f280c3b 100644
@@ -20,6 +20,7 @@ comment "libv4l JPEG support not enabled"
 
  config BR2_PACKAGE_LIBV4L_UTILS
  	bool "v4l-utils tools"
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 # C++11
  	help
  	  v4l-utils is a collection of various video4linux and DVB
  	  utilities.
@@ -35,6 +36,9 @@ config BR2_PACKAGE_LIBV4L_UTILS
  	  - rds-ctl
  	  - qv4l2 (if Qt is enabled)
 
+comment "v4l-utils tools needs a toolchain w/ C++11"
+	depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
+
  endif
 
  comment "libv4l needs a toolchain w/ threads, C++ and headers >= 3.0"
package/libv4l/libv4l.mk +0 -0
index 4dc0f15f94..ee5a1f2241 100644

package/libv4l/libv4l.mk ifeq ($(BR2_PACKAGE_LIBV4L_UTILS),y) · line 63

Quoted 5 lines
package/libv4l/libv4l.mk +2 -0
@@ -59,6 +59,10 @@ ifeq ($(BR2_PACKAGE_LIBV4L_UTILS),y)
  LIBV4L_CONF_OPTS += --enable-v4l-utils
  LIBV4L_DEPENDENCIES += $(TARGET_NLS_DEPENDENCIES)
 
+# v4l2-ctl needs c++11, qt5 needs c++11 (since qt-5.7)/use gnu++11 for
+# typeof support

This no longer makes sense. The "use gnu++11" part is there because libv4l
uses 'typeof', which is a GNU extension, and -std=c++XX disables GNU extensions. qt5 needs -std=c++11, not -std=gnu++11. Since libv4l itself now requires c++11, the qt5 reference is no longer relevant.

So I removed the qt5 part and applied to master, thanks.

Regards,
Arnout

Quoted 6 lines
package/libv4l/libv4l.mk +2 -0
+LIBV4L_CONF_ENV += CXXFLAGS="$(TARGET_CXXFLAGS) -std=gnu++11"
+
  # IR BPF decoder support needs toolchain with linux-headers >= 3.18
  # libelf and clang support
  LIBV4L_CONF_OPTS += --disable-bpf

package/libv4l/libv4l.mk LIBV4L_CONF_ENV += \ · line 80

Quoted 8 lines
package/libv4l/libv4l.mk +0 -2
@@ -71,8 +75,6 @@ LIBV4L_CONF_ENV += \
  	ac_cv_prog_MOC=$(HOST_DIR)/bin/moc \
  	ac_cv_prog_RCC=$(HOST_DIR)/bin/rcc \
  	ac_cv_prog_UIC=$(HOST_DIR)/bin/uic
-# qt5 needs c++11 (since qt-5.7)/use gnu++11 for typeof support
-LIBV4L_CONF_ENV += CXXFLAGS="$(TARGET_CXXFLAGS) -std=gnu++11"
  else
  LIBV4L_CONF_OPTS += --disable-qv4l2
  endif

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot