mbox series

[v1,0/1] Add support for meson building

Message ID 20200618133303.28676-1-ariel@vanguardiasur.com.ar (mailing list archive)
Headers show
Series Add support for meson building | expand

Message

Ariel D'Alessandro June 18, 2020, 1:33 p.m. UTC
Hi all,

After a couple of RFCs, here's the final patchset adding support for the
meson build system.

All functionality provided by the autotools based build was ported to
meson, except sync-with-kernel. I guess we can add it at some later
point and have this merged anyway.

Native and cross compilation has been tested with several options. Any
feedback, testing or suggestions are welcome. Looking forward to see
this merged in the next release hopefully :-)

Here's a simple comparison between meson and autotools performance for a
native build:

    $ time meson build/
        [...]
        real    0m3.172s
        user    0m2.698s
        sys     0m0.577s
    $ time ninja -C build/ -j4
        [...]
        real    0m19.533s
        user    1m11.860s
        sys     0m7.956s

    $ time (./bootstrap.sh && ./configure)
        [...]
        real    0m19.289s
        user    0m16.448s
        sys     0m2.756s
    $ time make -j4
        [...]
        real    0m55.250s
        user    2m29.425s
        sys     0m10.829s

This patchset was developed on top of v4l-utils tag: v4l-utils-1.20.0:

    commit 3b22ab02b960e4d1e90618e9fce9b7c8a80d814a
    Author: Gregor Jasny <gjasny@googlemail.com>
        Prepare for 1.20.0 release

You can find the patch pushed to the following branch:

    https://gitlab.com/adalessandro/v4l-utils/-/tree/v4l-utils-1.20.0-meson-v1

Regards,

Ariel D'Alessandro (1):
  Add support for meson building

 .gitignore                                    |   1 +
 contrib/cobalt-ctl/meson.build                |   8 +
 contrib/decode_tm6000/meson.build             |  14 +
 contrib/gconv/meson.build                     |  42 +++
 contrib/meson.build                           |  13 +
 contrib/rds-saa6588/meson.build               |   7 +
 contrib/test/meson.build                      | 143 ++++++++++
 contrib/xc3028-firmware/meson.build           |  11 +
 gen-version.sh                                |  36 +++
 lib/libdvbv5/meson.build                      | 152 +++++++++++
 lib/libv4l-mplane/meson.build                 |  16 ++
 lib/libv4l1/meson.build                       |  52 ++++
 lib/libv4l2/meson.build                       |  64 +++++
 lib/libv4l2rds/meson.build                    |  27 ++
 lib/libv4lconvert/meson.build                 | 107 ++++++++
 lib/meson.build                               |  11 +
 libdvbv5-po/meson.build                       |   3 +
 meson.build                                   | 255 ++++++++++++++++++
 meson_options.txt                             |  42 +++
 utils/cec-compliance/meson.build              |  24 ++
 utils/cec-ctl/meson.build                     |  18 ++
 utils/cec-follower/meson.build                |  21 ++
 utils/cx18-ctl/meson.build                    |   8 +
 utils/dvb/meson.build                         |  70 +++++
 utils/gen_media_bus_format_codes.sh           |   7 +
 utils/gen_media_bus_format_names.sh           |   7 +
 utils/ir-ctl/meson.build                      |  23 ++
 utils/ivtv-ctl/meson.build                    |  13 +
 .../bpf_protocols/clang_sys_includes.sh       |   9 +
 utils/keytable/bpf_protocols/meson.build      |  31 +++
 utils/keytable/meson.build                    |  74 +++++
 utils/keytable/rc_keymaps/meson.build         | 147 ++++++++++
 utils/libcecutil/meson.build                  |  45 ++++
 utils/libmedia_dev/meson.build                |  14 +
 utils/libv4l2util/meson.build                 |  16 ++
 utils/media-ctl/meson.build                   |  43 +++
 utils/meson.build                             |  46 ++++
 utils/qv4l2/meson.build                       |  80 ++++++
 utils/qvidcap/meson.build                     |  82 ++++++
 utils/rds-ctl/meson.build                     |  13 +
 utils/v4l2-compliance/meson.build             |  60 +++++
 utils/v4l2-ctl/meson.build                    |  75 ++++++
 utils/v4l2-dbg/meson.build                    |  16 ++
 utils/v4l2-sysfs-path/meson.build             |  14 +
 v4l-utils-po/meson.build                      |   3 +
 version.h.in                                  |   1 +
 46 files changed, 1964 insertions(+)
 create mode 100644 contrib/cobalt-ctl/meson.build
 create mode 100644 contrib/decode_tm6000/meson.build
 create mode 100644 contrib/gconv/meson.build
 create mode 100644 contrib/meson.build
 create mode 100644 contrib/rds-saa6588/meson.build
 create mode 100644 contrib/test/meson.build
 create mode 100644 contrib/xc3028-firmware/meson.build
 create mode 100755 gen-version.sh
 create mode 100644 lib/libdvbv5/meson.build
 create mode 100644 lib/libv4l-mplane/meson.build
 create mode 100644 lib/libv4l1/meson.build
 create mode 100644 lib/libv4l2/meson.build
 create mode 100644 lib/libv4l2rds/meson.build
 create mode 100644 lib/libv4lconvert/meson.build
 create mode 100644 lib/meson.build
 create mode 100644 libdvbv5-po/meson.build
 create mode 100644 meson.build
 create mode 100644 meson_options.txt
 create mode 100644 utils/cec-compliance/meson.build
 create mode 100644 utils/cec-ctl/meson.build
 create mode 100644 utils/cec-follower/meson.build
 create mode 100644 utils/cx18-ctl/meson.build
 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
 create mode 100644 utils/ir-ctl/meson.build
 create mode 100644 utils/ivtv-ctl/meson.build
 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
 create mode 100644 utils/libcecutil/meson.build
 create mode 100644 utils/libmedia_dev/meson.build
 create mode 100644 utils/libv4l2util/meson.build
 create mode 100644 utils/media-ctl/meson.build
 create mode 100644 utils/meson.build
 create mode 100644 utils/qv4l2/meson.build
 create mode 100644 utils/qvidcap/meson.build
 create mode 100644 utils/rds-ctl/meson.build
 create mode 100644 utils/v4l2-compliance/meson.build
 create mode 100644 utils/v4l2-ctl/meson.build
 create mode 100644 utils/v4l2-dbg/meson.build
 create mode 100644 utils/v4l2-sysfs-path/meson.build
 create mode 100644 v4l-utils-po/meson.build
 create mode 100644 version.h.in

Comments

Sean Young June 19, 2020, 12:10 p.m. UTC | #1
On Thu, Jun 18, 2020 at 10:33:02AM -0300, Ariel D'Alessandro wrote:
> Hi all,
> 
> After a couple of RFCs, here's the final patchset adding support for the
> meson build system.
> 
> All functionality provided by the autotools based build was ported to
> meson, except sync-with-kernel. I guess we can add it at some later
> point and have this merged anyway.

sync-with-kernel is a few fragments of shell that live in various parts
of the tree (Makefiles). It's just static shell, the build system doesn't
need to do any substitions.

I think sync-with-kernel doesn't really belong in the build system; This
can be moved into its own shell script.

> Native and cross compilation has been tested with several options. Any
> feedback, testing or suggestions are welcome. Looking forward to see
> this merged in the next release hopefully :-)
> 
> Here's a simple comparison between meson and autotools performance for a
> native build:
> 
>     $ time meson build/
>         [...]
>         real    0m3.172s
>         user    0m2.698s
>         sys     0m0.577s
>     $ time ninja -C build/ -j4
>         [...]
>         real    0m19.533s
>         user    1m11.860s
>         sys     0m7.956s
> 
>     $ time (./bootstrap.sh && ./configure)
>         [...]
>         real    0m19.289s
>         user    0m16.448s
>         sys     0m2.756s
>     $ time make -j4
>         [...]
>         real    0m55.250s
>         user    2m29.425s
>         sys     0m10.829s

Nice! This will really help when I'm testing on the rpi.


Sean
Ezequiel Garcia June 19, 2020, 2:09 p.m. UTC | #2
Hi Sean,

On Fri, 2020-06-19 at 13:10 +0100, Sean Young wrote:
> On Thu, Jun 18, 2020 at 10:33:02AM -0300, Ariel D'Alessandro wrote:
> > Hi all,
> > 
> > After a couple of RFCs, here's the final patchset adding support for the
> > meson build system.
> > 
> > All functionality provided by the autotools based build was ported to
> > meson, except sync-with-kernel. I guess we can add it at some later
> > point and have this merged anyway.
> 
> sync-with-kernel is a few fragments of shell that live in various parts
> of the tree (Makefiles). It's just static shell, the build system doesn't
> need to do any substitions.
> 
> I think sync-with-kernel doesn't really belong in the build system;

I totally agree there.

> This
> can be moved into its own shell script.
> 
> > Native and cross compilation has been tested with several options. Any
> > feedback, testing or suggestions are welcome. Looking forward to see
> > this merged in the next release hopefully :-)
> > 
> > Here's a simple comparison between meson and autotools performance for a
> > native build:
> > 
> >     $ time meson build/
> >         [...]
> >         real    0m3.172s
> >         user    0m2.698s
> >         sys     0m0.577s
> >     $ time ninja -C build/ -j4
> >         [...]
> >         real    0m19.533s
> >         user    1m11.860s
> >         sys     0m7.956s
> > 
> >     $ time (./bootstrap.sh && ./configure)
> >         [...]
> >         real    0m19.289s
> >         user    0m16.448s
> >         sys     0m2.756s
> >     $ time make -j4
> >         [...]
> >         real    0m55.250s
> >         user    2m29.425s
> >         sys     0m10.829s
> 
> Nice! This will really help when I'm testing on the rpi.
> 

Yup, meson allows really simple and fast cross builds.

My colleague Stéphane has blogged [1] about this
recently.

Cheers,
Ezequiel

[1] https://www.collabora.com/news-and-blog/blog/2020/05/15/cross-compiling-with-gst-build-and-gstreamer/