#!/bin/bash set -e build_dir=$1 install_dir=$2 install_type=$3 # Change to the glibc build directory cd "${build_dir}/build" # Prevent warning about missing /etc/ld.so.conf # touch ${install_dir}/etc/ld.so.conf # Fix the Makefile to skip an outdated sanity check that fails with a modern Glibc configuration sed '/test-installation/s@$(PERL)@echo not running@' -i Makefile # Install the package echo "Installing glibc..." make DESTDIR="${install_dir}" install # Fix a hardcoded path to the executable loader in the ldd script sed '/RTLDLIST=/s@/usr@@g' -i "${install_dir}/usr/bin/ldd" echo "Installation complete."