Features/Meson: Difference between revisions

From QEMU
Line 32: Line 32:
:Write a program that takes the output of "meson introspect --buildoptions" and generates shell code to initialize variables, parse command line options, print the help and create -D command line options for meson.  May only make sense once many or most options are converted.
:Write a program that takes the output of "meson introspect --buildoptions" and generates shell code to initialize variables, parse command line options, print the help and create -D command line options for meson.  May only make sense once many or most options are converted.
:'''Benefit''': remove code duplication, centralize command line handling
:'''Benefit''': remove code duplication, centralize command line handling
== TBD ==
;Get rid of ninjatool and just require Ninja
:'''Benefit''': 1000 lines of code go away
:'''Disadvantage''': recursive build re-enters through the window

Revision as of 16:26, 19 August 2020

What's next?

Blockers for further conversions

Complete moving installation rules to meson.build
Marc-André and Paolo already have patches for this. You're welcome to propose yourself for helping!
Benefit: allows removing parts of Makefile, leaving it as just an orchestrator for submodules, Makefile.ninja and Makefile.mtest
Complete moving build rules to meson.build
Move the build rules from tests/Makefile.include to tests/meson.build. You can take inspiration from tests/qtest/Makefile.include.
Marc-André and Paolo also have patches to convert the build rules in roms/ and pc-bios/
Benefit: allows removing CFLAGS, LDFLAGS, LIBS and LIBS_SOFTMMU, as well as most if not all of rules.mak.

Easy

Move pkg-config tests to meson.build
Replace declare_dependency statements with dependency statements
Benefit: allows removing *_CFLAGS and *_LIBS variables from config-host.mak. Allows using dependency objects instead of CONFIG_* symbols when declaring sourcesets.
Change simple config-host.mak symbols to Meson options
Some symbols (e.g. CONFIG_PARALLELS) are only used placed in config-host.mak to be read from Meson. Instead pass them through -D... command-line options
Benefit: allows removing CONFIG_* variables from config-host.mak.

Medium

"Handle (faked-up) in-tree build
And cleanup code to handle in-tree builds in configure. Or fail gracefully and explain the situation (which would be easier).
Benefit: simpler upgrade path
Include config-target.mak files in the tree
Remove the configuration loop in configure and just include the content of the .mak files directly in the tree, for example in a target/configs/ directory. (There are some small complications because config-target.mak file currently includes the host disassembler symbols too, e.g. CONFIG_I386_DIS).
Benefit: remove large swaths of imperative code, remove *-linux-user and *-softmmu directories from the build tree.
Move other compile tests from configure to meson.build

Hard(er)

Create configure help and command line parsing code from meson_options.txt.
Write a program that takes the output of "meson introspect --buildoptions" and generates shell code to initialize variables, parse command line options, print the help and create -D command line options for meson. May only make sense once many or most options are converted.
Benefit: remove code duplication, centralize command line handling

TBD

Get rid of ninjatool and just require Ninja
Benefit: 1000 lines of code go away
Disadvantage: recursive build re-enters through the window