Build Tools for Build-Time Dependencies
Posted on 26 Oct 2021
by Boris
Kolpackov
One of the main features in the just released build2
0.14.0 is support for
build-time
dependencies and the target/host configuration split that it
necessitates. However, this support is of no use without any tools to depend
on at build-time. So we've packaged a number of base tools that can be
useful both in your own work as well as when packaging third-party
projects.
For background on build-time dependencies including a complete example
using xxd
, refer to Build-Time
Dependencies and Linked Configurations in the toolchain introduction.
Note that all the tools listed below provide build2
metadata.
xxd
- Vim
xxd
creates a hexdump of a given file or standard input. One notablexxd
mode is-i|--include
which generates a C array definition of the input that can be used to embed binary data into C/C++ programs. See Build-Time Dependencies and Linked Configurations for an example. byacc
- Berkeley
yacc
is a parser generator utility that reads a grammar specification from a file and generates an LR(1) parser. It is reasonably compatible with GNUbison
while being lighter-weight and more portable.We use
byacc
as a build-time dependency in thekconfig
project. reflex
reflex
is a variant offlex
, a tool for generating scanners (programs which recognize lexical patterns in text). It remains compatible with POSIXlex
and is reasonably compatible with "new"flex
while being lighter-weight and more portable.We use
reflex
as a build-time dependency in thekconfig
project.openbsd-m4
- OpenBSD
m4
is an implementation of the POSIXm4
general-purpose macro processor that supports many GNUm4
extensions.Note that currently this package does not support Windows.