8.22. awk stage 2 20251225

Rebuild One True Awk in the final target environment so POSIX text-processing scripts use the completed userspace.

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

Source URL: https://github.com/onetrueawk/awk/archive/refs/tags/20251225.tar.gz

Upstream build note: upstream documents a plain make build that produces an executable named a.out, then expects the builder to install it as awk. The bundled makefile defaults to bison -d; this section passes the yacc-compatible command provided earlier in this chapter.

Licenses:

Dependencies:

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

Extract and Enter the Source Tree

cd /sources
rm -rf awk-20251225
tar -xf awk-20251225.tar.gz
cd awk-20251225

Build awk

awk does not ship a configure script, so lbi_configure is not applicable here.
make $LWI_MAKE_FLAGS \
    HOSTCC="cc -g -Wall -pedantic -Wcast-qual" \
    CC="cc $LWI_CFLAGS $LBI_CUSTOM_LDFLAGS" \
    YACC="yacc -d -b awkgram"

Install awk

install -Dm755 a.out /system/binaries/awk
install -Dm644 awk.1 /system/documentation/man-pages/man1/awk.1
After this step is complete, you can remove the extracted source directory and source tarball from /sources if you do not plan to rebuild awk again.

Command Explanations