mbox series

[v4l-utils,v8,0/6] Switch build system to meson

Message ID 20230212005137.12025-1-laurent.pinchart@ideasonboard.com (mailing list archive)
Headers show
Series Switch build system to meson | expand

Message

Laurent Pinchart Feb. 12, 2023, 12:51 a.m. UTC
Hello everybody,

This series is the latest (and greatest) attempt to switch v4l-utils
from autotools to meson.

Compared to v7, the series has been rebased on top of the latest master
branch, and lots of fixes have been added. All review comments should
have been addressed. Detailed changelogs are included in individual
patches, in particular in patch 3/6.

The rebase was a bit painful due to the new v4l2-tracer tool and its
code generation script. While meson handles code generation fine, it
required fixes to the script to be able to specify the output directory
and to generate the trace and retrace sources separately. Many thanks to
Sakari for his help with this, which I've included in this series as
patch 1/6.

Gregor, I haven't included the Tested-by tag you gave on v7 as v8
contains many small changes. Sorry about that.

The patches are based on 3 pending patches for v4l-utils that have been
posted to the list in the last couple of days:

- libv4lconvert: Don't ignore return value of ftruncate()
- keytable: Add -fno-stack-protector compilation option
- configure.ac: Add option to disable compilation of v4l2-tracer

None are strictly required, but I've included the equivalent of the
second and third patches in the meson support, so I wanted to base the
patches on top of the autotools' equivalent. I expect those three
patches to be merged soon.

As far as I can tell, meson support is now ready. I can address review
comments in a v9 if there are any, but I'd like to merge it soon to
avoid another painful rebase. I'll be available to fix issues on top if
any problem is encountered later.

A tag that includes this series can be found at

        git://linuxtv.org/pinchartl/v4l-utils.git tags/meson-v8

Ariel D'Alessandro (4):
  Move README to markdown syntax
  Add support for meson building
  Copy Doxygen configuration file to doc/
  meson: Add support for doxygen documentation

Laurent Pinchart (1):
  Drop autoconf/automake support

Sakari Ailus (1):
  utils: Allow choosing v4l2-tracer-gen.pl output

 .gitignore                                    |  62 +-
 INSTALL                                       | 105 ---
 INSTALL.md                                    | 142 ++++
 Makefile.am                                   |  20 -
 README                                        | 282 -------
 README.md                                     | 285 +++++++
 aminclude.am                                  | 186 -----
 bootstrap.sh                                  |  28 -
 configure.ac                                  | 694 ------------------
 contrib/Makefile.am                           |  25 -
 contrib/cobalt-ctl/.gitignore                 |   1 -
 contrib/cobalt-ctl/Makefile.am                |   3 -
 contrib/cobalt-ctl/meson.build                |   8 +
 contrib/decode_tm6000/.gitignore              |   1 -
 contrib/decode_tm6000/Makefile.am             |   4 -
 contrib/decode_tm6000/meson.build             |  14 +
 contrib/freebsd/Makefile.am                   |   3 -
 contrib/gconv/Makefile.am                     |  17 -
 contrib/gconv/meson.build                     |  44 ++
 contrib/meson.build                           |  13 +
 contrib/rds-saa6588/.gitignore                |   1 -
 contrib/rds-saa6588/Makefile.am               |   3 -
 contrib/rds-saa6588/meson.build               |   7 +
 contrib/test/.gitignore                       |  11 -
 contrib/test/Makefile.am                      |  65 --
 contrib/test/meson.build                      | 143 ++++
 contrib/xc3028-firmware/.gitignore            |   1 -
 contrib/xc3028-firmware/Makefile.am           |   5 -
 contrib/xc3028-firmware/meson.build           |  11 +
 doxygen_libdvbv5.cfg => doc/Doxyfile.in       | 128 ++--
 doc/meson.build                               |  34 +
 lib/Makefile.am                               |  13 -
 lib/libdvbv5/Makefile.am                      | 126 ----
 lib/libdvbv5/libdvbv5.pc.in                   |  11 -
 lib/libdvbv5/meson.build                      | 156 ++++
 lib/libv4l-mplane/Makefile.am                 |   7 -
 lib/libv4l-mplane/meson.build                 |  23 +
 lib/libv4l1/Makefile.am                       |  29 -
 lib/libv4l1/libv4l1.pc.in                     |  12 -
 lib/libv4l1/meson.build                       |  64 ++
 lib/libv4l2/Makefile.am                       |  32 -
 lib/libv4l2/libv4l2.pc.in                     |  12 -
 lib/libv4l2/meson.build                       |  73 ++
 lib/libv4l2rds/Makefile.am                    |  12 -
 lib/libv4l2rds/libv4l2rds.pc.in               |  11 -
 lib/libv4l2rds/meson.build                    |  37 +
 lib/libv4lconvert/.gitignore                  |   3 -
 lib/libv4lconvert/Makefile.am                 |  36 -
 lib/libv4lconvert/libv4lconvert.pc.in         |  11 -
 lib/libv4lconvert/meson.build                 | 117 +++
 lib/meson.build                               |  11 +
 libdvbv5-po/Makevars                          |  72 --
 libdvbv5-po/meson.build                       |   3 +
 m4/ac_define_dir.m4                           |  34 -
 m4/ax_prog_doxygen.m4                         | 532 --------------
 m4/ax_pthread.m4                              | 522 -------------
 m4/mode_t.m4                                  |  26 -
 m4/visibility.m4                              |  82 ---
 meson.build                                   | 399 ++++++++++
 meson_options.txt                             |  54 ++
 utils/Makefile.am                             |  41 --
 utils/cec-compliance/.gitignore               |   2 -
 utils/cec-compliance/Makefile.am              |   8 -
 utils/cec-compliance/meson.build              |  23 +
 utils/cec-ctl/.gitignore                      |   2 -
 utils/cec-ctl/Makefile.am                     |   8 -
 utils/cec-ctl/meson.build                     |  18 +
 utils/cec-follower/.gitignore                 |   2 -
 utils/cec-follower/Makefile.am                |   8 -
 utils/cec-follower/meson.build                |  19 +
 utils/cx18-ctl/.gitignore                     |   1 -
 utils/cx18-ctl/Makefile.am                    |   3 -
 utils/cx18-ctl/meson.build                    |   8 +
 utils/dvb/.gitignore                          |   9 -
 utils/dvb/Makefile.am                         |  35 -
 utils/dvb/meson.build                         |  70 ++
 utils/gen_media_bus_format_codes.sh           |   7 +
 utils/gen_media_bus_format_names.sh           |   7 +
 utils/ir-ctl/.gitignore                       |   2 -
 utils/ir-ctl/Makefile.am                      |   6 -
 utils/ir-ctl/meson.build                      |  23 +
 utils/ivtv-ctl/.gitignore                     |   1 -
 utils/ivtv-ctl/Makefile.am                    |   4 -
 utils/ivtv-ctl/meson.build                    |  13 +
 utils/keytable/.gitignore                     |   3 -
 utils/keytable/Makefile.am                    |  36 -
 utils/keytable/bpf_protocols/Makefile.am      |  24 -
 .../bpf_protocols/clang_sys_includes.sh       |   9 +
 utils/keytable/bpf_protocols/meson.build      |  31 +
 utils/keytable/meson.build                    |  85 +++
 utils/keytable/rc_keymaps/meson.build         | 150 ++++
 utils/libcecutil/.gitignore                   |   4 -
 utils/libcecutil/Makefile.am                  |  24 -
 utils/libcecutil/meson.build                  |  45 ++
 utils/libmedia_dev/Makefile.am                |   7 -
 utils/libmedia_dev/meson.build                |  14 +
 utils/libv4l2util/Makefile.am                 |   7 -
 utils/libv4l2util/meson.build                 |  16 +
 utils/media-ctl/.gitignore                    |   3 -
 utils/media-ctl/Makefile.am                   |  30 -
 utils/media-ctl/libmediactl.pc.in             |  10 -
 utils/media-ctl/libv4l2subdev.pc.in           |  11 -
 utils/media-ctl/meson.build                   |  43 ++
 utils/meson.build                             |  43 ++
 utils/qv4l2/.gitignore                        |   9 -
 utils/qv4l2/Makefile.am                       |  54 --
 utils/qv4l2/meson.build                       |  79 ++
 utils/qvidcap/.gitignore                      |   6 -
 utils/qvidcap/Makefile.am                     |  42 --
 utils/qvidcap/meson.build                     |  87 +++
 utils/rds-ctl/.gitignore                      |   2 -
 utils/rds-ctl/Makefile.am                     |   6 -
 utils/rds-ctl/meson.build                     |  17 +
 utils/v4l2-compliance/.gitignore              |   3 -
 utils/v4l2-compliance/Makefile.am             |  31 -
 utils/v4l2-compliance/meson.build             |  63 ++
 utils/v4l2-ctl/.gitignore                     |   4 -
 utils/v4l2-ctl/Makefile.am                    |  44 --
 utils/v4l2-ctl/meson.build                    |  75 ++
 utils/v4l2-dbg/.gitignore                     |   1 -
 utils/v4l2-dbg/Makefile.am                    |   6 -
 utils/v4l2-dbg/meson.build                    |  20 +
 utils/v4l2-sysfs-path/.gitignore              |   1 -
 utils/v4l2-sysfs-path/Makefile.am             |   4 -
 utils/v4l2-sysfs-path/meson.build             |  14 +
 utils/v4l2-tracer/.gitignore                  |   7 -
 utils/v4l2-tracer/Makefile.am                 |  36 -
 utils/v4l2-tracer/media-info.cpp              |   1 +
 utils/v4l2-tracer/meson.build                 | 133 ++++
 utils/v4l2-tracer/v4l2-info.cpp               |   1 +
 utils/v4l2-tracer/v4l2-tracer-gen.pl          |  36 +-
 v4l-utils-po/Makevars                         |  72 --
 v4l-utils-po/meson.build                      |   3 +
 v4l-utils.spec.in                             |   6 +-
 134 files changed, 2854 insertions(+), 3790 deletions(-)
 delete mode 100644 INSTALL
 create mode 100644 INSTALL.md
 delete mode 100644 Makefile.am
 delete mode 100644 README
 create mode 100644 README.md
 delete mode 100644 aminclude.am
 delete mode 100755 bootstrap.sh
 delete mode 100644 configure.ac
 delete mode 100644 contrib/Makefile.am
 delete mode 100644 contrib/cobalt-ctl/.gitignore
 delete mode 100644 contrib/cobalt-ctl/Makefile.am
 create mode 100644 contrib/cobalt-ctl/meson.build
 delete mode 100644 contrib/decode_tm6000/.gitignore
 delete mode 100644 contrib/decode_tm6000/Makefile.am
 create mode 100644 contrib/decode_tm6000/meson.build
 delete mode 100644 contrib/freebsd/Makefile.am
 delete mode 100644 contrib/gconv/Makefile.am
 create mode 100644 contrib/gconv/meson.build
 create mode 100644 contrib/meson.build
 delete mode 100644 contrib/rds-saa6588/.gitignore
 delete mode 100644 contrib/rds-saa6588/Makefile.am
 create mode 100644 contrib/rds-saa6588/meson.build
 delete mode 100644 contrib/test/.gitignore
 delete mode 100644 contrib/test/Makefile.am
 create mode 100644 contrib/test/meson.build
 delete mode 100644 contrib/xc3028-firmware/.gitignore
 delete mode 100644 contrib/xc3028-firmware/Makefile.am
 create mode 100644 contrib/xc3028-firmware/meson.build
 rename doxygen_libdvbv5.cfg => doc/Doxyfile.in (96%)
 create mode 100644 doc/meson.build
 delete mode 100644 lib/Makefile.am
 delete mode 100644 lib/libdvbv5/Makefile.am
 delete mode 100644 lib/libdvbv5/libdvbv5.pc.in
 create mode 100644 lib/libdvbv5/meson.build
 delete mode 100644 lib/libv4l-mplane/Makefile.am
 create mode 100644 lib/libv4l-mplane/meson.build
 delete mode 100644 lib/libv4l1/Makefile.am
 delete mode 100644 lib/libv4l1/libv4l1.pc.in
 create mode 100644 lib/libv4l1/meson.build
 delete mode 100644 lib/libv4l2/Makefile.am
 delete mode 100644 lib/libv4l2/libv4l2.pc.in
 create mode 100644 lib/libv4l2/meson.build
 delete mode 100644 lib/libv4l2rds/Makefile.am
 delete mode 100644 lib/libv4l2rds/libv4l2rds.pc.in
 create mode 100644 lib/libv4l2rds/meson.build
 delete mode 100644 lib/libv4lconvert/.gitignore
 delete mode 100644 lib/libv4lconvert/Makefile.am
 delete mode 100644 lib/libv4lconvert/libv4lconvert.pc.in
 create mode 100644 lib/libv4lconvert/meson.build
 create mode 100644 lib/meson.build
 delete mode 100644 libdvbv5-po/Makevars
 create mode 100644 libdvbv5-po/meson.build
 delete mode 100644 m4/ac_define_dir.m4
 delete mode 100644 m4/ax_prog_doxygen.m4
 delete mode 100644 m4/ax_pthread.m4
 delete mode 100644 m4/mode_t.m4
 delete mode 100644 m4/visibility.m4
 create mode 100644 meson.build
 create mode 100644 meson_options.txt
 delete mode 100644 utils/Makefile.am
 delete mode 100644 utils/cec-compliance/.gitignore
 delete mode 100644 utils/cec-compliance/Makefile.am
 create mode 100644 utils/cec-compliance/meson.build
 delete mode 100644 utils/cec-ctl/.gitignore
 delete mode 100644 utils/cec-ctl/Makefile.am
 create mode 100644 utils/cec-ctl/meson.build
 delete mode 100644 utils/cec-follower/.gitignore
 delete mode 100644 utils/cec-follower/Makefile.am
 create mode 100644 utils/cec-follower/meson.build
 delete mode 100644 utils/cx18-ctl/.gitignore
 delete mode 100644 utils/cx18-ctl/Makefile.am
 create mode 100644 utils/cx18-ctl/meson.build
 delete mode 100644 utils/dvb/.gitignore
 delete mode 100644 utils/dvb/Makefile.am
 create mode 100644 utils/dvb/meson.build
 create mode 100755 utils/gen_media_bus_format_codes.sh
 create mode 100755 utils/gen_media_bus_format_names.sh
 delete mode 100644 utils/ir-ctl/.gitignore
 delete mode 100644 utils/ir-ctl/Makefile.am
 create mode 100644 utils/ir-ctl/meson.build
 delete mode 100644 utils/ivtv-ctl/.gitignore
 delete mode 100644 utils/ivtv-ctl/Makefile.am
 create mode 100644 utils/ivtv-ctl/meson.build
 delete mode 100644 utils/keytable/.gitignore
 delete mode 100644 utils/keytable/Makefile.am
 delete mode 100644 utils/keytable/bpf_protocols/Makefile.am
 create mode 100755 utils/keytable/bpf_protocols/clang_sys_includes.sh
 create mode 100644 utils/keytable/bpf_protocols/meson.build
 create mode 100644 utils/keytable/meson.build
 create mode 100644 utils/keytable/rc_keymaps/meson.build
 delete mode 100644 utils/libcecutil/.gitignore
 delete mode 100644 utils/libcecutil/Makefile.am
 create mode 100644 utils/libcecutil/meson.build
 delete mode 100644 utils/libmedia_dev/Makefile.am
 create mode 100644 utils/libmedia_dev/meson.build
 delete mode 100644 utils/libv4l2util/Makefile.am
 create mode 100644 utils/libv4l2util/meson.build
 delete mode 100644 utils/media-ctl/.gitignore
 delete mode 100644 utils/media-ctl/Makefile.am
 delete mode 100644 utils/media-ctl/libmediactl.pc.in
 delete mode 100644 utils/media-ctl/libv4l2subdev.pc.in
 create mode 100644 utils/media-ctl/meson.build
 create mode 100644 utils/meson.build
 delete mode 100644 utils/qv4l2/.gitignore
 delete mode 100644 utils/qv4l2/Makefile.am
 create mode 100644 utils/qv4l2/meson.build
 delete mode 100644 utils/qvidcap/.gitignore
 delete mode 100644 utils/qvidcap/Makefile.am
 create mode 100644 utils/qvidcap/meson.build
 delete mode 100644 utils/rds-ctl/.gitignore
 delete mode 100644 utils/rds-ctl/Makefile.am
 create mode 100644 utils/rds-ctl/meson.build
 delete mode 100644 utils/v4l2-compliance/.gitignore
 delete mode 100644 utils/v4l2-compliance/Makefile.am
 create mode 100644 utils/v4l2-compliance/meson.build
 delete mode 100644 utils/v4l2-ctl/.gitignore
 delete mode 100644 utils/v4l2-ctl/Makefile.am
 create mode 100644 utils/v4l2-ctl/meson.build
 delete mode 100644 utils/v4l2-dbg/.gitignore
 delete mode 100644 utils/v4l2-dbg/Makefile.am
 create mode 100644 utils/v4l2-dbg/meson.build
 delete mode 100644 utils/v4l2-sysfs-path/.gitignore
 delete mode 100644 utils/v4l2-sysfs-path/Makefile.am
 create mode 100644 utils/v4l2-sysfs-path/meson.build
 delete mode 100644 utils/v4l2-tracer/.gitignore
 delete mode 100644 utils/v4l2-tracer/Makefile.am
 create mode 120000 utils/v4l2-tracer/media-info.cpp
 create mode 100644 utils/v4l2-tracer/meson.build
 create mode 120000 utils/v4l2-tracer/v4l2-info.cpp
 delete mode 100644 v4l-utils-po/Makevars
 create mode 100644 v4l-utils-po/meson.build


base-commit: 310b43a6452b31db2eaff863f057523eadbfcc14
prerequisite-patch-id: 3536110786ee89506c05ec8d88fafb597b698d6b
prerequisite-patch-id: faa8ba32b217309c605d66a0e685263043ae687d
prerequisite-patch-id: a3c446b1d2375e7f7dc342083ad135bc5c47e9e8

Comments

Niklas Söderlund Feb. 12, 2023, 6:15 p.m. UTC | #1
Hi Laurent,

The build log is so much more useful with meson. It actually highlights 
some Doxygen issues that should be fixed (unrelated to this series) that 
otherwise was hidden in the noise.

warning: Tag 'FORMULA_TRANSPARENT' at line 1431 of file 'doc/Doxyfile' has become obsolete.
         To avoid this warning please remove this line from your configuration file or upgrade it using "doxygen -u"
warning: Tag 'DOT_FONTNAME' at line 2062 of file 'doc/Doxyfile' has become obsolete.
         To avoid this warning please remove this line from your configuration file or upgrade it using "doxygen -u"
warning: Tag 'DOT_FONTSIZE' at line 2069 of file 'doc/Doxyfile' has become obsolete.
         To avoid this warning please remove this line from your configuration file or upgrade it using "doxygen -u"
warning: Tag 'DOT_TRANSPARENT' at line 2269 of file 'doc/Doxyfile' has become obsolete.
         To avoid this warning please remove this line from your configuration file or upgrade it using "doxygen -u"
/home/neg/work/repo/v4l-utils/lib/include/libdvbv5/pmt.h:59: warning: documented symbol 'stream_reserved0' was not declared or defined.
/home/neg/work/repo/v4l-utils/lib/include/libdvbv5/pmt.h:101: warning: documented symbol 'stream_reserved' was not declared or defined.
/home/neg/work/repo/v4l-utils/lib/include/libdvbv5/pmt.h:103: warning: documented symbol 'stream_private' was not declared or defined.
/home/neg/work/repo/v4l-utils/lib/include/libdvbv5/dvb-dev.h:117: warning: Found unknown command '@type'
/home/neg/work/repo/v4l-utils/lib/include/libdvbv5/dvb-dev.h:171: warning: argument 'enable_monitor' of command @param is not found in the argument list of dvb_dev_find(struct dvb_device *dvb, dvb_dev_change_t handler, void *user_priv)
/home/neg/work/repo/v4l-utils/lib/include/libdvbv5/dvb-dev.h:171: warning: The following parameter of dvb_dev_find(struct dvb_device *dvb, dvb_dev_change_t handler, void *user_priv) is not documented:
  parameter 'handler'
/home/neg/work/repo/v4l-utils/lib/include/libdvbv5/dvb-sat.h:147: warning: argument 'parms' of command @param is not found in the argument list of dvb_sat_real_freq(struct dvb_v5_fe_parms *p, int freq)
/home/neg/work/repo/v4l-utils/lib/include/libdvbv5/dvb-sat.h:147: warning: The following parameters of dvb_sat_real_freq(struct dvb_v5_fe_parms *p, int freq) are not documented:
  parameter 'p'
  parameter 'freq'
/home/neg/work/repo/v4l-utils/lib/include/libdvbv5/desc_extension.h:141: warning: argument 'buf' of command @param is not found in the argument list of dvb_desc_ext_print_func(struct dvb_v5_fe_parms *parms, const struct dvb_extension_descriptor *ext, const void *desc)

For the whole series,

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

On 2023-02-12 02:51:31 +0200, Laurent Pinchart wrote:
> Hello everybody,
> 
> This series is the latest (and greatest) attempt to switch v4l-utils
> from autotools to meson.
> 
> Compared to v7, the series has been rebased on top of the latest master
> branch, and lots of fixes have been added. All review comments should
> have been addressed. Detailed changelogs are included in individual
> patches, in particular in patch 3/6.
> 
> The rebase was a bit painful due to the new v4l2-tracer tool and its
> code generation script. While meson handles code generation fine, it
> required fixes to the script to be able to specify the output directory
> and to generate the trace and retrace sources separately. Many thanks to
> Sakari for his help with this, which I've included in this series as
> patch 1/6.
> 
> Gregor, I haven't included the Tested-by tag you gave on v7 as v8
> contains many small changes. Sorry about that.
> 
> The patches are based on 3 pending patches for v4l-utils that have been
> posted to the list in the last couple of days:
> 
> - libv4lconvert: Don't ignore return value of ftruncate()
> - keytable: Add -fno-stack-protector compilation option
> - configure.ac: Add option to disable compilation of v4l2-tracer
> 
> None are strictly required, but I've included the equivalent of the
> second and third patches in the meson support, so I wanted to base the
> patches on top of the autotools' equivalent. I expect those three
> patches to be merged soon.
> 
> As far as I can tell, meson support is now ready. I can address review
> comments in a v9 if there are any, but I'd like to merge it soon to
> avoid another painful rebase. I'll be available to fix issues on top if
> any problem is encountered later.
> 
> A tag that includes this series can be found at
> 
>         git://linuxtv.org/pinchartl/v4l-utils.git tags/meson-v8
> 
> Ariel D'Alessandro (4):
>   Move README to markdown syntax
>   Add support for meson building
>   Copy Doxygen configuration file to doc/
>   meson: Add support for doxygen documentation
> 
> Laurent Pinchart (1):
>   Drop autoconf/automake support
> 
> Sakari Ailus (1):
>   utils: Allow choosing v4l2-tracer-gen.pl output
> 
>  .gitignore                                    |  62 +-
>  INSTALL                                       | 105 ---
>  INSTALL.md                                    | 142 ++++
>  Makefile.am                                   |  20 -
>  README                                        | 282 -------
>  README.md                                     | 285 +++++++
>  aminclude.am                                  | 186 -----
>  bootstrap.sh                                  |  28 -
>  configure.ac                                  | 694 ------------------
>  contrib/Makefile.am                           |  25 -
>  contrib/cobalt-ctl/.gitignore                 |   1 -
>  contrib/cobalt-ctl/Makefile.am                |   3 -
>  contrib/cobalt-ctl/meson.build                |   8 +
>  contrib/decode_tm6000/.gitignore              |   1 -
>  contrib/decode_tm6000/Makefile.am             |   4 -
>  contrib/decode_tm6000/meson.build             |  14 +
>  contrib/freebsd/Makefile.am                   |   3 -
>  contrib/gconv/Makefile.am                     |  17 -
>  contrib/gconv/meson.build                     |  44 ++
>  contrib/meson.build                           |  13 +
>  contrib/rds-saa6588/.gitignore                |   1 -
>  contrib/rds-saa6588/Makefile.am               |   3 -
>  contrib/rds-saa6588/meson.build               |   7 +
>  contrib/test/.gitignore                       |  11 -
>  contrib/test/Makefile.am                      |  65 --
>  contrib/test/meson.build                      | 143 ++++
>  contrib/xc3028-firmware/.gitignore            |   1 -
>  contrib/xc3028-firmware/Makefile.am           |   5 -
>  contrib/xc3028-firmware/meson.build           |  11 +
>  doxygen_libdvbv5.cfg => doc/Doxyfile.in       | 128 ++--
>  doc/meson.build                               |  34 +
>  lib/Makefile.am                               |  13 -
>  lib/libdvbv5/Makefile.am                      | 126 ----
>  lib/libdvbv5/libdvbv5.pc.in                   |  11 -
>  lib/libdvbv5/meson.build                      | 156 ++++
>  lib/libv4l-mplane/Makefile.am                 |   7 -
>  lib/libv4l-mplane/meson.build                 |  23 +
>  lib/libv4l1/Makefile.am                       |  29 -
>  lib/libv4l1/libv4l1.pc.in                     |  12 -
>  lib/libv4l1/meson.build                       |  64 ++
>  lib/libv4l2/Makefile.am                       |  32 -
>  lib/libv4l2/libv4l2.pc.in                     |  12 -
>  lib/libv4l2/meson.build                       |  73 ++
>  lib/libv4l2rds/Makefile.am                    |  12 -
>  lib/libv4l2rds/libv4l2rds.pc.in               |  11 -
>  lib/libv4l2rds/meson.build                    |  37 +
>  lib/libv4lconvert/.gitignore                  |   3 -
>  lib/libv4lconvert/Makefile.am                 |  36 -
>  lib/libv4lconvert/libv4lconvert.pc.in         |  11 -
>  lib/libv4lconvert/meson.build                 | 117 +++
>  lib/meson.build                               |  11 +
>  libdvbv5-po/Makevars                          |  72 --
>  libdvbv5-po/meson.build                       |   3 +
>  m4/ac_define_dir.m4                           |  34 -
>  m4/ax_prog_doxygen.m4                         | 532 --------------
>  m4/ax_pthread.m4                              | 522 -------------
>  m4/mode_t.m4                                  |  26 -
>  m4/visibility.m4                              |  82 ---
>  meson.build                                   | 399 ++++++++++
>  meson_options.txt                             |  54 ++
>  utils/Makefile.am                             |  41 --
>  utils/cec-compliance/.gitignore               |   2 -
>  utils/cec-compliance/Makefile.am              |   8 -
>  utils/cec-compliance/meson.build              |  23 +
>  utils/cec-ctl/.gitignore                      |   2 -
>  utils/cec-ctl/Makefile.am                     |   8 -
>  utils/cec-ctl/meson.build                     |  18 +
>  utils/cec-follower/.gitignore                 |   2 -
>  utils/cec-follower/Makefile.am                |   8 -
>  utils/cec-follower/meson.build                |  19 +
>  utils/cx18-ctl/.gitignore                     |   1 -
>  utils/cx18-ctl/Makefile.am                    |   3 -
>  utils/cx18-ctl/meson.build                    |   8 +
>  utils/dvb/.gitignore                          |   9 -
>  utils/dvb/Makefile.am                         |  35 -
>  utils/dvb/meson.build                         |  70 ++
>  utils/gen_media_bus_format_codes.sh           |   7 +
>  utils/gen_media_bus_format_names.sh           |   7 +
>  utils/ir-ctl/.gitignore                       |   2 -
>  utils/ir-ctl/Makefile.am                      |   6 -
>  utils/ir-ctl/meson.build                      |  23 +
>  utils/ivtv-ctl/.gitignore                     |   1 -
>  utils/ivtv-ctl/Makefile.am                    |   4 -
>  utils/ivtv-ctl/meson.build                    |  13 +
>  utils/keytable/.gitignore                     |   3 -
>  utils/keytable/Makefile.am                    |  36 -
>  utils/keytable/bpf_protocols/Makefile.am      |  24 -
>  .../bpf_protocols/clang_sys_includes.sh       |   9 +
>  utils/keytable/bpf_protocols/meson.build      |  31 +
>  utils/keytable/meson.build                    |  85 +++
>  utils/keytable/rc_keymaps/meson.build         | 150 ++++
>  utils/libcecutil/.gitignore                   |   4 -
>  utils/libcecutil/Makefile.am                  |  24 -
>  utils/libcecutil/meson.build                  |  45 ++
>  utils/libmedia_dev/Makefile.am                |   7 -
>  utils/libmedia_dev/meson.build                |  14 +
>  utils/libv4l2util/Makefile.am                 |   7 -
>  utils/libv4l2util/meson.build                 |  16 +
>  utils/media-ctl/.gitignore                    |   3 -
>  utils/media-ctl/Makefile.am                   |  30 -
>  utils/media-ctl/libmediactl.pc.in             |  10 -
>  utils/media-ctl/libv4l2subdev.pc.in           |  11 -
>  utils/media-ctl/meson.build                   |  43 ++
>  utils/meson.build                             |  43 ++
>  utils/qv4l2/.gitignore                        |   9 -
>  utils/qv4l2/Makefile.am                       |  54 --
>  utils/qv4l2/meson.build                       |  79 ++
>  utils/qvidcap/.gitignore                      |   6 -
>  utils/qvidcap/Makefile.am                     |  42 --
>  utils/qvidcap/meson.build                     |  87 +++
>  utils/rds-ctl/.gitignore                      |   2 -
>  utils/rds-ctl/Makefile.am                     |   6 -
>  utils/rds-ctl/meson.build                     |  17 +
>  utils/v4l2-compliance/.gitignore              |   3 -
>  utils/v4l2-compliance/Makefile.am             |  31 -
>  utils/v4l2-compliance/meson.build             |  63 ++
>  utils/v4l2-ctl/.gitignore                     |   4 -
>  utils/v4l2-ctl/Makefile.am                    |  44 --
>  utils/v4l2-ctl/meson.build                    |  75 ++
>  utils/v4l2-dbg/.gitignore                     |   1 -
>  utils/v4l2-dbg/Makefile.am                    |   6 -
>  utils/v4l2-dbg/meson.build                    |  20 +
>  utils/v4l2-sysfs-path/.gitignore              |   1 -
>  utils/v4l2-sysfs-path/Makefile.am             |   4 -
>  utils/v4l2-sysfs-path/meson.build             |  14 +
>  utils/v4l2-tracer/.gitignore                  |   7 -
>  utils/v4l2-tracer/Makefile.am                 |  36 -
>  utils/v4l2-tracer/media-info.cpp              |   1 +
>  utils/v4l2-tracer/meson.build                 | 133 ++++
>  utils/v4l2-tracer/v4l2-info.cpp               |   1 +
>  utils/v4l2-tracer/v4l2-tracer-gen.pl          |  36 +-
>  v4l-utils-po/Makevars                         |  72 --
>  v4l-utils-po/meson.build                      |   3 +
>  v4l-utils.spec.in                             |   6 +-
>  134 files changed, 2854 insertions(+), 3790 deletions(-)
>  delete mode 100644 INSTALL
>  create mode 100644 INSTALL.md
>  delete mode 100644 Makefile.am
>  delete mode 100644 README
>  create mode 100644 README.md
>  delete mode 100644 aminclude.am
>  delete mode 100755 bootstrap.sh
>  delete mode 100644 configure.ac
>  delete mode 100644 contrib/Makefile.am
>  delete mode 100644 contrib/cobalt-ctl/.gitignore
>  delete mode 100644 contrib/cobalt-ctl/Makefile.am
>  create mode 100644 contrib/cobalt-ctl/meson.build
>  delete mode 100644 contrib/decode_tm6000/.gitignore
>  delete mode 100644 contrib/decode_tm6000/Makefile.am
>  create mode 100644 contrib/decode_tm6000/meson.build
>  delete mode 100644 contrib/freebsd/Makefile.am
>  delete mode 100644 contrib/gconv/Makefile.am
>  create mode 100644 contrib/gconv/meson.build
>  create mode 100644 contrib/meson.build
>  delete mode 100644 contrib/rds-saa6588/.gitignore
>  delete mode 100644 contrib/rds-saa6588/Makefile.am
>  create mode 100644 contrib/rds-saa6588/meson.build
>  delete mode 100644 contrib/test/.gitignore
>  delete mode 100644 contrib/test/Makefile.am
>  create mode 100644 contrib/test/meson.build
>  delete mode 100644 contrib/xc3028-firmware/.gitignore
>  delete mode 100644 contrib/xc3028-firmware/Makefile.am
>  create mode 100644 contrib/xc3028-firmware/meson.build
>  rename doxygen_libdvbv5.cfg => doc/Doxyfile.in (96%)
>  create mode 100644 doc/meson.build
>  delete mode 100644 lib/Makefile.am
>  delete mode 100644 lib/libdvbv5/Makefile.am
>  delete mode 100644 lib/libdvbv5/libdvbv5.pc.in
>  create mode 100644 lib/libdvbv5/meson.build
>  delete mode 100644 lib/libv4l-mplane/Makefile.am
>  create mode 100644 lib/libv4l-mplane/meson.build
>  delete mode 100644 lib/libv4l1/Makefile.am
>  delete mode 100644 lib/libv4l1/libv4l1.pc.in
>  create mode 100644 lib/libv4l1/meson.build
>  delete mode 100644 lib/libv4l2/Makefile.am
>  delete mode 100644 lib/libv4l2/libv4l2.pc.in
>  create mode 100644 lib/libv4l2/meson.build
>  delete mode 100644 lib/libv4l2rds/Makefile.am
>  delete mode 100644 lib/libv4l2rds/libv4l2rds.pc.in
>  create mode 100644 lib/libv4l2rds/meson.build
>  delete mode 100644 lib/libv4lconvert/.gitignore
>  delete mode 100644 lib/libv4lconvert/Makefile.am
>  delete mode 100644 lib/libv4lconvert/libv4lconvert.pc.in
>  create mode 100644 lib/libv4lconvert/meson.build
>  create mode 100644 lib/meson.build
>  delete mode 100644 libdvbv5-po/Makevars
>  create mode 100644 libdvbv5-po/meson.build
>  delete mode 100644 m4/ac_define_dir.m4
>  delete mode 100644 m4/ax_prog_doxygen.m4
>  delete mode 100644 m4/ax_pthread.m4
>  delete mode 100644 m4/mode_t.m4
>  delete mode 100644 m4/visibility.m4
>  create mode 100644 meson.build
>  create mode 100644 meson_options.txt
>  delete mode 100644 utils/Makefile.am
>  delete mode 100644 utils/cec-compliance/.gitignore
>  delete mode 100644 utils/cec-compliance/Makefile.am
>  create mode 100644 utils/cec-compliance/meson.build
>  delete mode 100644 utils/cec-ctl/.gitignore
>  delete mode 100644 utils/cec-ctl/Makefile.am
>  create mode 100644 utils/cec-ctl/meson.build
>  delete mode 100644 utils/cec-follower/.gitignore
>  delete mode 100644 utils/cec-follower/Makefile.am
>  create mode 100644 utils/cec-follower/meson.build
>  delete mode 100644 utils/cx18-ctl/.gitignore
>  delete mode 100644 utils/cx18-ctl/Makefile.am
>  create mode 100644 utils/cx18-ctl/meson.build
>  delete mode 100644 utils/dvb/.gitignore
>  delete mode 100644 utils/dvb/Makefile.am
>  create mode 100644 utils/dvb/meson.build
>  create mode 100755 utils/gen_media_bus_format_codes.sh
>  create mode 100755 utils/gen_media_bus_format_names.sh
>  delete mode 100644 utils/ir-ctl/.gitignore
>  delete mode 100644 utils/ir-ctl/Makefile.am
>  create mode 100644 utils/ir-ctl/meson.build
>  delete mode 100644 utils/ivtv-ctl/.gitignore
>  delete mode 100644 utils/ivtv-ctl/Makefile.am
>  create mode 100644 utils/ivtv-ctl/meson.build
>  delete mode 100644 utils/keytable/.gitignore
>  delete mode 100644 utils/keytable/Makefile.am
>  delete mode 100644 utils/keytable/bpf_protocols/Makefile.am
>  create mode 100755 utils/keytable/bpf_protocols/clang_sys_includes.sh
>  create mode 100644 utils/keytable/bpf_protocols/meson.build
>  create mode 100644 utils/keytable/meson.build
>  create mode 100644 utils/keytable/rc_keymaps/meson.build
>  delete mode 100644 utils/libcecutil/.gitignore
>  delete mode 100644 utils/libcecutil/Makefile.am
>  create mode 100644 utils/libcecutil/meson.build
>  delete mode 100644 utils/libmedia_dev/Makefile.am
>  create mode 100644 utils/libmedia_dev/meson.build
>  delete mode 100644 utils/libv4l2util/Makefile.am
>  create mode 100644 utils/libv4l2util/meson.build
>  delete mode 100644 utils/media-ctl/.gitignore
>  delete mode 100644 utils/media-ctl/Makefile.am
>  delete mode 100644 utils/media-ctl/libmediactl.pc.in
>  delete mode 100644 utils/media-ctl/libv4l2subdev.pc.in
>  create mode 100644 utils/media-ctl/meson.build
>  create mode 100644 utils/meson.build
>  delete mode 100644 utils/qv4l2/.gitignore
>  delete mode 100644 utils/qv4l2/Makefile.am
>  create mode 100644 utils/qv4l2/meson.build
>  delete mode 100644 utils/qvidcap/.gitignore
>  delete mode 100644 utils/qvidcap/Makefile.am
>  create mode 100644 utils/qvidcap/meson.build
>  delete mode 100644 utils/rds-ctl/.gitignore
>  delete mode 100644 utils/rds-ctl/Makefile.am
>  create mode 100644 utils/rds-ctl/meson.build
>  delete mode 100644 utils/v4l2-compliance/.gitignore
>  delete mode 100644 utils/v4l2-compliance/Makefile.am
>  create mode 100644 utils/v4l2-compliance/meson.build
>  delete mode 100644 utils/v4l2-ctl/.gitignore
>  delete mode 100644 utils/v4l2-ctl/Makefile.am
>  create mode 100644 utils/v4l2-ctl/meson.build
>  delete mode 100644 utils/v4l2-dbg/.gitignore
>  delete mode 100644 utils/v4l2-dbg/Makefile.am
>  create mode 100644 utils/v4l2-dbg/meson.build
>  delete mode 100644 utils/v4l2-sysfs-path/.gitignore
>  delete mode 100644 utils/v4l2-sysfs-path/Makefile.am
>  create mode 100644 utils/v4l2-sysfs-path/meson.build
>  delete mode 100644 utils/v4l2-tracer/.gitignore
>  delete mode 100644 utils/v4l2-tracer/Makefile.am
>  create mode 120000 utils/v4l2-tracer/media-info.cpp
>  create mode 100644 utils/v4l2-tracer/meson.build
>  create mode 120000 utils/v4l2-tracer/v4l2-info.cpp
>  delete mode 100644 v4l-utils-po/Makevars
>  create mode 100644 v4l-utils-po/meson.build
> 
> 
> base-commit: 310b43a6452b31db2eaff863f057523eadbfcc14
> prerequisite-patch-id: 3536110786ee89506c05ec8d88fafb597b698d6b
> prerequisite-patch-id: faa8ba32b217309c605d66a0e685263043ae687d
> prerequisite-patch-id: a3c446b1d2375e7f7dc342083ad135bc5c47e9e8
> -- 
> Regards,
> 
> Laurent Pinchart
>
Tomi Valkeinen Feb. 20, 2023, 11:13 a.m. UTC | #2
Hi,

On 12/02/2023 02:51, Laurent Pinchart wrote:
> Hello everybody,
> 
> This series is the latest (and greatest) attempt to switch v4l-utils
> from autotools to meson.
> 
> Compared to v7, the series has been rebased on top of the latest master
> branch, and lots of fixes have been added. All review comments should
> have been addressed. Detailed changelogs are included in individual
> patches, in particular in patch 3/6.
> 
> The rebase was a bit painful due to the new v4l2-tracer tool and its
> code generation script. While meson handles code generation fine, it
> required fixes to the script to be able to specify the output directory
> and to generate the trace and retrace sources separately. Many thanks to
> Sakari for his help with this, which I've included in this series as
> patch 1/6.
> 
> Gregor, I haven't included the Tested-by tag you gave on v7 as v8
> contains many small changes. Sorry about that.
> 
> The patches are based on 3 pending patches for v4l-utils that have been
> posted to the list in the last couple of days:
> 
> - libv4lconvert: Don't ignore return value of ftruncate()
> - keytable: Add -fno-stack-protector compilation option
> - configure.ac: Add option to disable compilation of v4l2-tracer
> 
> None are strictly required, but I've included the equivalent of the
> second and third patches in the meson support, so I wanted to base the
> patches on top of the autotools' equivalent. I expect those three
> patches to be merged soon.
> 
> As far as I can tell, meson support is now ready. I can address review
> comments in a v9 if there are any, but I'd like to merge it soon to
> avoid another painful rebase. I'll be available to fix issues on top if
> any problem is encountered later.
> 
> A tag that includes this series can be found at
> 
>          git://linuxtv.org/pinchartl/v4l-utils.git tags/meson-v8

If I build this for x86 or arm64 with default options, it builds fine. If I build for arm32 (against my buildroot rootfs), the build fails:

[197/254] Compiling C object contrib/test/v4l2gl.p/v4l2gl.c.o
FAILED: contrib/test/v4l2gl.p/v4l2gl.c.o
ccache /home/tomba/work/buildroot/output32/host/bin/arm-buildroot-linux-gnueabihf-gcc -Icontrib/test/v4l2gl.p -Icontrib/test -I../contrib/test -I../lib/include -I../include -I/home/tomba/work/buildroot/output32/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include -I/home/tomba/work/buildroot/output32/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/libdrm -I/home/tomba/work/buildroot/output32/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/valgrind -I. -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=gnu99 -O2 -g -Wpointer-arith -D_GNU_SOURCE -DPROMOTED_MODE_T=int -DENABLE_NLS -MD -MQ contrib/test/v4l2gl.p/v4l2gl.c.o -MF contrib/test/v4l2gl.p/v4l2gl.c.o.d -o contrib/test/v4l2gl.p/v4l2gl.c.o -c ../contrib/test/v4l2gl.c
../contrib/test/v4l2gl.c:268:60: error: expected ‘,’ or ‘;’ before ‘V4L_UTILS_VERSION’
   268 | const char *argp_program_version = "V4L2 grabber version " V4L_UTILS_VERSION;
       |                                                            ^~~~~~~~~~~~~~~~~

I also see some warnings, which are possibly not related to this seris, like:

[207/254] Compiling C++ object utils/cec-ctl/cec-ctl.p/cec-ctl.cpp.o
In file included from /home/tomba/work/buildroot/output32/host/arm-buildroot-linux-gnueabihf/include/c++/11.3.0/vector:72,
                  from ../utils/cec-ctl/cec-ctl.cpp:13:
/home/tomba/work/buildroot/output32/host/arm-buildroot-linux-gnueabihf/include/c++/11.3.0/bits/vector.tcc: In member function ‘void std::vector<_Tp, _Alloc>::_M_realloc_insert(std::vector<_Tp, _Alloc>::iterator, _Args&& ...) [with _Args = {const cec_msg&}; _Tp = cec_msg; _Alloc = std::allocator<cec_msg>]’:
/home/tomba/work/buildroot/output32/host/arm-buildroot-linux-gnueabihf/include/c++/11.3.0/bits/vector.tcc:426:7: note: parameter passing for argument of type ‘std::vector<cec_msg>::iterator’ changed in GCC 7.1
   426 |       vector<_Tp, _Alloc>::
       |       ^~~~~~~~~~~~~~~~~~~
In file included from /home/tomba/work/buildroot/output32/host/arm-buildroot-linux-gnueabihf/include/c++/11.3.0/vector:67,
                  from ../utils/cec-ctl/cec-ctl.cpp:13:
/home/tomba/work/buildroot/output32/host/arm-buildroot-linux-gnueabihf/include/c++/11.3.0/bits/stl_vector.h: In member function ‘void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = cec_msg; _Alloc = std::allocator<cec_msg>]’:
/home/tomba/work/buildroot/output32/host/arm-buildroot-linux-gnueabihf/include/c++/11.3.0/bits/stl_vector.h:1198:28: note: parameter passing for argument of type ‘__gnu_cxx::__normal_iterator<cec_msg*, std::vector<cec_msg> >’ changed in GCC 7.1
  1198 |           _M_realloc_insert(end(), __x);
       |           ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~

  Tomi
Laurent Pinchart Feb. 20, 2023, 8:59 p.m. UTC | #3
Hi Tomi,

On Mon, Feb 20, 2023 at 01:13:09PM +0200, Tomi Valkeinen wrote:
> On 12/02/2023 02:51, Laurent Pinchart wrote:
> > Hello everybody,
> > 
> > This series is the latest (and greatest) attempt to switch v4l-utils
> > from autotools to meson.
> > 
> > Compared to v7, the series has been rebased on top of the latest master
> > branch, and lots of fixes have been added. All review comments should
> > have been addressed. Detailed changelogs are included in individual
> > patches, in particular in patch 3/6.
> > 
> > The rebase was a bit painful due to the new v4l2-tracer tool and its
> > code generation script. While meson handles code generation fine, it
> > required fixes to the script to be able to specify the output directory
> > and to generate the trace and retrace sources separately. Many thanks to
> > Sakari for his help with this, which I've included in this series as
> > patch 1/6.
> > 
> > Gregor, I haven't included the Tested-by tag you gave on v7 as v8
> > contains many small changes. Sorry about that.
> > 
> > The patches are based on 3 pending patches for v4l-utils that have been
> > posted to the list in the last couple of days:
> > 
> > - libv4lconvert: Don't ignore return value of ftruncate()
> > - keytable: Add -fno-stack-protector compilation option
> > - configure.ac: Add option to disable compilation of v4l2-tracer
> > 
> > None are strictly required, but I've included the equivalent of the
> > second and third patches in the meson support, so I wanted to base the
> > patches on top of the autotools' equivalent. I expect those three
> > patches to be merged soon.
> > 
> > As far as I can tell, meson support is now ready. I can address review
> > comments in a v9 if there are any, but I'd like to merge it soon to
> > avoid another painful rebase. I'll be available to fix issues on top if
> > any problem is encountered later.
> > 
> > A tag that includes this series can be found at
> > 
> >          git://linuxtv.org/pinchartl/v4l-utils.git tags/meson-v8
> 
> If I build this for x86 or arm64 with default options, it builds fine. If I build for arm32 (against my buildroot rootfs), the build fails:
> 
> [197/254] Compiling C object contrib/test/v4l2gl.p/v4l2gl.c.o
> FAILED: contrib/test/v4l2gl.p/v4l2gl.c.o
> ccache /home/tomba/work/buildroot/output32/host/bin/arm-buildroot-linux-gnueabihf-gcc -Icontrib/test/v4l2gl.p -Icontrib/test -I../contrib/test -I../lib/include -I../include -I/home/tomba/work/buildroot/output32/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include -I/home/tomba/work/buildroot/output32/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/libdrm -I/home/tomba/work/buildroot/output32/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/valgrind -I. -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=gnu99 -O2 -g -Wpointer-arith -D_GNU_SOURCE -DPROMOTED_MODE_T=int -DENABLE_NLS -MD -MQ contrib/test/v4l2gl.p/v4l2gl.c.o -MF contrib/test/v4l2gl.p/v4l2gl.c.o.d -o contrib/test/v4l2gl.p/v4l2gl.c.o -c ../contrib/test/v4l2gl.c
> ../contrib/test/v4l2gl.c:268:60: error: expected ‘,’ or ‘;’ before ‘V4L_UTILS_VERSION’
>    268 | const char *argp_program_version = "V4L2 grabber version " V4L_UTILS_VERSION;
>        |                                                            ^~~~~~~~~~~~~~~~~

Thank you for the report. I've test-compiled for arm32, but my build
environment may not have the features needed by v4l2gl.c, so it may have
been skipped. Would you be able to check what goes wrong ? v4l2gl.c
includes config.h, so V4L_UTILS_VERSION should be defined. Does your
config.h (generated in the build directory) define V4L_UTILS_VERSION ?
Does your buildroot environment provide a config.h that is being picked
instead ?

> I also see some warnings, which are possibly not related to this seris, like:

That's not related as far as I can tell.

> [207/254] Compiling C++ object utils/cec-ctl/cec-ctl.p/cec-ctl.cpp.o
> In file included from /home/tomba/work/buildroot/output32/host/arm-buildroot-linux-gnueabihf/include/c++/11.3.0/vector:72,
>                   from ../utils/cec-ctl/cec-ctl.cpp:13:
> /home/tomba/work/buildroot/output32/host/arm-buildroot-linux-gnueabihf/include/c++/11.3.0/bits/vector.tcc: In member function ‘void std::vector<_Tp, _Alloc>::_M_realloc_insert(std::vector<_Tp, _Alloc>::iterator, _Args&& ...) [with _Args = {const cec_msg&}; _Tp = cec_msg; _Alloc = std::allocator<cec_msg>]’:
> /home/tomba/work/buildroot/output32/host/arm-buildroot-linux-gnueabihf/include/c++/11.3.0/bits/vector.tcc:426:7: note: parameter passing for argument of type ‘std::vector<cec_msg>::iterator’ changed in GCC 7.1
>    426 |       vector<_Tp, _Alloc>::
>        |       ^~~~~~~~~~~~~~~~~~~
> In file included from /home/tomba/work/buildroot/output32/host/arm-buildroot-linux-gnueabihf/include/c++/11.3.0/vector:67,
>                   from ../utils/cec-ctl/cec-ctl.cpp:13:
> /home/tomba/work/buildroot/output32/host/arm-buildroot-linux-gnueabihf/include/c++/11.3.0/bits/stl_vector.h: In member function ‘void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = cec_msg; _Alloc = std::allocator<cec_msg>]’:
> /home/tomba/work/buildroot/output32/host/arm-buildroot-linux-gnueabihf/include/c++/11.3.0/bits/stl_vector.h:1198:28: note: parameter passing for argument of type ‘__gnu_cxx::__normal_iterator<cec_msg*, std::vector<cec_msg> >’ changed in GCC 7.1
>   1198 |           _M_realloc_insert(end(), __x);
>        |           ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
>
Tomi Valkeinen Feb. 21, 2023, 8:08 a.m. UTC | #4
On 20/02/2023 22:59, Laurent Pinchart wrote:
> Hi Tomi,
> 
> On Mon, Feb 20, 2023 at 01:13:09PM +0200, Tomi Valkeinen wrote:
>> On 12/02/2023 02:51, Laurent Pinchart wrote:
>>> Hello everybody,
>>>
>>> This series is the latest (and greatest) attempt to switch v4l-utils
>>> from autotools to meson.
>>>
>>> Compared to v7, the series has been rebased on top of the latest master
>>> branch, and lots of fixes have been added. All review comments should
>>> have been addressed. Detailed changelogs are included in individual
>>> patches, in particular in patch 3/6.
>>>
>>> The rebase was a bit painful due to the new v4l2-tracer tool and its
>>> code generation script. While meson handles code generation fine, it
>>> required fixes to the script to be able to specify the output directory
>>> and to generate the trace and retrace sources separately. Many thanks to
>>> Sakari for his help with this, which I've included in this series as
>>> patch 1/6.
>>>
>>> Gregor, I haven't included the Tested-by tag you gave on v7 as v8
>>> contains many small changes. Sorry about that.
>>>
>>> The patches are based on 3 pending patches for v4l-utils that have been
>>> posted to the list in the last couple of days:
>>>
>>> - libv4lconvert: Don't ignore return value of ftruncate()
>>> - keytable: Add -fno-stack-protector compilation option
>>> - configure.ac: Add option to disable compilation of v4l2-tracer
>>>
>>> None are strictly required, but I've included the equivalent of the
>>> second and third patches in the meson support, so I wanted to base the
>>> patches on top of the autotools' equivalent. I expect those three
>>> patches to be merged soon.
>>>
>>> As far as I can tell, meson support is now ready. I can address review
>>> comments in a v9 if there are any, but I'd like to merge it soon to
>>> avoid another painful rebase. I'll be available to fix issues on top if
>>> any problem is encountered later.
>>>
>>> A tag that includes this series can be found at
>>>
>>>           git://linuxtv.org/pinchartl/v4l-utils.git tags/meson-v8
>>
>> If I build this for x86 or arm64 with default options, it builds fine. If I build for arm32 (against my buildroot rootfs), the build fails:
>>
>> [197/254] Compiling C object contrib/test/v4l2gl.p/v4l2gl.c.o
>> FAILED: contrib/test/v4l2gl.p/v4l2gl.c.o
>> ccache /home/tomba/work/buildroot/output32/host/bin/arm-buildroot-linux-gnueabihf-gcc -Icontrib/test/v4l2gl.p -Icontrib/test -I../contrib/test -I../lib/include -I../include -I/home/tomba/work/buildroot/output32/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include -I/home/tomba/work/buildroot/output32/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/libdrm -I/home/tomba/work/buildroot/output32/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/valgrind -I. -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=gnu99 -O2 -g -Wpointer-arith -D_GNU_SOURCE -DPROMOTED_MODE_T=int -DENABLE_NLS -MD -MQ contrib/test/v4l2gl.p/v4l2gl.c.o -MF contrib/test/v4l2gl.p/v4l2gl.c.o.d -o contrib/test/v4l2gl.p/v4l2gl.c.o -c ../contrib/test/v4l2gl.c
>> ../contrib/test/v4l2gl.c:268:60: error: expected ‘,’ or ‘;’ before ‘V4L_UTILS_VERSION’
>>     268 | const char *argp_program_version = "V4L2 grabber version " V4L_UTILS_VERSION;
>>         |                                                            ^~~~~~~~~~~~~~~~~
> 
> Thank you for the report. I've test-compiled for arm32, but my build
> environment may not have the features needed by v4l2gl.c, so it may have
> been skipped. Would you be able to check what goes wrong ? v4l2gl.c
> includes config.h, so V4L_UTILS_VERSION should be defined. Does your
> config.h (generated in the build directory) define V4L_UTILS_VERSION ?
> Does your buildroot environment provide a config.h that is being picked
> instead ?

Yes, valgrind's directory has config.h (not sure why valgrind headers 
are needed for v4l2gl). I think the problem is that the build dir (-I.) 
is very late in the command line, in fact it seems to be the last 
include dir listed.

Isn't config.h and the like more commonly included via "-include"?

  Tomi
Tomi Valkeinen Feb. 21, 2023, 9:55 a.m. UTC | #5
On 20/02/2023 22:59, Laurent Pinchart wrote:
> Hi Tomi,
> 
> On Mon, Feb 20, 2023 at 01:13:09PM +0200, Tomi Valkeinen wrote:
>> On 12/02/2023 02:51, Laurent Pinchart wrote:
>>> Hello everybody,
>>>
>>> This series is the latest (and greatest) attempt to switch v4l-utils
>>> from autotools to meson.
>>>
>>> Compared to v7, the series has been rebased on top of the latest master
>>> branch, and lots of fixes have been added. All review comments should
>>> have been addressed. Detailed changelogs are included in individual
>>> patches, in particular in patch 3/6.
>>>
>>> The rebase was a bit painful due to the new v4l2-tracer tool and its
>>> code generation script. While meson handles code generation fine, it
>>> required fixes to the script to be able to specify the output directory
>>> and to generate the trace and retrace sources separately. Many thanks to
>>> Sakari for his help with this, which I've included in this series as
>>> patch 1/6.
>>>
>>> Gregor, I haven't included the Tested-by tag you gave on v7 as v8
>>> contains many small changes. Sorry about that.
>>>
>>> The patches are based on 3 pending patches for v4l-utils that have been
>>> posted to the list in the last couple of days:
>>>
>>> - libv4lconvert: Don't ignore return value of ftruncate()
>>> - keytable: Add -fno-stack-protector compilation option
>>> - configure.ac: Add option to disable compilation of v4l2-tracer
>>>
>>> None are strictly required, but I've included the equivalent of the
>>> second and third patches in the meson support, so I wanted to base the
>>> patches on top of the autotools' equivalent. I expect those three
>>> patches to be merged soon.
>>>
>>> As far as I can tell, meson support is now ready. I can address review
>>> comments in a v9 if there are any, but I'd like to merge it soon to
>>> avoid another painful rebase. I'll be available to fix issues on top if
>>> any problem is encountered later.
>>>
>>> A tag that includes this series can be found at
>>>
>>>           git://linuxtv.org/pinchartl/v4l-utils.git tags/meson-v8
>>
>> If I build this for x86 or arm64 with default options, it builds fine. If I build for arm32 (against my buildroot rootfs), the build fails:
>>
>> [197/254] Compiling C object contrib/test/v4l2gl.p/v4l2gl.c.o
>> FAILED: contrib/test/v4l2gl.p/v4l2gl.c.o
>> ccache /home/tomba/work/buildroot/output32/host/bin/arm-buildroot-linux-gnueabihf-gcc -Icontrib/test/v4l2gl.p -Icontrib/test -I../contrib/test -I../lib/include -I../include -I/home/tomba/work/buildroot/output32/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include -I/home/tomba/work/buildroot/output32/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/libdrm -I/home/tomba/work/buildroot/output32/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/valgrind -I. -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=gnu99 -O2 -g -Wpointer-arith -D_GNU_SOURCE -DPROMOTED_MODE_T=int -DENABLE_NLS -MD -MQ contrib/test/v4l2gl.p/v4l2gl.c.o -MF contrib/test/v4l2gl.p/v4l2gl.c.o.d -o contrib/test/v4l2gl.p/v4l2gl.c.o -c ../contrib/test/v4l2gl.c
>> ../contrib/test/v4l2gl.c:268:60: error: expected ‘,’ or ‘;’ before ‘V4L_UTILS_VERSION’
>>     268 | const char *argp_program_version = "V4L2 grabber version " V4L_UTILS_VERSION;
>>         |                                                            ^~~~~~~~~~~~~~~~~
> 
> Thank you for the report. I've test-compiled for arm32, but my build
> environment may not have the features needed by v4l2gl.c, so it may have
> been skipped. Would you be able to check what goes wrong ? v4l2gl.c
> includes config.h, so V4L_UTILS_VERSION should be defined. Does your
> config.h (generated in the build directory) define V4L_UTILS_VERSION ?
> Does your buildroot environment provide a config.h that is being picked
> instead ?

Here's my attempt fixing this. Works for me for x86, arm32 and arm64 builds:

 From 1c6df0f68e46ad56e527d4696d3c40a173b9f505 Mon Sep 17 00:00:00 2001
From: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Date: Tue, 21 Feb 2023 11:43:11 +0200
Subject: [PATCH] meson: use -include to include config.h instead of -I.

Use -include to get config.h included, instead of -I. and having the
source files include the config.h. The issue with the latter is that -I.
is rather late in the command line, and there may be config.h lurking in
some other project include dir (e.g. valgrind's).

Note that this doesn't handle including the android-config.h (I think
the meson build files break that anyway, as they don't have the project
root in include path). I believe this would be best handled by somehow
detecting android in the main meson.build file, and adding
android-config.h with -include instead of the config.h

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
---
  contrib/test/mc_nextgen_test.c          | 2 --
  contrib/test/pixfmt-test.c              | 2 --
  contrib/test/v4l2gl.c                   | 1 -
  contrib/test/v4l2grab.c                 | 1 -
  lib/libdvbv5/countries.c                | 1 -
  lib/libdvbv5/dvb-dev-local.c            | 2 --
  lib/libdvbv5/dvb-dev-remote.c           | 3 ---
  lib/libdvbv5/dvb-dev.c                  | 2 --
  lib/libdvbv5/dvb-fe.c                   | 2 --
  lib/libdvbv5/dvb-file.c                 | 2 --
  lib/libdvbv5/dvb-log.c                  | 2 --
  lib/libdvbv5/dvb-sat.c                  | 2 --
  lib/libdvbv5/dvb-scan.c                 | 2 --
  lib/libdvbv5/dvb-vdr-format.c           | 2 --
  lib/libdvbv5/parse_string.c             | 1 -
  lib/libv4l-mplane/libv4l-mplane.c       | 1 -
  lib/libv4l1/libv4l1.c                   | 1 -
  lib/libv4l1/v4l1compat.c                | 1 -
  lib/libv4l2/libv4l2.c                   | 5 -----
  lib/libv4l2/log.c                       | 5 -----
  lib/libv4l2/v4l2-plugin-android.c       | 5 -----
  lib/libv4l2/v4l2-plugin.c               | 1 -
  lib/libv4l2/v4l2convert.c               | 5 -----
  lib/libv4l2rds/libv4l2rds.c             | 1 -
  lib/libv4lconvert/jl2005bcd.c           | 5 -----
  lib/libv4lconvert/jpeg.c                | 5 -----
  lib/libv4lconvert/jpeg_memsrcdest.c     | 5 -----
  lib/libv4lconvert/libv4lconvert-priv.h  | 5 -----
  lib/libv4lconvert/libv4lconvert.c       | 5 -----
  meson.build                             | 2 +-
  utils/cec-compliance/cec-compliance.h   | 6 ------
  utils/cec-ctl/cec-ctl.cpp               | 6 ------
  utils/cec-ctl/cec-pin.cpp               | 6 ------
  utils/cec-follower/cec-follower.h       | 6 ------
  utils/cx18-ctl/cx18-ctl.c               | 1 -
  utils/dvb/dvb-fe-tool.c                 | 1 -
  utils/dvb/dvb-format-convert.c          | 2 --
  utils/dvb/dvbv5-daemon.c                | 3 ---
  utils/dvb/dvbv5-scan.c                  | 2 --
  utils/dvb/dvbv5-zap.c                   | 2 --
  utils/ir-ctl/ir-ctl.c                   | 2 --
  utils/keytable/keytable.c               | 1 -
  utils/media-ctl/libmediactl.c           | 2 --
  utils/media-ctl/options.h               | 2 --
  utils/qv4l2/alsa_stream.c               | 2 --
  utils/qv4l2/capture-win-gl.h            | 2 --
  utils/qv4l2/general-tab.h               | 2 --
  utils/qv4l2/qv4l2.h                     | 2 --
  utils/qvidcap/qvidcap.h                 | 2 --
  utils/v4l2-compliance/v4l2-compliance.h | 6 ------
  utils/v4l2-ctl/v4l2-ctl.h               | 6 ------
  utils/v4l2-dbg/v4l2-dbg.cpp             | 6 ------
  utils/v4l2-sysfs-path/v4l2-sysfs-path.c | 1 -
  utils/v4l2-tracer/libv4l2tracer.cpp     | 1 -
  utils/v4l2-tracer/v4l2-tracer-common.h  | 1 -
  55 files changed, 1 insertion(+), 151 deletions(-)

diff --git a/contrib/test/mc_nextgen_test.c b/contrib/test/mc_nextgen_test.c
index 6086ceb4..11254a0a 100644
--- a/contrib/test/mc_nextgen_test.c
+++ b/contrib/test/mc_nextgen_test.c
@@ -19,8 +19,6 @@
   * Or, point your browser to http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
   * */
  
-#include <config.h>
-
  #include <linux/media.h>
  
  #include <argp.h>
diff --git a/contrib/test/pixfmt-test.c b/contrib/test/pixfmt-test.c
index 43a11c4e..1cae69aa 100644
--- a/contrib/test/pixfmt-test.c
+++ b/contrib/test/pixfmt-test.c
@@ -20,8 +20,6 @@
  
  #define _GNU_SOURCE 1
  
-#include <config.h>
-
  #include <stdio.h>
  #include <stdlib.h>
  #include <stdbool.h>
diff --git a/contrib/test/v4l2gl.c b/contrib/test/v4l2gl.c
index 4df3910e..dc665fcc 100644
--- a/contrib/test/v4l2gl.c
+++ b/contrib/test/v4l2gl.c
@@ -12,7 +12,6 @@
   */
  
  #include <argp.h>
-#include <config.h>
  #include <stdio.h>
  #include <stdlib.h>
  #include <string.h>
diff --git a/contrib/test/v4l2grab.c b/contrib/test/v4l2grab.c
index d8f2c97a..0983f918 100644
--- a/contrib/test/v4l2grab.c
+++ b/contrib/test/v4l2grab.c
@@ -12,7 +12,6 @@
   */
  
  #include <argp.h>
-#include <config.h>
  #include <errno.h>
  #include <fcntl.h>
  #include <linux/videodev2.h>
diff --git a/lib/libdvbv5/countries.c b/lib/libdvbv5/countries.c
index 609add0b..a6e5f415 100644
--- a/lib/libdvbv5/countries.c
+++ b/lib/libdvbv5/countries.c
@@ -15,7 +15,6 @@
   *
   */
  
-#include <config.h>
  #include "libdvbv5/countries.h"
  
  #include <ctype.h>
diff --git a/lib/libdvbv5/dvb-dev-local.c b/lib/libdvbv5/dvb-dev-local.c
index a5e3979f..ea511471 100644
--- a/lib/libdvbv5/dvb-dev-local.c
+++ b/lib/libdvbv5/dvb-dev-local.c
@@ -27,8 +27,6 @@
  #include <unistd.h>
  #include <string.h>
  
-#include <config.h>
-
  #ifdef HAVE_PTHREAD
  #  include <pthread.h>
  #endif
diff --git a/lib/libdvbv5/dvb-dev-remote.c b/lib/libdvbv5/dvb-dev-remote.c
index 536f0acf..de4d11e4 100644
--- a/lib/libdvbv5/dvb-dev-remote.c
+++ b/lib/libdvbv5/dvb-dev-remote.c
@@ -20,9 +20,6 @@
  #define _LARGEFILE_SOURCE 1
  #define _LARGEFILE64_SOURCE 1
  
-#include <config.h>
-
-
  #ifdef HAVE_BACKTRACE
  #include <execinfo.h>
  #endif
diff --git a/lib/libdvbv5/dvb-dev.c b/lib/libdvbv5/dvb-dev.c
index c379f402..4bf87fca 100644
--- a/lib/libdvbv5/dvb-dev.c
+++ b/lib/libdvbv5/dvb-dev.c
@@ -23,8 +23,6 @@
  #include <unistd.h>
  #include <string.h>
  
-#include <config.h>
-
  #include "dvb-fe-priv.h"
  #include "dvb-dev-priv.h"
  
diff --git a/lib/libdvbv5/dvb-fe.c b/lib/libdvbv5/dvb-fe.c
index beda5cd8..7848fcda 100644
--- a/lib/libdvbv5/dvb-fe.c
+++ b/lib/libdvbv5/dvb-fe.c
@@ -30,8 +30,6 @@
  #include <unistd.h>
  #include <stdarg.h>
  
-#include <config.h>
-
  #ifdef ENABLE_NLS
  # include "gettext.h"
  # include <libintl.h>
diff --git a/lib/libdvbv5/dvb-file.c b/lib/libdvbv5/dvb-file.c
index 4187de9d..51e86d41 100644
--- a/lib/libdvbv5/dvb-file.c
+++ b/lib/libdvbv5/dvb-file.c
@@ -50,8 +50,6 @@
  #include <libdvbv5/desc_hierarchy.h>
  #include <libdvbv5/countries.h>
  
-#include <config.h>
-
  #ifdef ENABLE_NLS
  # include "gettext.h"
  # include <libintl.h>
diff --git a/lib/libdvbv5/dvb-log.c b/lib/libdvbv5/dvb-log.c
index f92da5f8..5aa6906d 100644
--- a/lib/libdvbv5/dvb-log.c
+++ b/lib/libdvbv5/dvb-log.c
@@ -24,8 +24,6 @@
  #include <unistd.h>
  #include <stdarg.h>
  
-#include <config.h>
-
  #ifdef ENABLE_NLS
  # include "gettext.h"
  # include <libintl.h>
diff --git a/lib/libdvbv5/dvb-sat.c b/lib/libdvbv5/dvb-sat.c
index 71ded425..36a42344 100644
--- a/lib/libdvbv5/dvb-sat.c
+++ b/lib/libdvbv5/dvb-sat.c
@@ -25,8 +25,6 @@
  #include "dvb-fe-priv.h"
  #include <libdvbv5/dvb-v5-std.h>
  
-#include <config.h>
-
  #ifdef ENABLE_NLS
  # include "gettext.h"
  # include <libintl.h>
diff --git a/lib/libdvbv5/dvb-scan.c b/lib/libdvbv5/dvb-scan.c
index 5c8aca96..af4f1691 100644
--- a/lib/libdvbv5/dvb-scan.c
+++ b/lib/libdvbv5/dvb-scan.c
@@ -61,8 +61,6 @@
  #include <libdvbv5/desc_t2_delivery.h>
  #include <libdvbv5/desc_sat.h>
  
-#include <config.h>
-
  #ifdef ENABLE_NLS
  # include "gettext.h"
  # include <libintl.h>
diff --git a/lib/libdvbv5/dvb-vdr-format.c b/lib/libdvbv5/dvb-vdr-format.c
index d2365712..9c8728c6 100644
--- a/lib/libdvbv5/dvb-vdr-format.c
+++ b/lib/libdvbv5/dvb-vdr-format.c
@@ -23,8 +23,6 @@
  #include <libdvbv5/dvb-file.h>
  #include <libdvbv5/dvb-v5-std.h>
  
-#include <config.h>
-
  #ifdef ENABLE_NLS
  # include "gettext.h"
  # include <libintl.h>
diff --git a/lib/libdvbv5/parse_string.c b/lib/libdvbv5/parse_string.c
index d354f497..e673343c 100644
--- a/lib/libdvbv5/parse_string.c
+++ b/lib/libdvbv5/parse_string.c
@@ -21,7 +21,6 @@
   *   c.f. EN 300 468 annex A
   */
  
-#include <config.h>
  #include <iconv.h>
  #include <stdio.h>
  #include <stdlib.h>
diff --git a/lib/libv4l-mplane/libv4l-mplane.c b/lib/libv4l-mplane/libv4l-mplane.c
index 2f685a73..071e9bc7 100644
--- a/lib/libv4l-mplane/libv4l-mplane.c
+++ b/lib/libv4l-mplane/libv4l-mplane.c
@@ -16,7 +16,6 @@
   * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA  02110-1335  USA
   */
  
-#include <config.h>
  #include <errno.h>
  #include <stdint.h>
  #include <stdio.h>
diff --git a/lib/libv4l1/libv4l1.c b/lib/libv4l1/libv4l1.c
index b4efa995..ec903305 100644
--- a/lib/libv4l1/libv4l1.c
+++ b/lib/libv4l1/libv4l1.c
@@ -47,7 +47,6 @@
        in turn will call v4l1_open, so therefor v4l1_open (for example) may not
        use the regular open()!
  */
-#include <config.h>
  #include <errno.h>
  #include <stdarg.h>
  #include <stdio.h>
diff --git a/lib/libv4l1/v4l1compat.c b/lib/libv4l1/v4l1compat.c
index e5c9e562..705d7d4b 100644
--- a/lib/libv4l1/v4l1compat.c
+++ b/lib/libv4l1/v4l1compat.c
@@ -24,7 +24,6 @@
  #undef _FILE_OFFSET_BITS
  #define _LARGEFILE64_SOURCE 1
  
-#include <config.h>
  #include <stdlib.h>
  #include <stdarg.h>
  #include <fcntl.h>
diff --git a/lib/libv4l2/libv4l2.c b/lib/libv4l2/libv4l2.c
index 9ebf8c18..032a4f1c 100644
--- a/lib/libv4l2/libv4l2.c
+++ b/lib/libv4l2/libv4l2.c
@@ -55,11 +55,6 @@
     When modifications are made, one should be careful that this behavior is
     preserved.
   */
-#ifdef ANDROID
-#include <android-config.h>
-#else
-#include <config.h>
-#endif
  #include <errno.h>
  #include <stdarg.h>
  #include <stdio.h>
diff --git a/lib/libv4l2/log.c b/lib/libv4l2/log.c
index 9517b86f..0e0e70b3 100644
--- a/lib/libv4l2/log.c
+++ b/lib/libv4l2/log.c
@@ -18,11 +18,6 @@
  # Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA  02110-1335  USA
   */
  
-#ifdef ANDROID
-#include <android-config.h>
-#else
-#include <config.h>
-#endif
  #include <stdio.h>
  #include <stdlib.h>
  #include <string.h>
diff --git a/lib/libv4l2/v4l2-plugin-android.c b/lib/libv4l2/v4l2-plugin-android.c
index c4ebc658..1aee111c 100644
--- a/lib/libv4l2/v4l2-plugin-android.c
+++ b/lib/libv4l2/v4l2-plugin-android.c
@@ -16,11 +16,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
  
-#ifdef ANDROID
-#include <android-config.h>
-#else
-#include <config.h>
-#endif
  #include <stdarg.h>
  #include <dlfcn.h>
  #include <fcntl.h>
diff --git a/lib/libv4l2/v4l2-plugin.c b/lib/libv4l2/v4l2-plugin.c
index ff42eed4..e2356cb6 100644
--- a/lib/libv4l2/v4l2-plugin.c
+++ b/lib/libv4l2/v4l2-plugin.c
@@ -16,7 +16,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
  
-#include <config.h>
  #include <stdarg.h>
  #include <dlfcn.h>
  #include <fcntl.h>
diff --git a/lib/libv4l2/v4l2convert.c b/lib/libv4l2/v4l2convert.c
index 13ca4cfb..97bed9a9 100644
--- a/lib/libv4l2/v4l2convert.c
+++ b/lib/libv4l2/v4l2convert.c
@@ -28,11 +28,6 @@
  #undef _FILE_OFFSET_BITS
  #define _LARGEFILE64_SOURCE 1
  
-#ifdef ANDROID
-#include <android-config.h>
-#else
-#include <config.h>
-#endif
  #include <stdarg.h>
  #include <stdlib.h>
  #include <fcntl.h>
diff --git a/lib/libv4l2rds/libv4l2rds.c b/lib/libv4l2rds/libv4l2rds.c
index 2e67d060..4bc01721 100644
--- a/lib/libv4l2rds/libv4l2rds.c
+++ b/lib/libv4l2rds/libv4l2rds.c
@@ -10,7 +10,6 @@
  #include <stdlib.h>
  #include <string.h>
  #include <time.h>
-#include <config.h>
  #include <sys/types.h>
  #include <sys/mman.h>
  
diff --git a/lib/libv4lconvert/jl2005bcd.c b/lib/libv4lconvert/jl2005bcd.c
index ec7103d5..707c3205 100644
--- a/lib/libv4lconvert/jl2005bcd.c
+++ b/lib/libv4lconvert/jl2005bcd.c
@@ -23,11 +23,6 @@
   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   */
  
-#ifdef ANDROID
-#include <android-config.h>
-#else
-#include <config.h>
-#endif
  #include <stdlib.h>
  #include <string.h>
  
diff --git a/lib/libv4lconvert/jpeg.c b/lib/libv4lconvert/jpeg.c
index 15f8dec7..ebfc8149 100644
--- a/lib/libv4lconvert/jpeg.c
+++ b/lib/libv4lconvert/jpeg.c
@@ -16,11 +16,6 @@
  # Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA  02110-1335  USA
   */
  
-#ifdef ANDROID
-#include <android-config.h>
-#else
-#include <config.h>
-#endif
  #include <errno.h>
  #include <stdlib.h>
  #include "libv4lconvert-priv.h"
diff --git a/lib/libv4lconvert/jpeg_memsrcdest.c b/lib/libv4lconvert/jpeg_memsrcdest.c
index 0540470f..6c09efe9 100644
--- a/lib/libv4lconvert/jpeg_memsrcdest.c
+++ b/lib/libv4lconvert/jpeg_memsrcdest.c
@@ -16,11 +16,6 @@
  
  /* this is not a core library module, so it doesn't define JPEG_INTERNALS */
  
-#ifdef ANDROID
-#include <android-config.h>
-#else
-#include <config.h>
-#endif
  #include <stdlib.h>
  #include <stdio.h>
  
diff --git a/lib/libv4lconvert/libv4lconvert-priv.h b/lib/libv4lconvert/libv4lconvert-priv.h
index 0fd6a102..ff2f4a75 100644
--- a/lib/libv4lconvert/libv4lconvert-priv.h
+++ b/lib/libv4lconvert/libv4lconvert-priv.h
@@ -19,11 +19,6 @@
  #ifndef __LIBV4LCONVERT_PRIV_H
  #define __LIBV4LCONVERT_PRIV_H
  
-#ifdef ANDROID
-#include <android-config.h>
-#else
-#include <config.h>
-#endif
  #include <stdio.h>
  #include <stdint.h>
  #include <sys/types.h>
diff --git a/lib/libv4lconvert/libv4lconvert.c b/lib/libv4lconvert/libv4lconvert.c
index 201dcf45..80f39dc4 100644
--- a/lib/libv4lconvert/libv4lconvert.c
+++ b/lib/libv4lconvert/libv4lconvert.c
@@ -16,11 +16,6 @@
  # Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA  02110-1335  USA
   */
  
-#ifdef ANDROID
-#include <android-config.h>
-#else
-#include <config.h>
-#endif
  #include <errno.h>
  #include <string.h>
  #include <stdlib.h>
diff --git a/meson.build b/meson.build
index 8c933908..f8f1bb97 100644
--- a/meson.build
+++ b/meson.build
@@ -39,7 +39,7 @@ conf.set('PATCH', as_patch_version)
  common_arguments = [
      '-Wpointer-arith',
      '-D_GNU_SOURCE',
-    '-I.', # Needed for config.h
+    '-include', meson.current_build_dir() / 'config.h',
      '-DPROMOTED_MODE_T=int',
      '-DENABLE_NLS',
  ]
diff --git a/utils/cec-compliance/cec-compliance.h b/utils/cec-compliance/cec-compliance.h
index 34ed9a81..44f8643d 100644
--- a/utils/cec-compliance/cec-compliance.h
+++ b/utils/cec-compliance/cec-compliance.h
@@ -11,12 +11,6 @@
  #include <linux/cec-funcs.h>
  #include "cec-htng-funcs.h"
  
-#ifdef ANDROID
-#include <android-config.h>
-#else
-#include <config.h>
-#endif
-
  #include <cec-info.h>
  
  #include <vector>
diff --git a/utils/cec-ctl/cec-ctl.cpp b/utils/cec-ctl/cec-ctl.cpp
index 015d2763..11fb7e7e 100644
--- a/utils/cec-ctl/cec-ctl.cpp
+++ b/utils/cec-ctl/cec-ctl.cpp
@@ -25,12 +25,6 @@
  #include "cec-log.h"
  #include "cec-parse.h"
  
-#ifdef __ANDROID__
-#include <android-config.h>
-#else
-#include <config.h>
-#endif
-
  #include "cec-ctl.h"
  #include "compiler.h"
  
diff --git a/utils/cec-ctl/cec-pin.cpp b/utils/cec-ctl/cec-pin.cpp
index cf4b6d34..f3500555 100644
--- a/utils/cec-ctl/cec-pin.cpp
+++ b/utils/cec-ctl/cec-pin.cpp
@@ -8,12 +8,6 @@
  #include <linux/cec.h>
  #include "cec-htng.h"
  
-#ifdef __ANDROID__
-#include <android-config.h>
-#else
-#include <config.h>
-#endif
-
  #include "cec-ctl.h"
  #include "cec-log.h"
  
diff --git a/utils/cec-follower/cec-follower.h b/utils/cec-follower/cec-follower.h
index 54f4df52..dc0a5530 100644
--- a/utils/cec-follower/cec-follower.h
+++ b/utils/cec-follower/cec-follower.h
@@ -11,12 +11,6 @@
  #include <linux/cec-funcs.h>
  #include "cec-htng-funcs.h"
  
-#ifdef ANDROID
-#include <android-config.h>
-#else
-#include <config.h>
-#endif
-
  #include <cec-info.h>
  #include <cec-log.h>
  #include <set>
diff --git a/utils/cx18-ctl/cx18-ctl.c b/utils/cx18-ctl/cx18-ctl.c
index 16a2c82f..8586f72d 100644
--- a/utils/cx18-ctl/cx18-ctl.c
+++ b/utils/cx18-ctl/cx18-ctl.c
@@ -19,7 +19,6 @@
      Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA  02110-1335  USA
   */
  
-#include <config.h>
  #include <unistd.h>
  #include <stdlib.h>
  #include <stdio.h>
diff --git a/utils/dvb/dvb-fe-tool.c b/utils/dvb/dvb-fe-tool.c
index 92b90905..994fa4e8 100644
--- a/utils/dvb/dvb-fe-tool.c
+++ b/utils/dvb/dvb-fe-tool.c
@@ -20,7 +20,6 @@
  
  #include "libdvbv5/dvb-file.h"
  #include "libdvbv5/dvb-dev.h"
-#include <config.h>
  #include <argp.h>
  #include <signal.h>
  #include <stdlib.h>
diff --git a/utils/dvb/dvb-format-convert.c b/utils/dvb/dvb-format-convert.c
index d9019e50..e4bd95df 100644
--- a/utils/dvb/dvb-format-convert.c
+++ b/utils/dvb/dvb-format-convert.c
@@ -29,8 +29,6 @@
  #include <sys/time.h>
  #include <argp.h>
  
-#include <config.h>
-
  #ifdef ENABLE_NLS
  # define _(string) gettext(string)
  # include "gettext.h"
diff --git a/utils/dvb/dvbv5-daemon.c b/utils/dvb/dvbv5-daemon.c
index d9b70181..669b3321 100644
--- a/utils/dvb/dvbv5-daemon.c
+++ b/utils/dvb/dvbv5-daemon.c
@@ -24,14 +24,11 @@
  #define _LARGEFILE_SOURCE 1
  #define _LARGEFILE64_SOURCE 1
  
-#include <config.h>
-
  #ifdef HAVE_BACKTRACE
  #include <execinfo.h>
  #endif
  
  #include <argp.h>
-#include <config.h>
  #include <endian.h>
  #include <netinet/in.h>
  #include <poll.h>
diff --git a/utils/dvb/dvbv5-scan.c b/utils/dvb/dvbv5-scan.c
index 0a522433..9f47ead7 100644
--- a/utils/dvb/dvbv5-scan.c
+++ b/utils/dvb/dvbv5-scan.c
@@ -30,8 +30,6 @@
  #include <sys/time.h>
  #include <argp.h>
  
-#include <config.h>
-
  #ifdef ENABLE_NLS
  # define _(string) gettext(string)
  # include "gettext.h"
diff --git a/utils/dvb/dvbv5-zap.c b/utils/dvb/dvbv5-zap.c
index 1cd6989f..5f84e101 100644
--- a/utils/dvb/dvbv5-zap.c
+++ b/utils/dvb/dvbv5-zap.c
@@ -49,8 +49,6 @@
  #include <sys/time.h>
  #include <time.h>
  
-#include <config.h>
-
  #ifdef ENABLE_NLS
  # define _(string) gettext(string)
  # include "gettext.h"
diff --git a/utils/ir-ctl/ir-ctl.c b/utils/ir-ctl/ir-ctl.c
index 240a3752..3c389bd9 100644
--- a/utils/ir-ctl/ir-ctl.c
+++ b/utils/ir-ctl/ir-ctl.c
@@ -26,8 +26,6 @@
  #include <argp.h>
  #include <sysexits.h>
  
-#include <config.h>
-
  #include <linux/lirc.h>
  
  #include "ir-encode.h"
diff --git a/utils/keytable/keytable.c b/utils/keytable/keytable.c
index 6cd1244f..c47211fa 100644
--- a/utils/keytable/keytable.c
+++ b/utils/keytable/keytable.c
@@ -12,7 +12,6 @@
     GNU General Public License for more details.
   */
  
-#include <config.h>
  #include <ctype.h>
  #include <errno.h>
  #include <fcntl.h>
diff --git a/utils/media-ctl/libmediactl.c b/utils/media-ctl/libmediactl.c
index 1fd6525b..a18b063e 100644
--- a/utils/media-ctl/libmediactl.c
+++ b/utils/media-ctl/libmediactl.c
@@ -19,8 +19,6 @@
   * along with this program. If not, see <http://www.gnu.org/licenses/>.
   */
  
-#include "config.h"
-
  #include <sys/ioctl.h>
  #include <sys/stat.h>
  #include <sys/types.h>
diff --git a/utils/media-ctl/options.h b/utils/media-ctl/options.h
index b1751f56..7e0556fc 100644
--- a/utils/media-ctl/options.h
+++ b/utils/media-ctl/options.h
@@ -22,8 +22,6 @@
  #ifndef __OPTIONS_H
  #define __OPTIONS_H
  
-#include <config.h>
-
  struct media_options
  {
  	const char *devname;
diff --git a/utils/qv4l2/alsa_stream.c b/utils/qv4l2/alsa_stream.c
index 2dca283b..8f5246db 100644
--- a/utils/qv4l2/alsa_stream.c
+++ b/utils/qv4l2/alsa_stream.c
@@ -26,8 +26,6 @@
   *
   */
  
-#include <config.h>
-
  #ifdef HAVE_ALSA
  #include "alsa_stream.h"
  
diff --git a/utils/qv4l2/capture-win-gl.h b/utils/qv4l2/capture-win-gl.h
index 35235d7a..e27b2b3f 100644
--- a/utils/qv4l2/capture-win-gl.h
+++ b/utils/qv4l2/capture-win-gl.h
@@ -6,8 +6,6 @@
  #ifndef CAPTURE_WIN_GL_H
  #define CAPTURE_WIN_GL_H
  
-#include <config.h>
-
  #ifdef HAVE_QTGL
  #define GL_GLEXT_PROTOTYPES
  #define QT_NO_OPENGL_ES_2
diff --git a/utils/qv4l2/general-tab.h b/utils/qv4l2/general-tab.h
index 9b4b5bcd..f5ec73e5 100644
--- a/utils/qv4l2/general-tab.h
+++ b/utils/qv4l2/general-tab.h
@@ -21,8 +21,6 @@
  #ifndef GENERAL_TAB_H
  #define GENERAL_TAB_H
  
-#include <config.h>
-
  #include <QSpinBox>
  #include <QCheckBox>
  #include <QDoubleSpinBox>
diff --git a/utils/qv4l2/qv4l2.h b/utils/qv4l2/qv4l2.h
index aaba74d0..99d1f30b 100644
--- a/utils/qv4l2/qv4l2.h
+++ b/utils/qv4l2/qv4l2.h
@@ -20,8 +20,6 @@
  #ifndef QV4L2_H
  #define QV4L2_H
  
-#include <config.h>
-
  #include <QMainWindow>
  #include <QTabWidget>
  #include <QSignalMapper>
diff --git a/utils/qvidcap/qvidcap.h b/utils/qvidcap/qvidcap.h
index 7292d8e7..40b1b4e6 100644
--- a/utils/qvidcap/qvidcap.h
+++ b/utils/qvidcap/qvidcap.h
@@ -8,8 +8,6 @@
  #ifndef QVIDCAP_H
  #define QVIDCAP_H
  
-#include <config.h>
-
  // Must come before cv4l-helpers.h
  #include <libv4l2.h>
  
diff --git a/utils/v4l2-compliance/v4l2-compliance.h b/utils/v4l2-compliance/v4l2-compliance.h
index e574c06c..020e56a9 100644
--- a/utils/v4l2-compliance/v4l2-compliance.h
+++ b/utils/v4l2-compliance/v4l2-compliance.h
@@ -29,12 +29,6 @@
  #include <linux/v4l2-subdev.h>
  #include <linux/media.h>
  
-#ifdef ANDROID
-#include <android-config.h>
-#else
-#include <config.h>
-#endif
-
  #ifndef NO_LIBV4L2
  #include <libv4l2.h>
  #endif
diff --git a/utils/v4l2-ctl/v4l2-ctl.h b/utils/v4l2-ctl/v4l2-ctl.h
index 70a80ade..8f2726ea 100644
--- a/utils/v4l2-ctl/v4l2-ctl.h
+++ b/utils/v4l2-ctl/v4l2-ctl.h
@@ -1,12 +1,6 @@
  #ifndef _V4L2_CTL_H
  #define _V4L2_CTL_H
  
-#ifdef ANDROID
-#include <android-config.h>
-#else
-#include <config.h>
-#endif
-
  #include <linux/videodev2.h>
  #include <linux/v4l2-subdev.h>
  #include <v4l-getsubopt.h>
diff --git a/utils/v4l2-dbg/v4l2-dbg.cpp b/utils/v4l2-dbg/v4l2-dbg.cpp
index f6a9f433..bd08b4cf 100644
--- a/utils/v4l2-dbg/v4l2-dbg.cpp
+++ b/utils/v4l2-dbg/v4l2-dbg.cpp
@@ -27,12 +27,6 @@
  #include <sys/ioctl.h>
  #include <unistd.h>
  
-#ifdef ANDROID
-#include <android-config.h>
-#else
-#include <config.h>
-#endif
-
  #ifdef HAVE_SYS_KLOG_H
  #include <sys/klog.h>
  #endif
diff --git a/utils/v4l2-sysfs-path/v4l2-sysfs-path.c b/utils/v4l2-sysfs-path/v4l2-sysfs-path.c
index c440b24f..d1ad7edb 100644
--- a/utils/v4l2-sysfs-path/v4l2-sysfs-path.c
+++ b/utils/v4l2-sysfs-path/v4l2-sysfs-path.c
@@ -24,7 +24,6 @@
   *	Mauro Carvalho Chehab
   */
  
-#include <config.h>
  #include "../libmedia_dev/get_media_devices.h"
  #include <stdio.h>
  #include <argp.h>
diff --git a/utils/v4l2-tracer/libv4l2tracer.cpp b/utils/v4l2-tracer/libv4l2tracer.cpp
index 6b438628..c5b0e9c0 100644
--- a/utils/v4l2-tracer/libv4l2tracer.cpp
+++ b/utils/v4l2-tracer/libv4l2tracer.cpp
@@ -4,7 +4,6 @@
   */
  
  #include "trace.h"
-#include <config.h> /* For PROMOTED_MODE_T */
  #include <dlfcn.h>
  #include <stdarg.h>
  
diff --git a/utils/v4l2-tracer/v4l2-tracer-common.h b/utils/v4l2-tracer/v4l2-tracer-common.h
index 0bdb125d..10362acb 100644
--- a/utils/v4l2-tracer/v4l2-tracer-common.h
+++ b/utils/v4l2-tracer/v4l2-tracer-common.h
@@ -8,7 +8,6 @@
  
  #include "v4l2-info.h"
  #include "codec-fwht.h"
-#include "config.h"
  #include "media-info.h"
  #include <algorithm>
  #include <dirent.h>
Laurent Pinchart Feb. 21, 2023, 12:02 p.m. UTC | #6
Hi Tomi,

On Tue, Feb 21, 2023 at 11:55:42AM +0200, Tomi Valkeinen wrote:
> On 20/02/2023 22:59, Laurent Pinchart wrote:
> > On Mon, Feb 20, 2023 at 01:13:09PM +0200, Tomi Valkeinen wrote:
> >> On 12/02/2023 02:51, Laurent Pinchart wrote:
> >>> Hello everybody,
> >>>
> >>> This series is the latest (and greatest) attempt to switch v4l-utils
> >>> from autotools to meson.
> >>>
> >>> Compared to v7, the series has been rebased on top of the latest master
> >>> branch, and lots of fixes have been added. All review comments should
> >>> have been addressed. Detailed changelogs are included in individual
> >>> patches, in particular in patch 3/6.
> >>>
> >>> The rebase was a bit painful due to the new v4l2-tracer tool and its
> >>> code generation script. While meson handles code generation fine, it
> >>> required fixes to the script to be able to specify the output directory
> >>> and to generate the trace and retrace sources separately. Many thanks to
> >>> Sakari for his help with this, which I've included in this series as
> >>> patch 1/6.
> >>>
> >>> Gregor, I haven't included the Tested-by tag you gave on v7 as v8
> >>> contains many small changes. Sorry about that.
> >>>
> >>> The patches are based on 3 pending patches for v4l-utils that have been
> >>> posted to the list in the last couple of days:
> >>>
> >>> - libv4lconvert: Don't ignore return value of ftruncate()
> >>> - keytable: Add -fno-stack-protector compilation option
> >>> - configure.ac: Add option to disable compilation of v4l2-tracer
> >>>
> >>> None are strictly required, but I've included the equivalent of the
> >>> second and third patches in the meson support, so I wanted to base the
> >>> patches on top of the autotools' equivalent. I expect those three
> >>> patches to be merged soon.
> >>>
> >>> As far as I can tell, meson support is now ready. I can address review
> >>> comments in a v9 if there are any, but I'd like to merge it soon to
> >>> avoid another painful rebase. I'll be available to fix issues on top if
> >>> any problem is encountered later.
> >>>
> >>> A tag that includes this series can be found at
> >>>
> >>>           git://linuxtv.org/pinchartl/v4l-utils.git tags/meson-v8
> >>
> >> If I build this for x86 or arm64 with default options, it builds fine. If I build for arm32 (against my buildroot rootfs), the build fails:
> >>
> >> [197/254] Compiling C object contrib/test/v4l2gl.p/v4l2gl.c.o
> >> FAILED: contrib/test/v4l2gl.p/v4l2gl.c.o
> >> ccache /home/tomba/work/buildroot/output32/host/bin/arm-buildroot-linux-gnueabihf-gcc -Icontrib/test/v4l2gl.p -Icontrib/test -I../contrib/test -I../lib/include -I../include -I/home/tomba/work/buildroot/output32/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include -I/home/tomba/work/buildroot/output32/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/libdrm -I/home/tomba/work/buildroot/output32/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/valgrind -I. -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=gnu99 -O2 -g -Wpointer-arith -D_GNU_SOURCE -DPROMOTED_MODE_T=int -DENABLE_NLS -MD -MQ contrib/test/v4l2gl.p/v4l2gl.c.o -MF contrib/test/v4l2gl.p/v4l2gl.c.o.d -o contrib/test/v4l2gl.p/v4l2gl.c.o -c ../contrib/test/v4l2gl.c
> >> ../contrib/test/v4l2gl.c:268:60: error: expected ‘,’ or ‘;’ before ‘V4L_UTILS_VERSION’
> >>     268 | const char *argp_program_version = "V4L2 grabber version " V4L_UTILS_VERSION;
> >>         |                                                            ^~~~~~~~~~~~~~~~~
> > 
> > Thank you for the report. I've test-compiled for arm32, but my build
> > environment may not have the features needed by v4l2gl.c, so it may have
> > been skipped. Would you be able to check what goes wrong ? v4l2gl.c
> > includes config.h, so V4L_UTILS_VERSION should be defined. Does your
> > config.h (generated in the build directory) define V4L_UTILS_VERSION ?
> > Does your buildroot environment provide a config.h that is being picked
> > instead ?
> 
> Here's my attempt fixing this. Works for me for x86, arm32 and arm64 builds:
> 
>  From 1c6df0f68e46ad56e527d4696d3c40a173b9f505 Mon Sep 17 00:00:00 2001
> From: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
> Date: Tue, 21 Feb 2023 11:43:11 +0200
> Subject: [PATCH] meson: use -include to include config.h instead of -I.
> 
> Use -include to get config.h included, instead of -I. and having the
> source files include the config.h. The issue with the latter is that -I.
> is rather late in the command line, and there may be config.h lurking in
> some other project include dir (e.g. valgrind's).
> 
> Note that this doesn't handle including the android-config.h (I think
> the meson build files break that anyway, as they don't have the project
> root in include path). I believe this would be best handled by somehow
> detecting android in the main meson.build file, and adding
> android-config.h with -include instead of the config.h

This looks good. I'll try to rebase it though, to switch to -include
before adding meson support.

> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
> ---
>   contrib/test/mc_nextgen_test.c          | 2 --
>   contrib/test/pixfmt-test.c              | 2 --
>   contrib/test/v4l2gl.c                   | 1 -
>   contrib/test/v4l2grab.c                 | 1 -
>   lib/libdvbv5/countries.c                | 1 -
>   lib/libdvbv5/dvb-dev-local.c            | 2 --
>   lib/libdvbv5/dvb-dev-remote.c           | 3 ---
>   lib/libdvbv5/dvb-dev.c                  | 2 --
>   lib/libdvbv5/dvb-fe.c                   | 2 --
>   lib/libdvbv5/dvb-file.c                 | 2 --
>   lib/libdvbv5/dvb-log.c                  | 2 --
>   lib/libdvbv5/dvb-sat.c                  | 2 --
>   lib/libdvbv5/dvb-scan.c                 | 2 --
>   lib/libdvbv5/dvb-vdr-format.c           | 2 --
>   lib/libdvbv5/parse_string.c             | 1 -
>   lib/libv4l-mplane/libv4l-mplane.c       | 1 -
>   lib/libv4l1/libv4l1.c                   | 1 -
>   lib/libv4l1/v4l1compat.c                | 1 -
>   lib/libv4l2/libv4l2.c                   | 5 -----
>   lib/libv4l2/log.c                       | 5 -----
>   lib/libv4l2/v4l2-plugin-android.c       | 5 -----
>   lib/libv4l2/v4l2-plugin.c               | 1 -
>   lib/libv4l2/v4l2convert.c               | 5 -----
>   lib/libv4l2rds/libv4l2rds.c             | 1 -
>   lib/libv4lconvert/jl2005bcd.c           | 5 -----
>   lib/libv4lconvert/jpeg.c                | 5 -----
>   lib/libv4lconvert/jpeg_memsrcdest.c     | 5 -----
>   lib/libv4lconvert/libv4lconvert-priv.h  | 5 -----
>   lib/libv4lconvert/libv4lconvert.c       | 5 -----
>   meson.build                             | 2 +-
>   utils/cec-compliance/cec-compliance.h   | 6 ------
>   utils/cec-ctl/cec-ctl.cpp               | 6 ------
>   utils/cec-ctl/cec-pin.cpp               | 6 ------
>   utils/cec-follower/cec-follower.h       | 6 ------
>   utils/cx18-ctl/cx18-ctl.c               | 1 -
>   utils/dvb/dvb-fe-tool.c                 | 1 -
>   utils/dvb/dvb-format-convert.c          | 2 --
>   utils/dvb/dvbv5-daemon.c                | 3 ---
>   utils/dvb/dvbv5-scan.c                  | 2 --
>   utils/dvb/dvbv5-zap.c                   | 2 --
>   utils/ir-ctl/ir-ctl.c                   | 2 --
>   utils/keytable/keytable.c               | 1 -
>   utils/media-ctl/libmediactl.c           | 2 --
>   utils/media-ctl/options.h               | 2 --
>   utils/qv4l2/alsa_stream.c               | 2 --
>   utils/qv4l2/capture-win-gl.h            | 2 --
>   utils/qv4l2/general-tab.h               | 2 --
>   utils/qv4l2/qv4l2.h                     | 2 --
>   utils/qvidcap/qvidcap.h                 | 2 --
>   utils/v4l2-compliance/v4l2-compliance.h | 6 ------
>   utils/v4l2-ctl/v4l2-ctl.h               | 6 ------
>   utils/v4l2-dbg/v4l2-dbg.cpp             | 6 ------
>   utils/v4l2-sysfs-path/v4l2-sysfs-path.c | 1 -
>   utils/v4l2-tracer/libv4l2tracer.cpp     | 1 -
>   utils/v4l2-tracer/v4l2-tracer-common.h  | 1 -
>   55 files changed, 1 insertion(+), 151 deletions(-)
> 
> diff --git a/contrib/test/mc_nextgen_test.c b/contrib/test/mc_nextgen_test.c
> index 6086ceb4..11254a0a 100644
> --- a/contrib/test/mc_nextgen_test.c
> +++ b/contrib/test/mc_nextgen_test.c
> @@ -19,8 +19,6 @@
>    * Or, point your browser to http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
>    * */
>   
> -#include <config.h>
> -
>   #include <linux/media.h>
>   
>   #include <argp.h>
> diff --git a/contrib/test/pixfmt-test.c b/contrib/test/pixfmt-test.c
> index 43a11c4e..1cae69aa 100644
> --- a/contrib/test/pixfmt-test.c
> +++ b/contrib/test/pixfmt-test.c
> @@ -20,8 +20,6 @@
>   
>   #define _GNU_SOURCE 1
>   
> -#include <config.h>
> -
>   #include <stdio.h>
>   #include <stdlib.h>
>   #include <stdbool.h>
> diff --git a/contrib/test/v4l2gl.c b/contrib/test/v4l2gl.c
> index 4df3910e..dc665fcc 100644
> --- a/contrib/test/v4l2gl.c
> +++ b/contrib/test/v4l2gl.c
> @@ -12,7 +12,6 @@
>    */
>   
>   #include <argp.h>
> -#include <config.h>
>   #include <stdio.h>
>   #include <stdlib.h>
>   #include <string.h>
> diff --git a/contrib/test/v4l2grab.c b/contrib/test/v4l2grab.c
> index d8f2c97a..0983f918 100644
> --- a/contrib/test/v4l2grab.c
> +++ b/contrib/test/v4l2grab.c
> @@ -12,7 +12,6 @@
>    */
>   
>   #include <argp.h>
> -#include <config.h>
>   #include <errno.h>
>   #include <fcntl.h>
>   #include <linux/videodev2.h>
> diff --git a/lib/libdvbv5/countries.c b/lib/libdvbv5/countries.c
> index 609add0b..a6e5f415 100644
> --- a/lib/libdvbv5/countries.c
> +++ b/lib/libdvbv5/countries.c
> @@ -15,7 +15,6 @@
>    *
>    */
>   
> -#include <config.h>
>   #include "libdvbv5/countries.h"
>   
>   #include <ctype.h>
> diff --git a/lib/libdvbv5/dvb-dev-local.c b/lib/libdvbv5/dvb-dev-local.c
> index a5e3979f..ea511471 100644
> --- a/lib/libdvbv5/dvb-dev-local.c
> +++ b/lib/libdvbv5/dvb-dev-local.c
> @@ -27,8 +27,6 @@
>   #include <unistd.h>
>   #include <string.h>
>   
> -#include <config.h>
> -
>   #ifdef HAVE_PTHREAD
>   #  include <pthread.h>
>   #endif
> diff --git a/lib/libdvbv5/dvb-dev-remote.c b/lib/libdvbv5/dvb-dev-remote.c
> index 536f0acf..de4d11e4 100644
> --- a/lib/libdvbv5/dvb-dev-remote.c
> +++ b/lib/libdvbv5/dvb-dev-remote.c
> @@ -20,9 +20,6 @@
>   #define _LARGEFILE_SOURCE 1
>   #define _LARGEFILE64_SOURCE 1
>   
> -#include <config.h>
> -
> -
>   #ifdef HAVE_BACKTRACE
>   #include <execinfo.h>
>   #endif
> diff --git a/lib/libdvbv5/dvb-dev.c b/lib/libdvbv5/dvb-dev.c
> index c379f402..4bf87fca 100644
> --- a/lib/libdvbv5/dvb-dev.c
> +++ b/lib/libdvbv5/dvb-dev.c
> @@ -23,8 +23,6 @@
>   #include <unistd.h>
>   #include <string.h>
>   
> -#include <config.h>
> -
>   #include "dvb-fe-priv.h"
>   #include "dvb-dev-priv.h"
>   
> diff --git a/lib/libdvbv5/dvb-fe.c b/lib/libdvbv5/dvb-fe.c
> index beda5cd8..7848fcda 100644
> --- a/lib/libdvbv5/dvb-fe.c
> +++ b/lib/libdvbv5/dvb-fe.c
> @@ -30,8 +30,6 @@
>   #include <unistd.h>
>   #include <stdarg.h>
>   
> -#include <config.h>
> -
>   #ifdef ENABLE_NLS
>   # include "gettext.h"
>   # include <libintl.h>
> diff --git a/lib/libdvbv5/dvb-file.c b/lib/libdvbv5/dvb-file.c
> index 4187de9d..51e86d41 100644
> --- a/lib/libdvbv5/dvb-file.c
> +++ b/lib/libdvbv5/dvb-file.c
> @@ -50,8 +50,6 @@
>   #include <libdvbv5/desc_hierarchy.h>
>   #include <libdvbv5/countries.h>
>   
> -#include <config.h>
> -
>   #ifdef ENABLE_NLS
>   # include "gettext.h"
>   # include <libintl.h>
> diff --git a/lib/libdvbv5/dvb-log.c b/lib/libdvbv5/dvb-log.c
> index f92da5f8..5aa6906d 100644
> --- a/lib/libdvbv5/dvb-log.c
> +++ b/lib/libdvbv5/dvb-log.c
> @@ -24,8 +24,6 @@
>   #include <unistd.h>
>   #include <stdarg.h>
>   
> -#include <config.h>
> -
>   #ifdef ENABLE_NLS
>   # include "gettext.h"
>   # include <libintl.h>
> diff --git a/lib/libdvbv5/dvb-sat.c b/lib/libdvbv5/dvb-sat.c
> index 71ded425..36a42344 100644
> --- a/lib/libdvbv5/dvb-sat.c
> +++ b/lib/libdvbv5/dvb-sat.c
> @@ -25,8 +25,6 @@
>   #include "dvb-fe-priv.h"
>   #include <libdvbv5/dvb-v5-std.h>
>   
> -#include <config.h>
> -
>   #ifdef ENABLE_NLS
>   # include "gettext.h"
>   # include <libintl.h>
> diff --git a/lib/libdvbv5/dvb-scan.c b/lib/libdvbv5/dvb-scan.c
> index 5c8aca96..af4f1691 100644
> --- a/lib/libdvbv5/dvb-scan.c
> +++ b/lib/libdvbv5/dvb-scan.c
> @@ -61,8 +61,6 @@
>   #include <libdvbv5/desc_t2_delivery.h>
>   #include <libdvbv5/desc_sat.h>
>   
> -#include <config.h>
> -
>   #ifdef ENABLE_NLS
>   # include "gettext.h"
>   # include <libintl.h>
> diff --git a/lib/libdvbv5/dvb-vdr-format.c b/lib/libdvbv5/dvb-vdr-format.c
> index d2365712..9c8728c6 100644
> --- a/lib/libdvbv5/dvb-vdr-format.c
> +++ b/lib/libdvbv5/dvb-vdr-format.c
> @@ -23,8 +23,6 @@
>   #include <libdvbv5/dvb-file.h>
>   #include <libdvbv5/dvb-v5-std.h>
>   
> -#include <config.h>
> -
>   #ifdef ENABLE_NLS
>   # include "gettext.h"
>   # include <libintl.h>
> diff --git a/lib/libdvbv5/parse_string.c b/lib/libdvbv5/parse_string.c
> index d354f497..e673343c 100644
> --- a/lib/libdvbv5/parse_string.c
> +++ b/lib/libdvbv5/parse_string.c
> @@ -21,7 +21,6 @@
>    *   c.f. EN 300 468 annex A
>    */
>   
> -#include <config.h>
>   #include <iconv.h>
>   #include <stdio.h>
>   #include <stdlib.h>
> diff --git a/lib/libv4l-mplane/libv4l-mplane.c b/lib/libv4l-mplane/libv4l-mplane.c
> index 2f685a73..071e9bc7 100644
> --- a/lib/libv4l-mplane/libv4l-mplane.c
> +++ b/lib/libv4l-mplane/libv4l-mplane.c
> @@ -16,7 +16,6 @@
>    * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA  02110-1335  USA
>    */
>   
> -#include <config.h>
>   #include <errno.h>
>   #include <stdint.h>
>   #include <stdio.h>
> diff --git a/lib/libv4l1/libv4l1.c b/lib/libv4l1/libv4l1.c
> index b4efa995..ec903305 100644
> --- a/lib/libv4l1/libv4l1.c
> +++ b/lib/libv4l1/libv4l1.c
> @@ -47,7 +47,6 @@
>         in turn will call v4l1_open, so therefor v4l1_open (for example) may not
>         use the regular open()!
>   */
> -#include <config.h>
>   #include <errno.h>
>   #include <stdarg.h>
>   #include <stdio.h>
> diff --git a/lib/libv4l1/v4l1compat.c b/lib/libv4l1/v4l1compat.c
> index e5c9e562..705d7d4b 100644
> --- a/lib/libv4l1/v4l1compat.c
> +++ b/lib/libv4l1/v4l1compat.c
> @@ -24,7 +24,6 @@
>   #undef _FILE_OFFSET_BITS
>   #define _LARGEFILE64_SOURCE 1
>   
> -#include <config.h>
>   #include <stdlib.h>
>   #include <stdarg.h>
>   #include <fcntl.h>
> diff --git a/lib/libv4l2/libv4l2.c b/lib/libv4l2/libv4l2.c
> index 9ebf8c18..032a4f1c 100644
> --- a/lib/libv4l2/libv4l2.c
> +++ b/lib/libv4l2/libv4l2.c
> @@ -55,11 +55,6 @@
>      When modifications are made, one should be careful that this behavior is
>      preserved.
>    */
> -#ifdef ANDROID
> -#include <android-config.h>
> -#else
> -#include <config.h>
> -#endif
>   #include <errno.h>
>   #include <stdarg.h>
>   #include <stdio.h>
> diff --git a/lib/libv4l2/log.c b/lib/libv4l2/log.c
> index 9517b86f..0e0e70b3 100644
> --- a/lib/libv4l2/log.c
> +++ b/lib/libv4l2/log.c
> @@ -18,11 +18,6 @@
>   # Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA  02110-1335  USA
>    */
>   
> -#ifdef ANDROID
> -#include <android-config.h>
> -#else
> -#include <config.h>
> -#endif
>   #include <stdio.h>
>   #include <stdlib.h>
>   #include <string.h>
> diff --git a/lib/libv4l2/v4l2-plugin-android.c b/lib/libv4l2/v4l2-plugin-android.c
> index c4ebc658..1aee111c 100644
> --- a/lib/libv4l2/v4l2-plugin-android.c
> +++ b/lib/libv4l2/v4l2-plugin-android.c
> @@ -16,11 +16,6 @@
>   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
>   */
>   
> -#ifdef ANDROID
> -#include <android-config.h>
> -#else
> -#include <config.h>
> -#endif
>   #include <stdarg.h>
>   #include <dlfcn.h>
>   #include <fcntl.h>
> diff --git a/lib/libv4l2/v4l2-plugin.c b/lib/libv4l2/v4l2-plugin.c
> index ff42eed4..e2356cb6 100644
> --- a/lib/libv4l2/v4l2-plugin.c
> +++ b/lib/libv4l2/v4l2-plugin.c
> @@ -16,7 +16,6 @@
>   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
>   */
>   
> -#include <config.h>
>   #include <stdarg.h>
>   #include <dlfcn.h>
>   #include <fcntl.h>
> diff --git a/lib/libv4l2/v4l2convert.c b/lib/libv4l2/v4l2convert.c
> index 13ca4cfb..97bed9a9 100644
> --- a/lib/libv4l2/v4l2convert.c
> +++ b/lib/libv4l2/v4l2convert.c
> @@ -28,11 +28,6 @@
>   #undef _FILE_OFFSET_BITS
>   #define _LARGEFILE64_SOURCE 1
>   
> -#ifdef ANDROID
> -#include <android-config.h>
> -#else
> -#include <config.h>
> -#endif
>   #include <stdarg.h>
>   #include <stdlib.h>
>   #include <fcntl.h>
> diff --git a/lib/libv4l2rds/libv4l2rds.c b/lib/libv4l2rds/libv4l2rds.c
> index 2e67d060..4bc01721 100644
> --- a/lib/libv4l2rds/libv4l2rds.c
> +++ b/lib/libv4l2rds/libv4l2rds.c
> @@ -10,7 +10,6 @@
>   #include <stdlib.h>
>   #include <string.h>
>   #include <time.h>
> -#include <config.h>
>   #include <sys/types.h>
>   #include <sys/mman.h>
>   
> diff --git a/lib/libv4lconvert/jl2005bcd.c b/lib/libv4lconvert/jl2005bcd.c
> index ec7103d5..707c3205 100644
> --- a/lib/libv4lconvert/jl2005bcd.c
> +++ b/lib/libv4lconvert/jl2005bcd.c
> @@ -23,11 +23,6 @@
>    * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
>    */
>   
> -#ifdef ANDROID
> -#include <android-config.h>
> -#else
> -#include <config.h>
> -#endif
>   #include <stdlib.h>
>   #include <string.h>
>   
> diff --git a/lib/libv4lconvert/jpeg.c b/lib/libv4lconvert/jpeg.c
> index 15f8dec7..ebfc8149 100644
> --- a/lib/libv4lconvert/jpeg.c
> +++ b/lib/libv4lconvert/jpeg.c
> @@ -16,11 +16,6 @@
>   # Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA  02110-1335  USA
>    */
>   
> -#ifdef ANDROID
> -#include <android-config.h>
> -#else
> -#include <config.h>
> -#endif
>   #include <errno.h>
>   #include <stdlib.h>
>   #include "libv4lconvert-priv.h"
> diff --git a/lib/libv4lconvert/jpeg_memsrcdest.c b/lib/libv4lconvert/jpeg_memsrcdest.c
> index 0540470f..6c09efe9 100644
> --- a/lib/libv4lconvert/jpeg_memsrcdest.c
> +++ b/lib/libv4lconvert/jpeg_memsrcdest.c
> @@ -16,11 +16,6 @@
>   
>   /* this is not a core library module, so it doesn't define JPEG_INTERNALS */
>   
> -#ifdef ANDROID
> -#include <android-config.h>
> -#else
> -#include <config.h>
> -#endif
>   #include <stdlib.h>
>   #include <stdio.h>
>   
> diff --git a/lib/libv4lconvert/libv4lconvert-priv.h b/lib/libv4lconvert/libv4lconvert-priv.h
> index 0fd6a102..ff2f4a75 100644
> --- a/lib/libv4lconvert/libv4lconvert-priv.h
> +++ b/lib/libv4lconvert/libv4lconvert-priv.h
> @@ -19,11 +19,6 @@
>   #ifndef __LIBV4LCONVERT_PRIV_H
>   #define __LIBV4LCONVERT_PRIV_H
>   
> -#ifdef ANDROID
> -#include <android-config.h>
> -#else
> -#include <config.h>
> -#endif
>   #include <stdio.h>
>   #include <stdint.h>
>   #include <sys/types.h>
> diff --git a/lib/libv4lconvert/libv4lconvert.c b/lib/libv4lconvert/libv4lconvert.c
> index 201dcf45..80f39dc4 100644
> --- a/lib/libv4lconvert/libv4lconvert.c
> +++ b/lib/libv4lconvert/libv4lconvert.c
> @@ -16,11 +16,6 @@
>   # Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA  02110-1335  USA
>    */
>   
> -#ifdef ANDROID
> -#include <android-config.h>
> -#else
> -#include <config.h>
> -#endif
>   #include <errno.h>
>   #include <string.h>
>   #include <stdlib.h>
> diff --git a/meson.build b/meson.build
> index 8c933908..f8f1bb97 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -39,7 +39,7 @@ conf.set('PATCH', as_patch_version)
>   common_arguments = [
>       '-Wpointer-arith',
>       '-D_GNU_SOURCE',
> -    '-I.', # Needed for config.h
> +    '-include', meson.current_build_dir() / 'config.h',
>       '-DPROMOTED_MODE_T=int',
>       '-DENABLE_NLS',
>   ]
> diff --git a/utils/cec-compliance/cec-compliance.h b/utils/cec-compliance/cec-compliance.h
> index 34ed9a81..44f8643d 100644
> --- a/utils/cec-compliance/cec-compliance.h
> +++ b/utils/cec-compliance/cec-compliance.h
> @@ -11,12 +11,6 @@
>   #include <linux/cec-funcs.h>
>   #include "cec-htng-funcs.h"
>   
> -#ifdef ANDROID
> -#include <android-config.h>
> -#else
> -#include <config.h>
> -#endif
> -
>   #include <cec-info.h>
>   
>   #include <vector>
> diff --git a/utils/cec-ctl/cec-ctl.cpp b/utils/cec-ctl/cec-ctl.cpp
> index 015d2763..11fb7e7e 100644
> --- a/utils/cec-ctl/cec-ctl.cpp
> +++ b/utils/cec-ctl/cec-ctl.cpp
> @@ -25,12 +25,6 @@
>   #include "cec-log.h"
>   #include "cec-parse.h"
>   
> -#ifdef __ANDROID__
> -#include <android-config.h>
> -#else
> -#include <config.h>
> -#endif
> -
>   #include "cec-ctl.h"
>   #include "compiler.h"
>   
> diff --git a/utils/cec-ctl/cec-pin.cpp b/utils/cec-ctl/cec-pin.cpp
> index cf4b6d34..f3500555 100644
> --- a/utils/cec-ctl/cec-pin.cpp
> +++ b/utils/cec-ctl/cec-pin.cpp
> @@ -8,12 +8,6 @@
>   #include <linux/cec.h>
>   #include "cec-htng.h"
>   
> -#ifdef __ANDROID__
> -#include <android-config.h>
> -#else
> -#include <config.h>
> -#endif
> -
>   #include "cec-ctl.h"
>   #include "cec-log.h"
>   
> diff --git a/utils/cec-follower/cec-follower.h b/utils/cec-follower/cec-follower.h
> index 54f4df52..dc0a5530 100644
> --- a/utils/cec-follower/cec-follower.h
> +++ b/utils/cec-follower/cec-follower.h
> @@ -11,12 +11,6 @@
>   #include <linux/cec-funcs.h>
>   #include "cec-htng-funcs.h"
>   
> -#ifdef ANDROID
> -#include <android-config.h>
> -#else
> -#include <config.h>
> -#endif
> -
>   #include <cec-info.h>
>   #include <cec-log.h>
>   #include <set>
> diff --git a/utils/cx18-ctl/cx18-ctl.c b/utils/cx18-ctl/cx18-ctl.c
> index 16a2c82f..8586f72d 100644
> --- a/utils/cx18-ctl/cx18-ctl.c
> +++ b/utils/cx18-ctl/cx18-ctl.c
> @@ -19,7 +19,6 @@
>       Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA  02110-1335  USA
>    */
>   
> -#include <config.h>
>   #include <unistd.h>
>   #include <stdlib.h>
>   #include <stdio.h>
> diff --git a/utils/dvb/dvb-fe-tool.c b/utils/dvb/dvb-fe-tool.c
> index 92b90905..994fa4e8 100644
> --- a/utils/dvb/dvb-fe-tool.c
> +++ b/utils/dvb/dvb-fe-tool.c
> @@ -20,7 +20,6 @@
>   
>   #include "libdvbv5/dvb-file.h"
>   #include "libdvbv5/dvb-dev.h"
> -#include <config.h>
>   #include <argp.h>
>   #include <signal.h>
>   #include <stdlib.h>
> diff --git a/utils/dvb/dvb-format-convert.c b/utils/dvb/dvb-format-convert.c
> index d9019e50..e4bd95df 100644
> --- a/utils/dvb/dvb-format-convert.c
> +++ b/utils/dvb/dvb-format-convert.c
> @@ -29,8 +29,6 @@
>   #include <sys/time.h>
>   #include <argp.h>
>   
> -#include <config.h>
> -
>   #ifdef ENABLE_NLS
>   # define _(string) gettext(string)
>   # include "gettext.h"
> diff --git a/utils/dvb/dvbv5-daemon.c b/utils/dvb/dvbv5-daemon.c
> index d9b70181..669b3321 100644
> --- a/utils/dvb/dvbv5-daemon.c
> +++ b/utils/dvb/dvbv5-daemon.c
> @@ -24,14 +24,11 @@
>   #define _LARGEFILE_SOURCE 1
>   #define _LARGEFILE64_SOURCE 1
>   
> -#include <config.h>
> -
>   #ifdef HAVE_BACKTRACE
>   #include <execinfo.h>
>   #endif
>   
>   #include <argp.h>
> -#include <config.h>
>   #include <endian.h>
>   #include <netinet/in.h>
>   #include <poll.h>
> diff --git a/utils/dvb/dvbv5-scan.c b/utils/dvb/dvbv5-scan.c
> index 0a522433..9f47ead7 100644
> --- a/utils/dvb/dvbv5-scan.c
> +++ b/utils/dvb/dvbv5-scan.c
> @@ -30,8 +30,6 @@
>   #include <sys/time.h>
>   #include <argp.h>
>   
> -#include <config.h>
> -
>   #ifdef ENABLE_NLS
>   # define _(string) gettext(string)
>   # include "gettext.h"
> diff --git a/utils/dvb/dvbv5-zap.c b/utils/dvb/dvbv5-zap.c
> index 1cd6989f..5f84e101 100644
> --- a/utils/dvb/dvbv5-zap.c
> +++ b/utils/dvb/dvbv5-zap.c
> @@ -49,8 +49,6 @@
>   #include <sys/time.h>
>   #include <time.h>
>   
> -#include <config.h>
> -
>   #ifdef ENABLE_NLS
>   # define _(string) gettext(string)
>   # include "gettext.h"
> diff --git a/utils/ir-ctl/ir-ctl.c b/utils/ir-ctl/ir-ctl.c
> index 240a3752..3c389bd9 100644
> --- a/utils/ir-ctl/ir-ctl.c
> +++ b/utils/ir-ctl/ir-ctl.c
> @@ -26,8 +26,6 @@
>   #include <argp.h>
>   #include <sysexits.h>
>   
> -#include <config.h>
> -
>   #include <linux/lirc.h>
>   
>   #include "ir-encode.h"
> diff --git a/utils/keytable/keytable.c b/utils/keytable/keytable.c
> index 6cd1244f..c47211fa 100644
> --- a/utils/keytable/keytable.c
> +++ b/utils/keytable/keytable.c
> @@ -12,7 +12,6 @@
>      GNU General Public License for more details.
>    */
>   
> -#include <config.h>
>   #include <ctype.h>
>   #include <errno.h>
>   #include <fcntl.h>
> diff --git a/utils/media-ctl/libmediactl.c b/utils/media-ctl/libmediactl.c
> index 1fd6525b..a18b063e 100644
> --- a/utils/media-ctl/libmediactl.c
> +++ b/utils/media-ctl/libmediactl.c
> @@ -19,8 +19,6 @@
>    * along with this program. If not, see <http://www.gnu.org/licenses/>.
>    */
>   
> -#include "config.h"
> -
>   #include <sys/ioctl.h>
>   #include <sys/stat.h>
>   #include <sys/types.h>
> diff --git a/utils/media-ctl/options.h b/utils/media-ctl/options.h
> index b1751f56..7e0556fc 100644
> --- a/utils/media-ctl/options.h
> +++ b/utils/media-ctl/options.h
> @@ -22,8 +22,6 @@
>   #ifndef __OPTIONS_H
>   #define __OPTIONS_H
>   
> -#include <config.h>
> -
>   struct media_options
>   {
>   	const char *devname;
> diff --git a/utils/qv4l2/alsa_stream.c b/utils/qv4l2/alsa_stream.c
> index 2dca283b..8f5246db 100644
> --- a/utils/qv4l2/alsa_stream.c
> +++ b/utils/qv4l2/alsa_stream.c
> @@ -26,8 +26,6 @@
>    *
>    */
>   
> -#include <config.h>
> -
>   #ifdef HAVE_ALSA
>   #include "alsa_stream.h"
>   
> diff --git a/utils/qv4l2/capture-win-gl.h b/utils/qv4l2/capture-win-gl.h
> index 35235d7a..e27b2b3f 100644
> --- a/utils/qv4l2/capture-win-gl.h
> +++ b/utils/qv4l2/capture-win-gl.h
> @@ -6,8 +6,6 @@
>   #ifndef CAPTURE_WIN_GL_H
>   #define CAPTURE_WIN_GL_H
>   
> -#include <config.h>
> -
>   #ifdef HAVE_QTGL
>   #define GL_GLEXT_PROTOTYPES
>   #define QT_NO_OPENGL_ES_2
> diff --git a/utils/qv4l2/general-tab.h b/utils/qv4l2/general-tab.h
> index 9b4b5bcd..f5ec73e5 100644
> --- a/utils/qv4l2/general-tab.h
> +++ b/utils/qv4l2/general-tab.h
> @@ -21,8 +21,6 @@
>   #ifndef GENERAL_TAB_H
>   #define GENERAL_TAB_H
>   
> -#include <config.h>
> -
>   #include <QSpinBox>
>   #include <QCheckBox>
>   #include <QDoubleSpinBox>
> diff --git a/utils/qv4l2/qv4l2.h b/utils/qv4l2/qv4l2.h
> index aaba74d0..99d1f30b 100644
> --- a/utils/qv4l2/qv4l2.h
> +++ b/utils/qv4l2/qv4l2.h
> @@ -20,8 +20,6 @@
>   #ifndef QV4L2_H
>   #define QV4L2_H
>   
> -#include <config.h>
> -
>   #include <QMainWindow>
>   #include <QTabWidget>
>   #include <QSignalMapper>
> diff --git a/utils/qvidcap/qvidcap.h b/utils/qvidcap/qvidcap.h
> index 7292d8e7..40b1b4e6 100644
> --- a/utils/qvidcap/qvidcap.h
> +++ b/utils/qvidcap/qvidcap.h
> @@ -8,8 +8,6 @@
>   #ifndef QVIDCAP_H
>   #define QVIDCAP_H
>   
> -#include <config.h>
> -
>   // Must come before cv4l-helpers.h
>   #include <libv4l2.h>
>   
> diff --git a/utils/v4l2-compliance/v4l2-compliance.h b/utils/v4l2-compliance/v4l2-compliance.h
> index e574c06c..020e56a9 100644
> --- a/utils/v4l2-compliance/v4l2-compliance.h
> +++ b/utils/v4l2-compliance/v4l2-compliance.h
> @@ -29,12 +29,6 @@
>   #include <linux/v4l2-subdev.h>
>   #include <linux/media.h>
>   
> -#ifdef ANDROID
> -#include <android-config.h>
> -#else
> -#include <config.h>
> -#endif
> -
>   #ifndef NO_LIBV4L2
>   #include <libv4l2.h>
>   #endif
> diff --git a/utils/v4l2-ctl/v4l2-ctl.h b/utils/v4l2-ctl/v4l2-ctl.h
> index 70a80ade..8f2726ea 100644
> --- a/utils/v4l2-ctl/v4l2-ctl.h
> +++ b/utils/v4l2-ctl/v4l2-ctl.h
> @@ -1,12 +1,6 @@
>   #ifndef _V4L2_CTL_H
>   #define _V4L2_CTL_H
>   
> -#ifdef ANDROID
> -#include <android-config.h>
> -#else
> -#include <config.h>
> -#endif
> -
>   #include <linux/videodev2.h>
>   #include <linux/v4l2-subdev.h>
>   #include <v4l-getsubopt.h>
> diff --git a/utils/v4l2-dbg/v4l2-dbg.cpp b/utils/v4l2-dbg/v4l2-dbg.cpp
> index f6a9f433..bd08b4cf 100644
> --- a/utils/v4l2-dbg/v4l2-dbg.cpp
> +++ b/utils/v4l2-dbg/v4l2-dbg.cpp
> @@ -27,12 +27,6 @@
>   #include <sys/ioctl.h>
>   #include <unistd.h>
>   
> -#ifdef ANDROID
> -#include <android-config.h>
> -#else
> -#include <config.h>
> -#endif
> -
>   #ifdef HAVE_SYS_KLOG_H
>   #include <sys/klog.h>
>   #endif
> diff --git a/utils/v4l2-sysfs-path/v4l2-sysfs-path.c b/utils/v4l2-sysfs-path/v4l2-sysfs-path.c
> index c440b24f..d1ad7edb 100644
> --- a/utils/v4l2-sysfs-path/v4l2-sysfs-path.c
> +++ b/utils/v4l2-sysfs-path/v4l2-sysfs-path.c
> @@ -24,7 +24,6 @@
>    *	Mauro Carvalho Chehab
>    */
>   
> -#include <config.h>
>   #include "../libmedia_dev/get_media_devices.h"
>   #include <stdio.h>
>   #include <argp.h>
> diff --git a/utils/v4l2-tracer/libv4l2tracer.cpp b/utils/v4l2-tracer/libv4l2tracer.cpp
> index 6b438628..c5b0e9c0 100644
> --- a/utils/v4l2-tracer/libv4l2tracer.cpp
> +++ b/utils/v4l2-tracer/libv4l2tracer.cpp
> @@ -4,7 +4,6 @@
>    */
>   
>   #include "trace.h"
> -#include <config.h> /* For PROMOTED_MODE_T */
>   #include <dlfcn.h>
>   #include <stdarg.h>
>   
> diff --git a/utils/v4l2-tracer/v4l2-tracer-common.h b/utils/v4l2-tracer/v4l2-tracer-common.h
> index 0bdb125d..10362acb 100644
> --- a/utils/v4l2-tracer/v4l2-tracer-common.h
> +++ b/utils/v4l2-tracer/v4l2-tracer-common.h
> @@ -8,7 +8,6 @@
>   
>   #include "v4l2-info.h"
>   #include "codec-fwht.h"
> -#include "config.h"
>   #include "media-info.h"
>   #include <algorithm>
>   #include <dirent.h>
Tomi Valkeinen Feb. 21, 2023, 12:10 p.m. UTC | #7
On 21/02/2023 14:02, Laurent Pinchart wrote:
> Hi Tomi,
> 
> On Tue, Feb 21, 2023 at 11:55:42AM +0200, Tomi Valkeinen wrote:
>> On 20/02/2023 22:59, Laurent Pinchart wrote:
>>> On Mon, Feb 20, 2023 at 01:13:09PM +0200, Tomi Valkeinen wrote:
>>>> On 12/02/2023 02:51, Laurent Pinchart wrote:
>>>>> Hello everybody,
>>>>>
>>>>> This series is the latest (and greatest) attempt to switch v4l-utils
>>>>> from autotools to meson.
>>>>>
>>>>> Compared to v7, the series has been rebased on top of the latest master
>>>>> branch, and lots of fixes have been added. All review comments should
>>>>> have been addressed. Detailed changelogs are included in individual
>>>>> patches, in particular in patch 3/6.
>>>>>
>>>>> The rebase was a bit painful due to the new v4l2-tracer tool and its
>>>>> code generation script. While meson handles code generation fine, it
>>>>> required fixes to the script to be able to specify the output directory
>>>>> and to generate the trace and retrace sources separately. Many thanks to
>>>>> Sakari for his help with this, which I've included in this series as
>>>>> patch 1/6.
>>>>>
>>>>> Gregor, I haven't included the Tested-by tag you gave on v7 as v8
>>>>> contains many small changes. Sorry about that.
>>>>>
>>>>> The patches are based on 3 pending patches for v4l-utils that have been
>>>>> posted to the list in the last couple of days:
>>>>>
>>>>> - libv4lconvert: Don't ignore return value of ftruncate()
>>>>> - keytable: Add -fno-stack-protector compilation option
>>>>> - configure.ac: Add option to disable compilation of v4l2-tracer
>>>>>
>>>>> None are strictly required, but I've included the equivalent of the
>>>>> second and third patches in the meson support, so I wanted to base the
>>>>> patches on top of the autotools' equivalent. I expect those three
>>>>> patches to be merged soon.
>>>>>
>>>>> As far as I can tell, meson support is now ready. I can address review
>>>>> comments in a v9 if there are any, but I'd like to merge it soon to
>>>>> avoid another painful rebase. I'll be available to fix issues on top if
>>>>> any problem is encountered later.
>>>>>
>>>>> A tag that includes this series can be found at
>>>>>
>>>>>            git://linuxtv.org/pinchartl/v4l-utils.git tags/meson-v8
>>>>
>>>> If I build this for x86 or arm64 with default options, it builds fine. If I build for arm32 (against my buildroot rootfs), the build fails:
>>>>
>>>> [197/254] Compiling C object contrib/test/v4l2gl.p/v4l2gl.c.o
>>>> FAILED: contrib/test/v4l2gl.p/v4l2gl.c.o
>>>> ccache /home/tomba/work/buildroot/output32/host/bin/arm-buildroot-linux-gnueabihf-gcc -Icontrib/test/v4l2gl.p -Icontrib/test -I../contrib/test -I../lib/include -I../include -I/home/tomba/work/buildroot/output32/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include -I/home/tomba/work/buildroot/output32/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/libdrm -I/home/tomba/work/buildroot/output32/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/valgrind -I. -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=gnu99 -O2 -g -Wpointer-arith -D_GNU_SOURCE -DPROMOTED_MODE_T=int -DENABLE_NLS -MD -MQ contrib/test/v4l2gl.p/v4l2gl.c.o -MF contrib/test/v4l2gl.p/v4l2gl.c.o.d -o contrib/test/v4l2gl.p/v4l2gl.c.o -c ../contrib/test/v4l2gl.c
>>>> ../contrib/test/v4l2gl.c:268:60: error: expected ‘,’ or ‘;’ before ‘V4L_UTILS_VERSION’
>>>>      268 | const char *argp_program_version = "V4L2 grabber version " V4L_UTILS_VERSION;
>>>>          |                                                            ^~~~~~~~~~~~~~~~~
>>>
>>> Thank you for the report. I've test-compiled for arm32, but my build
>>> environment may not have the features needed by v4l2gl.c, so it may have
>>> been skipped. Would you be able to check what goes wrong ? v4l2gl.c
>>> includes config.h, so V4L_UTILS_VERSION should be defined. Does your
>>> config.h (generated in the build directory) define V4L_UTILS_VERSION ?
>>> Does your buildroot environment provide a config.h that is being picked
>>> instead ?
>>
>> Here's my attempt fixing this. Works for me for x86, arm32 and arm64 builds:
>>
>>   From 1c6df0f68e46ad56e527d4696d3c40a173b9f505 Mon Sep 17 00:00:00 2001
>> From: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
>> Date: Tue, 21 Feb 2023 11:43:11 +0200
>> Subject: [PATCH] meson: use -include to include config.h instead of -I.
>>
>> Use -include to get config.h included, instead of -I. and having the
>> source files include the config.h. The issue with the latter is that -I.
>> is rather late in the command line, and there may be config.h lurking in
>> some other project include dir (e.g. valgrind's).
>>
>> Note that this doesn't handle including the android-config.h (I think
>> the meson build files break that anyway, as they don't have the project
>> root in include path). I believe this would be best handled by somehow
>> detecting android in the main meson.build file, and adding
>> android-config.h with -include instead of the config.h
> 
> This looks good. I'll try to rebase it though, to switch to -include
> before adding meson support.

Sure, go ahead. But just note the comment about Android above =). To be 
honest, the Android support looked a bit hacky even before meson.

  Tomi