name=gcc-host
version=14.1.0
tarball_url="https://ftp.gnu.org/gnu/gcc/gcc-${version}/gcc-${version}.tar.xz"
tarball_blake2b="7efd6574b8bca081de6e31480ec0565c6d7fb773383e8e1fdcc17e35bba2bf44b3f4f995cdbcccd001689926e96a6563ef3d099902fe3b37ab09dcf553ab0596"
hostdeps="automake autoconf-2.69 libtool pkg-config"
imagedeps="git"
allow_network="yes"

regenerate() {
    ./contrib/download_prerequisites

    # Gettext causes issues and we don't want it anyways.
    rm -rf gettext*

    autotools_recursive_regen -I"$(realpath ./config)"

    cp -pv /usr/local/share/libtool/build-aux/{config.sub,config.guess,install-sh} libiberty/
    cp -pv /usr/local/share/libtool/build-aux/{config.sub,config.guess,install-sh} libgcc/
}
