Browse Source

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

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Peter Seiderer 3 years ago
parent
commit
184ce3ced3
2 changed files with 7 additions and 2 deletions
  1. 4 0
      package/libv4l/Config.in
  2. 3 2
      package/libv4l/libv4l.mk

+ 4 - 0
package/libv4l/Config.in

@@ -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"

+ 3 - 2
package/libv4l/libv4l.mk

@@ -59,6 +59,9 @@ ifeq ($(BR2_PACKAGE_LIBV4L_UTILS),y)
 LIBV4L_CONF_OPTS += --enable-v4l-utils
 LIBV4L_DEPENDENCIES += $(TARGET_NLS_DEPENDENCIES)
 
+# v4l2-ctl needs c++11, 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 +74,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