Gentoo Archives: gentoo-dev

From: Tupone Alfredo <tupone@g.o>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] [PATCH] enable build of gnat compiler in the toolchain eclass
Date: Fri, 03 Apr 2020 06:27:59
Message-Id: 20200403062535.29851-1-tupone@gentoo.org
1 ---
2 eclass/toolchain.eclass | 25 ++++++++++++++++++++++---
3 1 file changed, 22 insertions(+), 3 deletions(-)
4
5 diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
6 index ee466ee4d904..b003dc20cc5a 100644
7 --- a/eclass/toolchain.eclass
8 +++ b/eclass/toolchain.eclass
9 @@ -184,7 +184,7 @@ if [[ ${PN} != "kgcc64" && ${PN} != gcc-* ]] ; then
10 tc_version_is_at_least 6.5 &&
11 IUSE+=" graphite" TC_FEATURES+=(graphite)
12 tc_version_is_between 4.9 8 && IUSE+=" cilk"
13 - tc_version_is_at_least 4.9 && IUSE+=" +vtv"
14 + tc_version_is_at_least 4.9 && IUSE+=" ada +vtv"
15 tc_version_is_at_least 5.0 && IUSE+=" jit"
16 tc_version_is_between 5.0 9 && IUSE+=" mpx"
17 tc_version_is_at_least 6.0 && IUSE+=" +pie +ssp +pch"
18 @@ -909,8 +909,7 @@ toolchain_src_configure() {
19 is_f77 && GCC_LANG+=",f77"
20 is_f95 && GCC_LANG+=",f95"
21
22 - # We do NOT want 'ADA support' in here!
23 - # is_ada && GCC_LANG+=",ada"
24 + is_ada && GCC_LANG+=",ada"
25
26 confgcc+=( --enable-languages=${GCC_LANG} )
27
28 @@ -1270,6 +1269,10 @@ toolchain_src_configure() {
29 fi
30 fi
31
32 + if in_iuse ada ; then
33 + confgcc+=( --disable-libada )
34 + fi
35 +
36 if in_iuse cilk ; then
37 confgcc+=( $(use_enable cilk libcilkrts) )
38 fi
39 @@ -1663,6 +1666,11 @@ toolchain_src_compile() {
40 [[ ! -x /usr/bin/perl ]] \
41 && find "${WORKDIR}"/build -name '*.[17]' -exec touch {} +
42
43 + # To compile ada library standard files special compiler options are passed
44 + # via ADAFLAGS in the Makefile.
45 + # Unset ADAFLAGS as setting this override the options
46 + unset ADAFLAGS
47 +
48 # Older gcc versions did not detect bash and re-exec itself, so force the
49 # use of bash. Newer ones will auto-detect, but this is not harmful.
50 # This needs to be set for compile as well, as it's used in libtool
51 @@ -1731,6 +1739,17 @@ gcc_do_make() {
52 ${GCC_MAKE_TARGET} \
53 || die "emake failed with ${GCC_MAKE_TARGET}"
54
55 + if is_ada; then
56 + # Building standard ada library
57 + emake -C gcc gnatlib-shared
58 + # Without these links it is not getting the good compiler
59 + # Need to check why
60 + ln -s gcc ../build/prev-gcc || die
61 + ln -s ${CHOST} ../build/prev-${CHOST} || die
62 + # Building gnat toold
63 + emake -C gcc gnattools
64 + fi
65 +
66 if ! is_crosscompile && use_if_iuse cxx && use_if_iuse doc ; then
67 if type -p doxygen > /dev/null ; then
68 if tc_version_is_at_least 4.3 ; then
69 --
70 2.24.1

Replies