• [gentoo-dev] [PATCH 3/3] A check that the compiler used to build ada is

    From Alfredo Tupone@21:1/5 to All on Thu Apr 25 17:50:02 2024
    Maybe a more detailed check can be done, as some version can be built with newer compiler
    Could be envisaged to switch the compiler automatically "gcc-config x" instead of die

    Signed-off-by: Alfredo Tupone <tupone@gentoo.org>
    ---
    eclass/toolchain.eclass | 12 ++++++++++++
    1 file changed, 12 insertions(+)

    diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
    index f8e06fa39884..ce665b3c594b 100644
    --- a/eclass/toolchain.eclass
    +++ b/eclass/toolchain.eclass
    @@ -540,30 +540,42 @@ get_gcc_src_uri() {

    echo "${GCC_SRC_URI}"
    }

    SRC_URI=$(get_gcc_src_uri)

    #---->> pkg_pretend <<----

    toolchain_pkg_pretend() {
    if ! _tc_use_if_iuse cxx ; then
    _tc_use_if_iuse go && \
    ewarn 'Go requires a C++ compiler, disabled due to USE="-cxx"'
    _tc_use_if_iuse objc++ && \
    ewarn 'Obj-C++ requires a C++ compiler, disabled due to USE="-cxx"'
    fi
    + if _tc_use_if_iuse ada ; then
    + if ! _tc_use_if_iuse cxx ; then
    + ewarn 'Ada requires a C++ compiler, disabled due to USE="-cxx"'
    + else
    + prevAdaSLOT=$(gnatmake -v 2>&1 | sed -n '2 p' | sed 's:^[^0-9]*\([0-9]\+\).*:\1:' | sed 's:2021:10:' )
    + if [[ -z "${prevAdaSLOT}" ]] ; then
    + die 'Ada requires an Ada compiler'
    + elif [[ ${SLOT} -lt ${