[PATCH] configure.ac: Add option to disable compilation of v4l2-tracer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add a configuration time option to disable compilation of the
v4l2-tracer utility.

Signed-off-by: Niklas Söderlund <niklas.soderlund@xxxxxxxxxxxx>
---

Hi Hans,

The v4l2-tracer fails to build on arm32. While I'm sure that can be
fixed, this is an utility I don't use and building on target any thing I
can disable in the build saves me time.

>From completes, the classes of errors I see are around v4l2_fourcc(),
_IOR() and _IOWR().

../../include/linux/videodev2.h:81:66: error: narrowing conversion of '3039908417' from '__u32' {aka 'unsigned int'} to 'long int' [-Wnarrowing]
   81 | #define v4l2_fourcc_be(a, b, c, d)      (v4l2_fourcc(a, b, c, d) | (1U << 31))

../../include/linux/videodev2.h:2528:34: error: narrowing conversion of '2154321408' from 'unsigned int' to 'long int' [-Wnarrowing]
 2528 | #define VIDIOC_QUERYCAP          _IOR('V',  0, struct v4l2_capability)

../../include/linux/videodev2.h:2529:33: error: narrowing conversion of '3225441794' from 'unsigned int' to 'long int' [-Wnarrowing]
 2529 | #define VIDIOC_ENUM_FMT         _IOWR('V',  2, struct v4l2_fmtdesc)

I'm building on target with gcc 12.1.0, nothing fancy,

    $ ./bootstrap.sh && ./configure && make

Kind Regards
Niklas
---
 configure.ac      | 11 +++++++++++
 utils/Makefile.am |  2 +-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index dc9c4af71c45..46ddc7a8b404 100644
--- a/configure.ac
+++ b/configure.ac
@@ -497,6 +497,14 @@ AC_ARG_ENABLE(v4l2-compliance-32,
    esac]
 )
 
+AC_ARG_ENABLE(v4l2-tracer,
+  AS_HELP_STRING([--disable-v4l2-tracer], [disable v4l2-tracer compilation]),
+  [case "${enableval}" in
+     yes | no ) ;;
+     *) AC_MSG_ERROR(bad value ${enableval} for --disable-v4l2-tracer) ;;
+   esac]
+)
+
 AC_ARG_ENABLE(v4l2-ctl-libv4l,
   AS_HELP_STRING([--disable-v4l2-ctl-libv4l], [disable use of libv4l in v4l2-ctl]),
   [case "${enableval}" in
@@ -578,6 +586,7 @@ AM_CONDITIONAL([WITH_V4L2_CTL_32], [test x${enable_v4l2_ctl_32} = xyes])
 AM_CONDITIONAL([WITH_V4L2_COMPLIANCE], [test x$ac_cv_func_fork = xyes])
 AM_CONDITIONAL([WITH_V4L2_COMPLIANCE_LIBV4L], [test x$ac_cv_func_fork = xyes -a x${enable_v4l2_compliance_libv4l} != xno])
 AM_CONDITIONAL([WITH_V4L2_COMPLIANCE_32], [test x$ac_cv_func_fork = xyes -a x${enable_v4l2_compliance_32} = xyes])
+AM_CONDITIONAL([WITH_V4L2_TRACER], [test x$jsonc_pkgconfig = xyes -a x$enable_v4l2_tracer != xno])
 PKG_CHECK_MODULES([LIBBPF], [libbpf >= 0.7], [bpf_pc=yes], [bpf_pc=no])
 AM_CONDITIONAL([WITH_BPF],          [test x$enable_bpf != xno -a x$libelf_pkgconfig = xyes -a x$CLANG = xclang -a x$bpf_pc = xyes])
 
@@ -628,6 +637,7 @@ AM_COND_IF([WITH_V4L2_CTL_32], [USE_V4L2_CTL_32="yes"], [USE_V4L2_CTL_32="no"])
 AM_COND_IF([WITH_V4L2_COMPLIANCE], [USE_V4L2_COMPLIANCE="yes"], [USE_V4L2_COMPLIANCE="no"])
 AM_COND_IF([WITH_V4L2_COMPLIANCE_LIBV4L], [USE_V4L2_COMPLIANCE_LIBV4L="yes"], [USE_V4L2_COMPLIANCE_LIBV4L="no"])
 AM_COND_IF([WITH_V4L2_COMPLIANCE_32], [USE_V4L2_COMPLIANCE_32="yes"], [USE_V4L2_COMPLIANCE_32="no"])
+AM_COND_IF([WITH_V4L2_TRACER], [USE_V4L2_TRACER="yes"], [USE_V4L2_TRACER="no"])
 AM_COND_IF([WITH_BPF],         [USE_BPF="yes"
                                 AC_DEFINE([HAVE_BPF], [1], [BPF IR decoder support enabled])],
 				[USE_BPF="no"])
@@ -679,5 +689,6 @@ compile time options summary
     v4l2-compliance            : $USE_V4L2_COMPLIANCE
     v4l2-compliance uses libv4l: $USE_V4L2_COMPLIANCE_LIBV4L
     v4l2-compliance-32         : $USE_V4L2_COMPLIANCE_32
+    v4l2-tracer                : $USE_V4L2_TRACER
     BPF IR Decoders:           : $USE_BPF
 EOF
diff --git a/utils/Makefile.am b/utils/Makefile.am
index 6f59515ef29d..b2a6ac211473 100644
--- a/utils/Makefile.am
+++ b/utils/Makefile.am
@@ -15,7 +15,7 @@ SUBDIRS = \
 	cec-follower \
 	rds-ctl
 
-if HAVE_JSONC
+if WITH_V4L2_TRACER
 SUBDIRS += \
 	v4l2-tracer
 endif
-- 
2.39.1




[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux