44 lines
1.3 KiB
Bash
Executable File
44 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
# ============================================================================
|
|
# DarkForge Linux — Phase 3, Chapter 8.6: Zlib
|
|
# ============================================================================
|
|
# Purpose: Build and install zlib compression library (native version).
|
|
# This is a critical dependency for many tools (binutils, gcc, etc.)
|
|
# Inputs: /sources/zlib-1.3.2.tar.xz
|
|
# Outputs: /usr/lib/libz.so.1, /usr/include/zlib.h
|
|
# Ref: LFS 13.0 §8.6
|
|
# ============================================================================
|
|
|
|
set -euo pipefail
|
|
source /sources/toolchain-scripts/100-chroot-env.sh
|
|
|
|
PACKAGE="zlib"
|
|
VERSION="1.3.2"
|
|
|
|
echo "=== Building ${PACKAGE}-${VERSION} (Phase 3) ==="
|
|
|
|
pkg_extract "${PACKAGE}-${VERSION}.tar.xz"
|
|
cd "${PACKAGE}-${VERSION}"
|
|
|
|
# Configure zlib for the target system
|
|
# --prefix=/usr: Install to standard location
|
|
./configure --prefix=/usr
|
|
|
|
# Build zlib
|
|
make
|
|
|
|
# Run basic tests to ensure build is correct
|
|
make check
|
|
|
|
# Install zlib
|
|
make install
|
|
|
|
# Zlib installs some files to /usr/lib with incorrect permissions
|
|
# Make them writable (they're .a and .so files)
|
|
chmod -v 755 /usr/lib/libz.so.1.3.2
|
|
ln -sfv libz.so.1.3.2 /usr/lib/libz.so
|
|
ln -sfv libz.so.1.3.2 /usr/lib/libz.so.1
|
|
|
|
pkg_cleanup "${PACKAGE}-${VERSION}"
|
|
echo "=== ${PACKAGE}-${VERSION} complete ==="
|