Hi,
Here an overview about the One Build System Project for flashrom. I'm
sorry for the extreme late anouncement of the passed meeting. We had
some diffent ideas about it. The next one will be anounced in a prper
advanced and with a survay to choose a time.
Please feel free to contribute, take over a task, start a discousion,
comment in the document or reply to this mail.
https://docs.google.com/document/d/1TVso_VbrLEbGc7BNrYxqlrP8jMxB23TuMqEI3PnCzGU/edit?usp=sharing
---
# Flashrom One Build System Working Group [Draft]
## Goal
Make meson the only build system for flashrom. Support all currently
supported platforms.
## Abstract
Modify, extend, rewrite the meson based build system to accommodate
all requirements from flashrom. Rearrange the code for a best fit with
the meson build system. Adapt the Makefile to these changes to have it
working until its end.
## Notify me
Add me to all to all build system related patches. (Or only to Make /
Meson related one.)
* Thomas Heijligen
## Platforms to support
* Systems
* Linux (Distros / ChromeOS)
* BSD (Free, Net, Open, Dragonfly)
* MacOS
* Android?
* SunOS / Solaris / the current version of it
* Debian kFreeBSD
* GNU / HURD
* Windows (mingw cross / cygwin)
* DOS (djgpp cross from Linux)
* libpayload (cross from Linux)
* Architectures
* X86
* ARM
* MIPS
* POWER
x86 supports port I/O (mostly relevant to PCI), others may through
MMIO emulation
## Tasks
* Update the meson programmer selection to a positive list (see meson
snippets)
* Clean up the meson file and use best practices for meson
* PoC: crosscompile “Hello World” for dos / djgpp with meson (with
pci support)
* PoC: crosscompile “Hello World” for libpayload with meson (with pci
support)
* Identify the active programmer in the man page
* Add a note for each programmer that is not active in the build
* Integrate getopt for dos based builds
* Write documentation
* Build instructions for all platforms
* Design of meson.build
* Reason for minimal meson version
* How to add programmer
* Sync compile options (WIP
https://review.coreboot.org/c/flashrom/+/58561)
* Create directories for platform abstraction, programmer, include
files (https://review.coreboot.org/c/flashrom/+/62899)
## Open questions
* System requirements
* How long should we support systems / libraries?
* As long as they have vendor support
* What should be the minimum required version of meson?
* The version of the oldest supported system.
* MacOS and DirectHW
* What is the current status?
* What is useful to support?
* Can we integrate it into flashrom?
* How to test it?
* Internal programmer
* Should a programmer call / access another programmer?
* Can we split the internal programmer into smaller units
(x86_bios, mips_longson, xyz_superio, linux_mtd) and use internal as a
keyword to select one of those?
* Would that make it easier to build and modify?
* Build dependencies
* Can we fetch dependencies like cmocka? This makes building for
some systems easier
* Unit tests
* Can we build the cmoka test on top of libflashrom.a?
* Can this replace self tests?
* Meson feature options
* Build the shared library as feature
* Build the classic_cli as feature
* Can be easily deselectet if not needed of not supported
(libpayload)
* Build the tests as feature
* Build man-pages as feature
* Build ich_descriptor_tool as feature
* Shared libflashrom
* How to handle versioning?
## Sequence for switching the primary build system
* Meson is feature equivalente with the Makefile
* Switch to meson as default build system, update the documentation
* Make a release with meson as the primary build system, keep the
Makefile for legacy compatible.
* Drop the Makefile
* Drop dead code from Makefile only based option
## meson snippets - Ideas
| option('programmer', type : 'array', choices : ['auto' 'all'
'group_pci' 'group_usb' 'ch341a_spi' ‘drkaiser’])
* auto selects all programmer available on the platform if the
dependencies are found
* all selects all programmer available on the platform, failing id a
dependency is not found
* group_* selects all programmer in this group, fails if the system
does not support the group or a dependency is not found
* selects this programmer, fails if not available
on system or missing dependency
| libusb1 = dependency(...)
| libusb1_systems = [ ‘linux’ ‘freebsd’ ‘windows’ ‘mac’ … ]
| libpci = dependency(...)
| libpci_systems = [...] # systems where libpci is available
| port_io = declare_dependency(...) # files needed for port I/O
support
| programmer = {
| 'ch341a_spi' {
| 'system' = libusb1_systems,
| 'srcs' = [ 'ch341a_spi.c' 'usbdev.c' ],
| 'flags' = [ 'CONFIG_CH341A_SPI=1