#!/bin/bash set -o errexit # Reading system configuration informations, functions and package versions. source ../sysinfos source ../functions source ../packages-list case "${HVL_TARGET}" in "x86" | "x86_64") # Manually apply patch apply_patch ${1}-rpath.patch ${1} ;; esac case "${HVL_TARGET}" in "x86") TMP_CFLAGS="-march=$(cut -d- -f1 <<< ${CLFS_TARGET}) -mtune=generic -g -O2" ;; esac cd ${LFS_TMP}/${1} decompress_package ${EGLIBC_PORTS} $(pwd) 1> /dev/null # Disable linking to libgcc_eh: sed -e 's/-lgcc_eh//g' -i Makeconfig cd ${LFS_TMP}/${1}-build # The following lines need to be added to config.cache for Glibc to support NPTL: cat > config.cache << "EOF" libc_cv_forced_unwind=yes libc_cv_c_cleanup=yes libc_cv_gnu89_inline=yes EOF # Configure options: # BUILD_CC="gcc" # This sets Glibc to use the current compiler on our system. This is used to # create the tools Glibc uses during its build. # CC="${CLFS_TARGET}-gcc ${CLFS_BUILDFLAGS}" # Forces Glibc to build using our target architecture GCC utilizing any # special CLFS build flags. # AR="${CLFS_TARGET}-ar" # This forces Glibc to use the ar utility we made for our target # architecture. # RANLIB="${CLFS_TARGET}-ranlib" # This forces Glibc to use the ranlib utility we made for our target # architecture. # # --disable-profile # This builds the libraries without profiling information. # --enable-add-ons # This tells Glibc to utilize all add-ons that are available. # --with-tls # This tells Glibc to use Thread Local Storage. # --enable-kernel=2.x.x # Compile the library for support of linux 2.6.x kernels. # The kernel version specified must not be newer than the # version of the kernel running on the build machine. # --with-headers=/tools/include # Forces glibc to use the linux-libc-headers installed # in /tools/include, rather than those on the host, which # may be too old to support needed functionality. # --with-__thread # This tells Glibc to use use the __thread for libc and libpthread builds. # --with-binutils=/cross-tools/bin # This tells Glibc to use the Binutils that are specific to our target # architecture. # --disable-profile # Builds the libraries without profiling information. BUILD_CC="gcc" \ CC="${CLFS_TARGET}-gcc ${CLFS_BUILDFLAGS}" \ AR="${CLFS_TARGET}-ar" \ RANLIB="${CLFS_TARGET}-ranlib" \ CFLAGS=${TMP_CFLAGS} \ ../${1}/configure \ --prefix=/tools \ --host=${CLFS_TARGET} \ --build=${CLFS_HOST} \ --disable-profile \ --enable-add-ons \ --with-tls \ --enable-kernel=$(get_pkg_ver ${KERNEL}) \ --with-__thread \ --with-binutils=/cross-tools/bin \ --with-headers=/tools/include \ --cache-file=config.cache ${HVMAKE} ${HVMAKE} install exit $?