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

40 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
# ============================================================================
# DarkForge Linux — Phase 3, Chapter 8.50: Libelf
# ============================================================================
# Purpose: Build libelf (from elfutils), a library for reading and writing
# ELF binaries. Required for many development tools and dpack.
# Inputs: /sources/elfutils-0.192.tar.bz2
# Outputs: libelf library and header files in /usr/
# Assumes: Running inside chroot
# Ref: LFS 13.0 §8.50
# ============================================================================
set -euo pipefail
source /sources/toolchain-scripts/100-chroot-env.sh
PACKAGE="elfutils"
VERSION="0.192"
echo "=== Building ${PACKAGE}-${VERSION} (libelf from elfutils) ==="
pkg_extract "${PACKAGE}-${VERSION}.tar.bz2"
cd "${PACKAGE}-${VERSION}"
./configure \
--prefix=/usr \
--disable-debuginfod \
--libdir=/usr/lib \
--sbindir=/usr/sbin
make
make install
# Create symlink for compatibility
cd /usr/lib
ln -sfv libelf.so.1 libelf.so 2>/dev/null || true
pkg_cleanup "${PACKAGE}-${VERSION}"
echo "=== ${PACKAGE}-${VERSION} complete ==="