#!/bin/bash # ============================================================================ # DarkForge Linux — Phase 3, Chapter 8.51: Libffi # ============================================================================ # Purpose: Build libffi (Foreign Function Interface), a library for # dynamically calling C functions. Required by Python, Ruby, and GCC. # Inputs: /sources/libffi-3.4.7.tar.gz # Outputs: libffi library and development files in /usr/ # Assumes: Running inside chroot # Ref: LFS 13.0 §8.51 # ============================================================================ set -euo pipefail source /sources/toolchain-scripts/100-chroot-env.sh PACKAGE="libffi" VERSION="3.4.7" echo "=== Building ${PACKAGE}-${VERSION} (Phase 3) ===" pkg_extract "${PACKAGE}-${VERSION}.tar.gz" cd "${PACKAGE}-${VERSION}" ./configure \ --prefix=/usr \ --disable-static \ --with-gcc-arch=native make make install pkg_cleanup "${PACKAGE}-${VERSION}" echo "=== ${PACKAGE}-${VERSION} complete ==="