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

40 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
# ============================================================================
# DarkForge Linux — Phase 3, Chapter 8.24: MPC (Multiple Precision Complex)
# ============================================================================
# Purpose: Build MPC, a library for arbitrary-precision complex number
# arithmetic. Required by GCC for floating-point math operations.
# Inputs: /sources/mpc-1.3.1.tar.gz
# GMP and MPFR already installed
# Outputs: MPC library in /usr/lib, headers in /usr/include
# Ref: LFS 13.0 §8.24
# ============================================================================
set -euo pipefail
source /sources/toolchain-scripts/100-chroot-env.sh
PACKAGE="mpc"
VERSION="1.3.1"
echo "=== Building ${PACKAGE}-${VERSION} (Phase 3) ==="
pkg_extract "${PACKAGE}-${VERSION}.tar.gz"
cd "${PACKAGE}-${VERSION}"
# Configure MPC with GMP and MPFR support already in place
./configure \
--prefix=/usr \
--disable-static
make
make html
make install
make install-html
# Verify installation
echo "MPC version: $(grep -o '#define MPC_VERSION "[^"]*' src/mpc.h | awk -F'"' '{print $NF}')"
cd "${SRCDIR}"
pkg_cleanup "${PACKAGE}-${VERSION}"
echo "=== ${PACKAGE}-${VERSION} complete ==="