shithub: newlib

ref: 536cef2b2ad9ba00df99f38b8eee764297562799
dir: /host-recipes/bootstrap-gcc/

View raw version
name=bootstrap-gcc
from_source=gcc-host
revision=1
imagedeps="gcc"
hostdeps="autoconf-2.69 automake-1.15.1"
hostrundeps="binutils"

build() {
    cp -rp "${source_dir}"/. ./

    mkdir build && cd build

        CXXFLAGS_FOR_TARGET="$CXXFLAGS" \
        CFLAGS_FOR_TARGET="$CFLAGS" \
    ../configure \
        --prefix="${prefix}" \
        --target=${OS_TRIPLET} \
        --with-sysroot="${sysroot_dir}" \
        --disable-nls \
        --disable-lto \
        --disable-tls \
        --enable-languages=c \
        --without-headers \
        --with-newlib

    make -j${parallelism} all-gcc all-target-libgcc
}

package() {
    cd build
    DESTDIR="${dest_dir}" make install-gcc install-target-libgcc

    ln -s ${OS_TRIPLET}-gcc "${dest_dir}${prefix}/bin/${OS_TRIPLET}-cc"

        strip_command=strip \
    post_package_strip
}