6.16. awk 20251225

awk provides the One True Awk implementation for POSIX text-processing scripts in the target userspace.

Input assumption: awk-20251225.tar.gz is already present in LBI_SOURCES from the chapter 4 source staging step.

Licenses:

Dependencies:

awk is a POSIX awk language interpreter from the One True Awk project. we need it to provide awk for text processing and script compatibility in later chapters.

Extract and Enter the Source Tree

cd "$LBI_SOURCES"
tar -xf awk-20251225.tar.gz
cd awk-20251225

Build awk

Configure note: this package does not ship a configure script, so lbi_configure is not supported here. Build settings are passed directly to make.
make $LWI_MAKE_FLAGS \
    HOSTCC="cc -g -Wall -pedantic -Wcast-qual" \
    CC="$LBI_ROOT/system/tools/bin/$LBI_TARGET-clang --target=$LBI_TARGET --sysroot=$LBI_ROOT $LWI_CFLAGS $LBI_CUSTOM_LDFLAGS"

Install awk

install -Dm755 a.out "$LBI_ROOT/system/binaries/awk"
install -Dm644 awk.1 "$LBI_ROOT/system/documentation/man-pages/man1/awk.1"

Command Explanations