Big script

This commit is contained in:
2026-03-20 15:09:30 +01:00
parent dc2ac2f768
commit a2ca02a856
92 changed files with 5842 additions and 0 deletions

43
toolchain/scripts/104-zlib.sh Executable file
View File

@@ -0,0 +1,43 @@
#!/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 ==="