Files
darkforge/toolchain/scripts/006-m4.sh
2026-03-20 11:18:42 +01:00

37 lines
1.0 KiB
Bash
Executable File

#!/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.21.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.21"
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 ==="