1.2. pass1-gcc-10.2.0
#!/bin/sh # Copyright © 1999-2022 Gerard Beekmans # Copyright © 2017-2022 Random Crew # Distributed under the terms of MIT License. MY_P="${P#pass1-}" MY_PD="${MY_P}"
Additional source handling
The same version of gcc is used in several versions of LFS and uses different versions of libraries gmp, mpc.
src_postfetch() { case ${LFS_VERSION} in 10.1) gmp_version='6.2.1' mpc_version='1.2.1' ;; 10.0) gmp_version='6.2.0' mpc_version='1.1.0' ;; *) gmp_version='6.2.0' mpc_version='1.1.0' ;; esac tar xf ${ANYSRCDIR}/mpfr-4.1.0.tar.xz mv mpfr-4.1.0 mpfr tar xf ${ANYSRCDIR}/gmp-${gmp_version}.tar.xz mv gmp-${gmp_version} gmp tar xf ${ANYSRCDIR}/mpc-${mpc_version}.tar.gz mv mpc-${mpc_version} mpc }
Configuration
src_config() { case $(uname -m) in x86_64) sed -e '/m64=/s/lib64/lib/' \ -i.orig gcc/config/i386/t-linux64 ;; esac mkdir build cd build ../configure \ --target=${LFS_TGT} \ --prefix=${LFS}/${PASS1PREFIX} \ --with-glibc-version=2.11 \ --with-sysroot=${LFS} \ --with-newlib \ --without-headers \ --disable-nls \ --disable-shared \ --disable-multilib \ --disable-decimal-float \ --disable-threads \ --disable-libatomic \ --disable-libgomp \ --disable-libquadmath \ --disable-libssp \ --disable-libvtv \ --disable-libstdcxx \ --enable-languages=c,c++ }
Compilation
src_compile() { make ${MAKEOPTS} }
Installation
$LFS_TGT-gcc is called not from default path, but explicitly from $D/$PREFIX. At the moment $LFS_TGT-gcc is not installed into the filesystem, as installation goes into D first.
src_install() { make install ${MAKEOPTS} DESTDIR=${D} cd .. cat gcc/limitx.h gcc/glimits.h gcc/limity.h > \ `dirname $( ${D}/${LFS}/${PASS1PREFIX}/bin/${LFS_TGT}-gcc \ -print-libgcc-file-name )`/install-tools/include/limits.h }
Links
- url.lfs:
- url.lfs.stage1: https://linuxfromscratch.org/lfs/view/10.1/chapter05/gcc-pass1.html