Files
darkforge/toolchain/scripts/012-findutils.sh
2026-03-20 12:03:59 +01:00

38 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
# ============================================================================
# DarkForge Linux — Phase 0, Chapter 6: Findutils
# ============================================================================
# Purpose: Cross-compile GNU findutils (find, xargs, locate).
# Inputs: ${LFS}/sources/findutils-4.10.0.tar.xz
# Outputs: find, xargs in ${LFS}/usr/bin/
# Ref: LFS 13.0 §6.8
# ============================================================================
set -euo pipefail
source "${LFS}/sources/darkforge-env.sh"
PACKAGE="findutils"
VERSION="4.10.0"
SRCDIR="${LFS}/sources"
echo "=== Building ${PACKAGE}-${VERSION} (Temporary Tool) ==="
cd "${SRCDIR}"
tar -xf "${PACKAGE}-${VERSION}.tar.xz"
cd "${PACKAGE}-${VERSION}"
# Cross-compile cache override: findutils tests fnmatch behavior at configure.
./configure \
--prefix=/usr \
--localstatedir=/var/lib/locate \
--host="${LFS_TGT}" \
--build="$(build-aux/config.guess)" \
gl_cv_func_fnmatch_gnu=yes
make
make DESTDIR="${LFS}" install
cd "${SRCDIR}"
rm -rf "${PACKAGE}-${VERSION}"
echo "=== ${PACKAGE}-${VERSION} complete ==="