diff mbox series

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

Message ID 20230211101231.3060841-1-niklas.soderlund@ragnatech.se (mailing list archive)
State New, archived
Headers show
Series configure.ac: Add option to disable compilation of v4l2-tracer | expand

Commit Message

Niklas Söderlund Feb. 11, 2023, 10:12 a.m. UTC
Add a configuration time option to disable compilation of the
v4l2-tracer utility.

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

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(-)

Comments

Deborah Brouwer Feb. 11, 2023, 7:53 p.m. UTC | #1
On Sat, Feb 11, 2023 at 11:12:31AM +0100, Niklas Söderlund wrote:
> Add a configuration time option to disable compilation of the
> v4l2-tracer utility.
> 
> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
> ---
> 
> 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

Hi Niklas,
Thanks for this patch it is good and probably how I should have done it
originally :) It does make the "HAVE_JSONC" conditional redundant, so once
this is applied, I will send a follow-up patch to replace "HAVE_JSONC" with
"WITH_V4L2_TRACER" in the v4l2-tracer Makefile.am.

Best,
Deb

> ---
>  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
>
Laurent Pinchart Feb. 11, 2023, 10:08 p.m. UTC | #2
Hi Niklas,

Thank you for the patch.

On Sat, Feb 11, 2023 at 11:12:31AM +0100, Niklas Söderlund wrote:
> Add a configuration time option to disable compilation of the
> v4l2-tracer utility.
> 
> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

with my limited autotools knowledge.

I'll add the same option to meson support :-)

> ---
> 
> 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
diff mbox series

Patch

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