Files
darkforge/toolchain/scripts/014-grep.sh
2026-03-20 11:41:05 +01:00

35 lines
952 B
Bash
Executable File

#!/bin/bash
# ============================================================================
# DarkForge Linux — Phase 0, Chapter 6: Grep
# ============================================================================
# Purpose: Cross-compile GNU grep (pattern matching).
# Inputs: ${LFS}/sources/grep-3.12.tar.xz
# Outputs: grep in ${LFS}/usr/bin/
# Ref: LFS 13.0 §6.10
# ============================================================================
set -euo pipefail
source "${LFS}/sources/darkforge-env.sh"
PACKAGE="grep"
VERSION="3.12"
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 ==="