commit:     d6d640106d59381bf34fea26b80c31e1de8c9e6b
Author:     Tupone Alfredo <tupone <AT> gentoo <DOT> org>
AuthorDate: Sat Apr  4 11:17:59 2020 +0000
Commit:     Alfredo Tupone <tupone <AT> gentoo <DOT> org>
CommitDate: Sat Apr  4 11:20:21 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d6d64010

toolchain.eclass: add support to ada during compile

Signed-off-by: Alfredo Tupone <tupone <AT> gentoo.org>

 eclass/toolchain.eclass | 25 ++++++++++++++++++++++---
 1 file changed, 22 insertions(+), 3 deletions(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 46482ad9d75..9471dc8d8a3 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -184,7 +184,7 @@ if [[ ${PN} != "kgcc64" && ${PN} != gcc-* ]] ; then
        tc_version_is_at_least 6.5 &&
                IUSE+=" graphite" TC_FEATURES+=(graphite)
        tc_version_is_between 4.9 8 && IUSE+=" cilk"
-       tc_version_is_at_least 4.9 && IUSE+=" +vtv"
+       tc_version_is_at_least 4.9 && IUSE+=" ada +vtv"
        tc_version_is_at_least 5.0 && IUSE+=" jit"
        tc_version_is_between 5.0 9 && IUSE+=" mpx"
        tc_version_is_at_least 6.0 && IUSE+=" +pie +ssp +pch"
@@ -899,8 +899,7 @@ toolchain_src_configure() {
        is_f77 && GCC_LANG+=",f77"
        is_f95 && GCC_LANG+=",f95"
 
-       # We do NOT want 'ADA support' in here!
-       # is_ada && GCC_LANG+=",ada"
+       is_ada && GCC_LANG+=",ada"
 
        confgcc+=( --enable-languages=${GCC_LANG} )
 
@@ -1260,6 +1259,10 @@ toolchain_src_configure() {
                fi
        fi
 
+       if in_iuse ada ; then
+               confgcc+=( --disable-libada )
+       fi
+
        if in_iuse cilk ; then
                confgcc+=( $(use_enable cilk libcilkrts) )
        fi
@@ -1653,6 +1656,11 @@ toolchain_src_compile() {
        [[ ! -x /usr/bin/perl ]] \
                && find "${WORKDIR}"/build -name '*.[17]' -exec touch {} +
 
+       # To compile ada library standard files special compiler options are 
passed
+       # via ADAFLAGS in the Makefile.
+       # Unset ADAFLAGS as setting this override the options
+       unset ADAFLAGS
+
        # Older gcc versions did not detect bash and re-exec itself, so force 
the
        # use of bash.  Newer ones will auto-detect, but this is not harmful.
        # This needs to be set for compile as well, as it's used in libtool
@@ -1721,6 +1729,17 @@ gcc_do_make() {
                ${GCC_MAKE_TARGET} \
                || die "emake failed with ${GCC_MAKE_TARGET}"
 
+       if is_ada; then
+               # Building standard ada library
+               emake -C gcc gnatlib-shared
+               # Without these links it is not getting the good compiler
+               # Need to check why
+               ln -s gcc ../build/prev-gcc || die
+               ln -s ${CHOST} ../build/prev-${CHOST} || die
+               # Building gnat toold
+               emake -C gcc gnattools
+       fi
+
        if ! is_crosscompile && use_if_iuse cxx && use_if_iuse doc ; then
                if type -p doxygen > /dev/null ; then
                        if tc_version_is_at_least 4.3 ; then

Reply via email to