#!/bin/bash # ============================================================================ # DarkForge Linux — Phase 3, Chapter 8.18: Expect # ============================================================================ # Purpose: Build Expect, which is used to run automated tests for other # programs. Required by dejagnu for the GCC test suite. # Inputs: /sources/expect5.45.4.tar.gz # /sources/expect-5.45.4-gcc15-1.patch (GCC 15 compatibility) # Outputs: expect binary and libraries in /usr # Ref: LFS 13.0 §8.18 # ============================================================================ set -euo pipefail source /sources/toolchain-scripts/100-chroot-env.sh PACKAGE="expect" VERSION="5.45.4" echo "=== Building ${PACKAGE}-${VERSION} (Phase 3) ===" pkg_extract "${PACKAGE}${VERSION}.tar.gz" cd "${PACKAGE}${VERSION}" # Apply GCC 15 compatibility patch patch -Np1 < "${SRCDIR}/expect-${VERSION}-gcc15-1.patch" # Configure with Tcl support ./configure \ --prefix=/usr \ --with-tcl=/usr/lib \ --with-tclinclude=/usr/include make make install # Verify installation echo "expect version: $(/usr/bin/expect -v | head -1)" cd "${SRCDIR}" pkg_cleanup "${PACKAGE}${VERSION}" echo "=== ${PACKAGE}-${VERSION} complete ==="