#!/bin/bash # ============================================================================ # DarkForge Linux — Phase 0, Chapter 6: M4 # ============================================================================ # Purpose: Cross-compile the M4 macro processor. Required by Bison and # other packages that process m4 macros. # Inputs: ${LFS}/sources/m4-1.4.20.tar.xz # Outputs: m4 binary in ${LFS}/usr/ # Assumes: Cross-toolchain (Ch.5) complete # Ref: LFS 13.0 §6.2 # ============================================================================ set -euo pipefail source "${LFS}/sources/darkforge-env.sh" PACKAGE="m4" VERSION="1.4.20" SRCDIR="${LFS}/sources" echo "=== Building ${PACKAGE}-${VERSION} (Temporary Tool) ===" cd "${SRCDIR}" tar -xf "${PACKAGE}-${VERSION}.tar.xz" cd "${PACKAGE}-${VERSION}" ./configure \ --prefix=/usr \ --host="${LFS_TGT}" \ --build="$(build-aux/config.guess)" make make DESTDIR="${LFS}" install cd "${SRCDIR}" rm -rf "${PACKAGE}-${VERSION}" echo "=== ${PACKAGE}-${VERSION} complete ==="