Files
darkforge/toolchain/scripts/120-mpfr.sh
2026-03-20 15:09:30 +01:00

41 lines
1.3 KiB
Bash

#!/bin/bash
# ============================================================================
# DarkForge Linux — Phase 3, Chapter 8.23: MPFR (Multiple Precision Float)
# ============================================================================
# Purpose: Build MPFR, a library for arbitrary-precision floating-point
# arithmetic. Required by GCC for advanced floating-point operations.
# Inputs: /sources/mpfr-4.2.2.tar.xz
# GMP already installed
# Outputs: MPFR library in /usr/lib, headers in /usr/include
# Ref: LFS 13.0 §8.23
# ============================================================================
set -euo pipefail
source /sources/toolchain-scripts/100-chroot-env.sh
PACKAGE="mpfr"
VERSION="4.2.2"
echo "=== Building ${PACKAGE}-${VERSION} (Phase 3) ==="
pkg_extract "${PACKAGE}-${VERSION}.tar.xz"
cd "${PACKAGE}-${VERSION}"
# Configure MPFR with GMP support already in place
./configure \
--prefix=/usr \
--disable-static \
--enable-thread-safe
make
make html
make install
make install-html
# Verify installation
echo "MPFR version: $(grep -o 'define MPFR_VERSION_MAJOR [0-9]*' src/mpfrversion.h | awk '{print $NF}').$(grep -o 'define MPFR_VERSION_MINOR [0-9]*' src/mpfrversion.h | awk '{print $NF}')"
cd "${SRCDIR}"
pkg_cleanup "${PACKAGE}-${VERSION}"
echo "=== ${PACKAGE}-${VERSION} complete ==="