Mailing List Archive

[PATCH 2/3] To build ada we need a c++ compiler too
Signed-off-by: Alfredo Tupone <tupone@gentoo.org>
---
eclass/toolchain.eclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index fd820f60f45d..f8e06fa39884 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -2495,31 +2495,31 @@ should_we_gcc_config() {
#
# Also add a hook so special ebuilds (kgcc64) can control which languages
# exactly get enabled
gcc-lang-supported() {
grep ^language=\"${1}\" "${S}"/gcc/*/config-lang.in > /dev/null || return 1
[[ -z ${TOOLCHAIN_ALLOWED_LANGS} ]] && return 0
has $1 ${TOOLCHAIN_ALLOWED_LANGS}
}

_tc_use_if_iuse() {
in_iuse $1 && use $1
}

is_ada() {
gcc-lang-supported ada || return 1
- _tc_use_if_iuse ada
+ _tc_use_if_iuse cxx && _tc_use_if_iuse ada
}

is_cxx() {
gcc-lang-supported 'c++' || return 1
_tc_use_if_iuse cxx
}

is_d() {
gcc-lang-supported d || return 1
_tc_use_if_iuse d
}

is_f77() {
gcc-lang-supported f77 || return 1
_tc_use_if_iuse fortran
--
2.43.2
Re: [PATCH 2/3] To build ada we need a c++ compiler too [ In reply to ]
Hi,

Alfredo Tupone <tupone@gentoo.org> writes:

> Signed-off-by: Alfredo Tupone <tupone@gentoo.org>
> ---
> eclass/toolchain.eclass | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
> index fd820f60f45d..f8e06fa39884 100644
> --- a/eclass/toolchain.eclass
> +++ b/eclass/toolchain.eclass
> @@ -2495,31 +2495,31 @@ should_we_gcc_config() {
> #
> # Also add a hook so special ebuilds (kgcc64) can control which languages
> # exactly get enabled
> gcc-lang-supported() {
> grep ^language=\"${1}\" "${S}"/gcc/*/config-lang.in > /dev/null || return 1
> [[ -z ${TOOLCHAIN_ALLOWED_LANGS} ]] && return 0
> has $1 ${TOOLCHAIN_ALLOWED_LANGS}
> }
>
> _tc_use_if_iuse() {
> in_iuse $1 && use $1
> }
>
> is_ada() {
> gcc-lang-supported ada || return 1
> - _tc_use_if_iuse ada
> + _tc_use_if_iuse cxx && _tc_use_if_iuse ada

Is this redundant? Would gcc-lang-supported c++ (called through the ada
support check) not suffice?

> }
>
> is_cxx() {
> gcc-lang-supported 'c++' || return 1
> _tc_use_if_iuse cxx
> }
>
> is_d() {
> gcc-lang-supported d || return 1
> _tc_use_if_iuse d
> }
>
> is_f77() {
> gcc-lang-supported f77 || return 1
> _tc_use_if_iuse fortran

--
Arsen Arsenovi?
Re: [PATCH 2/3] To build ada we need a c++ compiler too [ In reply to ]
On Fri, 26 Apr 2024 10:29:43 +0200
Arsen Arsenovi? <arsen@gentoo.org> wrote:

> > is_ada() {
> > gcc-lang-supported ada || return 1
> > - _tc_use_if_iuse ada
> > + _tc_use_if_iuse cxx && _tc_use_if_iuse ada
>
> Is this redundant? Would gcc-lang-supported c++ (called through the
> ada support check) not suffice?

From what I understand this test is checking that both USE=cxx and
USE=ada are enabled, and both cxx and ada are supported by gcc.

If not, gcc is built without the ada compiler
Re: Re: [PATCH 2/3] To build ada we need a c++ compiler too [ In reply to ]
Alfredo Tupone <tupone@gentoo.org> writes:

> On Fri, 26 Apr 2024 10:29:43 +0200
> Arsen Arsenovi? <arsen@gentoo.org> wrote:
>
>> > is_ada() {
>> > gcc-lang-supported ada || return 1
>> > - _tc_use_if_iuse ada
>> > + _tc_use_if_iuse cxx && _tc_use_if_iuse ada
>>
>> Is this redundant? Would gcc-lang-supported c++ (called through the
>> ada support check) not suffice?
>
> From what I understand this test is checking that both USE=cxx and
> USE=ada are enabled, and both cxx and ada are supported by gcc.
>
> If not, gcc is built without the ada compiler

It's fine with me if you commit these, just please add detail to the
commit messages first. Thanks.