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
xxdcreates a hexdump of a given file or standard input. One notablexxdmode is-i|--includewhich 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
yaccis a parser generator utility that reads a grammar specification from a file and generates an LR(1) parser. It is reasonably compatible with GNUbisonwhile being lighter-weight and more portable.We use
byaccas a build-time dependency in thekconfigproject. reflexreflexis a variant offlex, a tool for generating scanners (programs which recognize lexical patterns in text). It remains compatible with POSIXlexand is reasonably compatible with "new"flexwhile being lighter-weight and more portable.We use
reflexas a build-time dependency in thekconfigproject.openbsd-m4- OpenBSD
m4is an implementation of the POSIXm4general-purpose macro processor that supports many GNUm4extensions.Note that currently this package does not support Windows.