46 lines
1.4 KiB
Bash
Executable File
46 lines
1.4 KiB
Bash
Executable File
#!/bin/bash
|
|
# ============================================================================
|
|
# DarkForge Linux — Phase 0, Chapter 6: Coreutils
|
|
# ============================================================================
|
|
# Purpose: Cross-compile GNU coreutils (ls, cp, mv, cat, chmod, etc.)
|
|
# for the temporary tools environment.
|
|
# Inputs: ${LFS}/sources/coreutils-9.10.tar.xz
|
|
# Outputs: Core utilities in ${LFS}/usr/bin/
|
|
# Assumes: Cross-toolchain complete
|
|
# Ref: LFS 13.0 §6.5
|
|
# ============================================================================
|
|
|
|
set -euo pipefail
|
|
source "${LFS}/sources/darkforge-env.sh"
|
|
|
|
PACKAGE="coreutils"
|
|
VERSION="9.10"
|
|
SRCDIR="${LFS}/sources"
|
|
|
|
echo "=== Building ${PACKAGE}-${VERSION} (Temporary Tool) ==="
|
|
|
|
cd "${SRCDIR}"
|
|
tar -xf "${PACKAGE}-${VERSION}.tar.xz"
|
|
cd "${PACKAGE}-${VERSION}"
|
|
|
|
# Cross-compile cache overrides: coreutils 9.10 tries to run test binaries
|
|
# for strerror and strnlen. We know glibc provides correct implementations.
|
|
./configure \
|
|
--prefix=/usr \
|
|
--host="${LFS_TGT}" \
|
|
--build="$(build-aux/config.guess)" \
|
|
--enable-install-program=hostname \
|
|
gl_cv_macro_MB_CUR_MAX_good=y \
|
|
gl_cv_func_working_strerror=yes \
|
|
ac_cv_func_strnlen_working=yes
|
|
|
|
make
|
|
make DESTDIR="${LFS}" install
|
|
|
|
# Move some programs to where they're expected
|
|
mv -v "${LFS}/usr/bin/chroot" "${LFS}/usr/sbin"
|
|
|
|
cd "${SRCDIR}"
|
|
rm -rf "${PACKAGE}-${VERSION}"
|
|
echo "=== ${PACKAGE}-${VERSION} complete ==="
|