Re: [gentoo-dev] [PATCH] flag-o-matic.eclass: get rid of eutils in
> On 31 Mar 2021, at 10:09, Ulrich Mueller wrote: > >> On Wed, 31 Mar 2021, Andreas Sturmlechner wrote: > >> setup-allowed-flags() { >> +[[ ${EAPI} == [0-7] ]] || >> +die "Internal function ${FUNCNAME} is not available in >> >=EAPI-8." >> +_setup-allowed-flags >> +} > > Strictly speaking, EAPIs are strings, so numeric comparison is not > meaningful. Suggestion: "... is not available in EAPI ${EAPI}." That’s a reason to not do arithmetic comparison in e.g. Bash, but >= refers to age/chronological order here, which isn’t a problem. > >> test-flag-PROG() { >> +[[ ${EAPI} == [0-7] ]] || >> +die "Internal function ${FUNCNAME} is not available in >> >=EAPI-8." >> +_test-flag-PROG >> +} > >> test-flags-PROG() { >> +[[ ${EAPI} == [0-7] ]] || >> +die "Internal function ${FUNCNAME} is not available in >> >=EAPI-8." >> +_test-flags-PROG >> +} > > Same for these. > > Ulrich signature.asc Description: Message signed with OpenPGP
[gentoo-dev] llvm-libunwind global USE flag
llvm-libunwind - Use sys-libs/llvm-libunwind instead of sys-libs/libunwind This would be similar to graphicsmagick and libressl USE flags. sys-libs/libunwind and sys-libs/llvm-libunwind are ABI-incompatible, at least due to different sonames of libraries. Switching between them requires rebuilding of all reverse dependencies. Example usage: RDEPEND="libunwind? ( llvm-libunwind? ( sys-libs/llvm-libunwind:0= ) !llvm-libunwind? ( sys-libs/libunwind:0= ) )"
Re: [gentoo-dev] [PATCH v2 3/5] flag-o-matic.eclass: get rid of eutils in
> On Thu, 01 Apr 2021, Andreas Sturmlechner wrote: > +# @FUNCTION: test-flag-PROG > +# @USAGE: > +# @INTERNAL > +# @DESCRIPTION: > +# Returns shell true if is supported by given , > +# else returns shell false. > test-flag-PROG() { > + [[ ${EAPI} == [5-7] ]] || > + die "Internal function ${FUNCNAME} is not available in > >=EAPI-8." > + _test-flag-PROG > +} Any reason why this cannot say "... in EAPI ${EAPI}." as I had suggested earlier? (Same for the other patches in the series.) signature.asc Description: PGP signature
Re: [gentoo-dev] [PATCH v2 5/5] flag-o-matic.eclass: get rid of eutils in
On Thu, 01 Apr 2021 12:02:15 +0200 Andreas Sturmlechner wrote: > From af002023d6b8f9a9e51fc31c8c25d48012e35ddf Mon Sep 17 00:00:00 2001 > From: Andreas Sturmlechner > Date: Sun, 28 Mar 2021 15:04:50 +0200 > Subject: [PATCH 5/5] flag-o-matic.eclass: Fix eclassdoc > > Signed-off-by: Andreas Sturmlechner The patch looks good. > --- > eclass/flag-o-matic.eclass | 15 ++- > 1 file changed, 14 insertions(+), 1 deletion(-) > > diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass > index a35f0bef269..6e7582c4643 100644 > --- a/eclass/flag-o-matic.eclass > +++ b/eclass/flag-o-matic.eclass > @@ -21,6 +21,8 @@ case ${EAPI} in > *) die "EAPI ${EAPI} is not supported by flag-o-matic.eclass." ;; > esac > > +# @FUNCTION: all-flag-vars > +# @DESCRIPTION: > # Return all the flag variables that our high level funcs operate on. > all-flag-vars() { > echo {ADA,C,CPP,CXX,CCAS,F,FC,LD}FLAGS > @@ -108,7 +110,10 @@ _setup-allowed-flags() { > ) > } > > -# inverted filters for hardened compiler. This is trying to unpick > +# @FUNCTION: _filter-hardened > +# @INTERNAL > +# @DESCRIPTION: > +# Inverted filters for hardened compiler. This is trying to unpick > # the hardened compiler defaults. > _filter-hardened() { > local f > @@ -142,6 +147,9 @@ _filter-hardened() { > done > } > > +# @FUNCTION: _filter-var > +# @INTERNAL > +# @DESCRIPTION: > # Remove occurrences of strings from variable given in $1 > # Strings removed are matched as globs, so for example > # '-O*' would remove -O1, -O2 etc. > @@ -334,6 +342,11 @@ replace-cpu-flags() { > return 0 > } > > +# @FUNCTION: _is_flagq > +# @USAGE: > +# @INTERNAL > +# @DESCRIPTION: > +# Returns shell true if is in a given , else returns shell > false. > _is_flagq() { > local x var="$1[*]" > for x in ${!var} ; do > -- > 2.31.0 > -- Sergei pgpSdirhDXgag.pgp Description: Цифровая подпись OpenPGP
Re: [gentoo-dev] [PATCH v2 4/5] flag-o-matic.eclass: get rid of eutils in
On Thu, 01 Apr 2021 12:01:24 +0200 Andreas Sturmlechner wrote: > From 797d26ad9fe861c9c332f54a0f856a17af32ee53 Mon Sep 17 00:00:00 2001 > From: Andreas Sturmlechner > Date: Wed, 31 Mar 2021 00:29:55 +0200 > Subject: [PATCH 4/5] flag-o-matic.eclass: Make test-flags-PROG() internal > > Signed-off-by: Andreas Sturmlechner > --- > eclass/flag-o-matic.eclass | 28 +++- > 1 file changed, 23 insertions(+), 5 deletions(-) > > diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass > index e4fdfd0b62d..a35f0bef269 100644 > --- a/eclass/flag-o-matic.eclass > +++ b/eclass/flag-o-matic.eclass > @@ -598,7 +598,25 @@ test-flag-FC() { _test-flag-PROG "FC" f95 "$@"; } > # Returns shell true if is supported by the C compiler and linker, > else returns shell false. > test-flag-CCLD() { _test-flag-PROG "CC" c+ld "$@"; } > > +# @FUNCTION: test-flags-PROG > +# @USAGE: [more flags...] > +# @INTERNAL > +# @DESCRIPTION: > +# Returns shell true if are supported by given , > +# else returns shell false. > test-flags-PROG() { > + [[ ${EAPI} == [5-7] ]] || '[[ ${EAPI} == [567] ]] ||'. Otherwise patch looks ok. > + die "Internal function ${FUNCNAME} is not available in > >=EAPI-8." > + _test-flags-PROG > +} > + > +# @FUNCTION: _test-flags-PROG > +# @USAGE: [more flags...] > +# @INTERNAL > +# @DESCRIPTION: > +# Returns shell true if are supported by given , > +# else returns shell false. > +_test-flags-PROG() { > local comp=$1 > local flags=() > local x > @@ -635,31 +653,31 @@ test-flags-PROG() { > # @USAGE: > # @DESCRIPTION: > # Returns shell true if are supported by the C compiler, else > returns shell false. > -test-flags-CC() { test-flags-PROG "CC" "$@"; } > +test-flags-CC() { _test-flags-PROG "CC" "$@"; } > > # @FUNCTION: test-flags-CXX > # @USAGE: > # @DESCRIPTION: > # Returns shell true if are supported by the C++ compiler, else > returns shell false. > -test-flags-CXX() { test-flags-PROG "CXX" "$@"; } > +test-flags-CXX() { _test-flags-PROG "CXX" "$@"; } > > # @FUNCTION: test-flags-F77 > # @USAGE: > # @DESCRIPTION: > # Returns shell true if are supported by the Fortran 77 compiler, > else returns shell false. > -test-flags-F77() { test-flags-PROG "F77" "$@"; } > +test-flags-F77() { _test-flags-PROG "F77" "$@"; } > > # @FUNCTION: test-flags-FC > # @USAGE: > # @DESCRIPTION: > # Returns shell true if are supported by the Fortran 90 compiler, > else returns shell false. > -test-flags-FC() { test-flags-PROG "FC" "$@"; } > +test-flags-FC() { _test-flags-PROG "FC" "$@"; } > > # @FUNCTION: test-flags-CCLD > # @USAGE: > # @DESCRIPTION: > # Returns shell true if are supported by the C compiler and default > linker, else returns shell false. > -test-flags-CCLD() { test-flags-PROG "CCLD" "$@"; } > +test-flags-CCLD() { _test-flags-PROG "CCLD" "$@"; } > > # @FUNCTION: test-flags > # @USAGE: > -- > 2.31.0 > -- Sergei pgp2FJQCfhNCe.pgp Description: Цифровая подпись OpenPGP
Re: [gentoo-dev] [PATCH v2 3/5] flag-o-matic.eclass: get rid of eutils in
On Thu, 01 Apr 2021 11:59:48 +0200 Andreas Sturmlechner wrote: > From 7b063ec3f4e2a76c43cd5de8a81a0a30c0f87a6d Mon Sep 17 00:00:00 2001 > From: Andreas Sturmlechner > Date: Wed, 31 Mar 2021 00:27:27 +0200 > Subject: [PATCH 3/5] flag-o-matic.eclass: Make test-flag-PROG() internal > > Signed-off-by: Andreas Sturmlechner > --- > eclass/flag-o-matic.eclass | 28 +++- > 1 file changed, 23 insertions(+), 5 deletions(-) > > diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass > index d511a140592..e4fdfd0b62d 100644 > --- a/eclass/flag-o-matic.eclass > +++ b/eclass/flag-o-matic.eclass > @@ -459,7 +459,25 @@ strip-flags() { > return 0 > } > > +# @FUNCTION: test-flag-PROG > +# @USAGE: > +# @INTERNAL > +# @DESCRIPTION: > +# Returns shell true if is supported by given , > +# else returns shell false. > test-flag-PROG() { > + [[ ${EAPI} == [5-7] ]] || > + die "Internal function ${FUNCNAME} is not available in > >=EAPI-8." Yeah. Given that we use tc-get$1 in implementation it's not easy to use as is in external code. Patch is ok. We can consider it later. > + _test-flag-PROG > +} > + > +# @FUNCTION: _test-flag-PROG > +# @USAGE: > +# @INTERNAL > +# @DESCRIPTION: > +# Returns shell true if is supported by given , > +# else returns shell false. > +_test-flag-PROG() { > local comp=$1 > local lang=$2 > shift 2 > @@ -554,31 +572,31 @@ test-flag-PROG() { > # @USAGE: > # @DESCRIPTION: > # Returns shell true if is supported by the C compiler, else returns > shell false. > -test-flag-CC() { test-flag-PROG "CC" c "$@"; } > +test-flag-CC() { _test-flag-PROG "CC" c "$@"; } > > # @FUNCTION: test-flag-CXX > # @USAGE: > # @DESCRIPTION: > # Returns shell true if is supported by the C++ compiler, else > returns shell false. > -test-flag-CXX() { test-flag-PROG "CXX" c++ "$@"; } > +test-flag-CXX() { _test-flag-PROG "CXX" c++ "$@"; } > > # @FUNCTION: test-flag-F77 > # @USAGE: > # @DESCRIPTION: > # Returns shell true if is supported by the Fortran 77 compiler, else > returns shell false. > -test-flag-F77() { test-flag-PROG "F77" f77 "$@"; } > +test-flag-F77() { _test-flag-PROG "F77" f77 "$@"; } > > # @FUNCTION: test-flag-FC > # @USAGE: > # @DESCRIPTION: > # Returns shell true if is supported by the Fortran 90 compiler, else > returns shell false. > -test-flag-FC() { test-flag-PROG "FC" f95 "$@"; } > +test-flag-FC() { _test-flag-PROG "FC" f95 "$@"; } > > # @FUNCTION: test-flag-CCLD > # @USAGE: > # @DESCRIPTION: > # Returns shell true if is supported by the C compiler and linker, > else returns shell false. > -test-flag-CCLD() { test-flag-PROG "CC" c+ld "$@"; } > +test-flag-CCLD() { _test-flag-PROG "CC" c+ld "$@"; } > > test-flags-PROG() { > local comp=$1 > -- > 2.31.0 > -- Sergei pgpfuGQRt2RUi.pgp Description: Цифровая подпись OpenPGP
Re: [gentoo-dev] [PATCH v2 2/5] flag-o-matic.eclass: get rid of eutils in
On Thu, 01 Apr 2021 11:58:07 +0200 Andreas Sturmlechner wrote: > From 6d1c665d06186dde5361905d5fb2057e044b040e Mon Sep 17 00:00:00 2001 > From: Andreas Sturmlechner > Date: Wed, 31 Mar 2021 00:22:12 +0200 > Subject: [PATCH 2/5] flag-o-matic.eclass: Make setup-allowed-flags() internal > > Signed-off-by: Andreas Sturmlechner > --- > eclass/flag-o-matic.eclass | 16 +++- > 1 file changed, 15 insertions(+), 1 deletion(-) > > diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass > index ab79f70392d..d511a140592 100644 > --- a/eclass/flag-o-matic.eclass > +++ b/eclass/flag-o-matic.eclass > @@ -26,9 +26,23 @@ all-flag-vars() { > echo {ADA,C,CPP,CXX,CCAS,F,FC,LD}FLAGS > } > > +# @FUNCTION: setup-allowed-flags > +# @INTERNAL > +# @DESCRIPTION: > # {C,CPP,CXX,CCAS,F,FC,LD}FLAGS that we allow in strip-flags > # Note: shell globs and character lists are allowed > setup-allowed-flags() { > + [[ ${EAPI} == [5-7] ]] || Minor nit: I'd prefer '[[ ${EAPI} == [567] ]]' Otherwise the patch is ok. > + die "Internal function ${FUNCNAME} is not available in > >=EAPI-8." > + _setup-allowed-flags > +} > + > +# @FUNCTION: _setup-allowed-flags > +# @INTERNAL > +# @DESCRIPTION: > +# {C,CPP,CXX,CCAS,F,FC,LD}FLAGS that we allow in strip-flags > +# Note: shell globs and character lists are allowed > +_setup-allowed-flags() { > ALLOWED_FLAGS=( > -pipe -O '-O[12sg]' -mcpu -march -mtune > '-fstack-protector*' '-fsanitize*' '-fstack-check*' > -fno-stack-check > @@ -412,7 +426,7 @@ strip-flags() { > local x y var > > local ALLOWED_FLAGS > - setup-allowed-flags > + _setup-allowed-flags > > set -f # disable pathname expansion > > -- > 2.31.0 > -- Sergei pgpJn1wjBmoDr.pgp Description: Цифровая подпись OpenPGP
Re: [gentoo-dev] [PATCH v2 1/5] flag-o-matic.eclass: get rid of eutils in
On Thu, 01 Apr 2021 11:57:01 +0200 Andreas Sturmlechner wrote: > From 0bdac63ac30fdbe2d1293d0ecbdbc2a5ea673112 Mon Sep 17 00:00:00 2001 > From: Andreas Sturmlechner > Date: Sun, 28 Mar 2021 11:41:32 +0200 > Subject: [PATCH 1/5] flag-o-matic.eclass: SUPPORTED_EAPIS: 5,6,7; drop eutils, > multilib > > - eutils was only used for eqawarn in old EAPI > - multilib usage unknown, but is inherited by toolchain-funcs anyway > > Signed-off-by: Andreas Sturmlechner > --- > eclass/flag-o-matic.eclass | 11 +-- > 1 file changed, 9 insertions(+), 2 deletions(-) > > diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass > index 20ee39d98ba..ab79f70392d 100644 > --- a/eclass/flag-o-matic.eclass > +++ b/eclass/flag-o-matic.eclass > @@ -1,9 +1,10 @@ > -# Copyright 1999-2020 Gentoo Authors > +# Copyright 1999-2021 Gentoo Authors > # Distributed under the terms of the GNU General Public License v2 > > # @ECLASS: flag-o-matic.eclass > # @MAINTAINER: > # toolch...@gentoo.org > +# @SUPPORTED_EAPIS: 5 6 7 > # @BLURB: common functions to manipulate and query toolchain flags > # @DESCRIPTION: > # This eclass contains a suite of functions to help developers sanely > @@ -12,7 +13,13 @@ > if [[ -z ${_FLAG_O_MATIC_ECLASS} ]]; then > _FLAG_O_MATIC_ECLASS=1 > > -inherit eutils toolchain-funcs multilib > +inherit toolchain-funcs > + > +case ${EAPI} in > + [0-4]) die "flag-o-matic.eclass: EAPI ${EAPI} is too old." ;; > + [5-7]) inherit eutils ;; > + *) die "EAPI ${EAPI} is not supported by flag-o-matic.eclass." ;; > +esac Minor nit: I'd prefer more typical '|' style for string enumerations. case ${EAPI:-0} in 0|1|2|3|4) ... 5|6|7) ... Otherwise patch is good. > # Return all the flag variables that our high level funcs operate on. > all-flag-vars() { > -- > 2.31.0 > -- Sergei pgpOTNHgOZnhK.pgp Description: Цифровая подпись OpenPGP
Re: [gentoo-dev] [PATCH] flag-o-matic.eclass: get rid of eutils in
On Mittwoch, 31. März 2021 12:03:33 CEST Wolfgang E. Sanyer wrote: > I'm curious - why the split e.g. test-flag-PROG() and _test-flag-PROG()? Is > this stylistic, or does it serve a functional purpose? (Hah, "functional", > get it? Because they're functions?!? We prepend `_` to signify internal API. The existing function name needs to stay until <=EAPI-7 support is gone in order not to break potential consumers even outside of genoo.git. Regards signature.asc Description: This is a digitally signed message part.
Re: [gentoo-dev] [PATCH v2 5/5] flag-o-matic.eclass: get rid of eutils in
>From af002023d6b8f9a9e51fc31c8c25d48012e35ddf Mon Sep 17 00:00:00 2001 From: Andreas Sturmlechner Date: Sun, 28 Mar 2021 15:04:50 +0200 Subject: [PATCH 5/5] flag-o-matic.eclass: Fix eclassdoc Signed-off-by: Andreas Sturmlechner --- eclass/flag-o-matic.eclass | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass index a35f0bef269..6e7582c4643 100644 --- a/eclass/flag-o-matic.eclass +++ b/eclass/flag-o-matic.eclass @@ -21,6 +21,8 @@ case ${EAPI} in *) die "EAPI ${EAPI} is not supported by flag-o-matic.eclass." ;; esac +# @FUNCTION: all-flag-vars +# @DESCRIPTION: # Return all the flag variables that our high level funcs operate on. all-flag-vars() { echo {ADA,C,CPP,CXX,CCAS,F,FC,LD}FLAGS @@ -108,7 +110,10 @@ _setup-allowed-flags() { ) } -# inverted filters for hardened compiler. This is trying to unpick +# @FUNCTION: _filter-hardened +# @INTERNAL +# @DESCRIPTION: +# Inverted filters for hardened compiler. This is trying to unpick # the hardened compiler defaults. _filter-hardened() { local f @@ -142,6 +147,9 @@ _filter-hardened() { done } +# @FUNCTION: _filter-var +# @INTERNAL +# @DESCRIPTION: # Remove occurrences of strings from variable given in $1 # Strings removed are matched as globs, so for example # '-O*' would remove -O1, -O2 etc. @@ -334,6 +342,11 @@ replace-cpu-flags() { return 0 } +# @FUNCTION: _is_flagq +# @USAGE: +# @INTERNAL +# @DESCRIPTION: +# Returns shell true if is in a given , else returns shell false. _is_flagq() { local x var="$1[*]" for x in ${!var} ; do -- 2.31.0 signature.asc Description: This is a digitally signed message part.
Re: [gentoo-dev] [PATCH v2 4/5] flag-o-matic.eclass: get rid of eutils in
>From 797d26ad9fe861c9c332f54a0f856a17af32ee53 Mon Sep 17 00:00:00 2001 From: Andreas Sturmlechner Date: Wed, 31 Mar 2021 00:29:55 +0200 Subject: [PATCH 4/5] flag-o-matic.eclass: Make test-flags-PROG() internal Signed-off-by: Andreas Sturmlechner --- eclass/flag-o-matic.eclass | 28 +++- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass index e4fdfd0b62d..a35f0bef269 100644 --- a/eclass/flag-o-matic.eclass +++ b/eclass/flag-o-matic.eclass @@ -598,7 +598,25 @@ test-flag-FC() { _test-flag-PROG "FC" f95 "$@"; } # Returns shell true if is supported by the C compiler and linker, else returns shell false. test-flag-CCLD() { _test-flag-PROG "CC" c+ld "$@"; } +# @FUNCTION: test-flags-PROG +# @USAGE: [more flags...] +# @INTERNAL +# @DESCRIPTION: +# Returns shell true if are supported by given , +# else returns shell false. test-flags-PROG() { + [[ ${EAPI} == [5-7] ]] || + die "Internal function ${FUNCNAME} is not available in >=EAPI-8." + _test-flags-PROG +} + +# @FUNCTION: _test-flags-PROG +# @USAGE: [more flags...] +# @INTERNAL +# @DESCRIPTION: +# Returns shell true if are supported by given , +# else returns shell false. +_test-flags-PROG() { local comp=$1 local flags=() local x @@ -635,31 +653,31 @@ test-flags-PROG() { # @USAGE: # @DESCRIPTION: # Returns shell true if are supported by the C compiler, else returns shell false. -test-flags-CC() { test-flags-PROG "CC" "$@"; } +test-flags-CC() { _test-flags-PROG "CC" "$@"; } # @FUNCTION: test-flags-CXX # @USAGE: # @DESCRIPTION: # Returns shell true if are supported by the C++ compiler, else returns shell false. -test-flags-CXX() { test-flags-PROG "CXX" "$@"; } +test-flags-CXX() { _test-flags-PROG "CXX" "$@"; } # @FUNCTION: test-flags-F77 # @USAGE: # @DESCRIPTION: # Returns shell true if are supported by the Fortran 77 compiler, else returns shell false. -test-flags-F77() { test-flags-PROG "F77" "$@"; } +test-flags-F77() { _test-flags-PROG "F77" "$@"; } # @FUNCTION: test-flags-FC # @USAGE: # @DESCRIPTION: # Returns shell true if are supported by the Fortran 90 compiler, else returns shell false. -test-flags-FC() { test-flags-PROG "FC" "$@"; } +test-flags-FC() { _test-flags-PROG "FC" "$@"; } # @FUNCTION: test-flags-CCLD # @USAGE: # @DESCRIPTION: # Returns shell true if are supported by the C compiler and default linker, else returns shell false. -test-flags-CCLD() { test-flags-PROG "CCLD" "$@"; } +test-flags-CCLD() { _test-flags-PROG "CCLD" "$@"; } # @FUNCTION: test-flags # @USAGE: -- 2.31.0 signature.asc Description: This is a digitally signed message part.
Re: [gentoo-dev] [PATCH v2 3/5] flag-o-matic.eclass: get rid of eutils in
>From 7b063ec3f4e2a76c43cd5de8a81a0a30c0f87a6d Mon Sep 17 00:00:00 2001 From: Andreas Sturmlechner Date: Wed, 31 Mar 2021 00:27:27 +0200 Subject: [PATCH 3/5] flag-o-matic.eclass: Make test-flag-PROG() internal Signed-off-by: Andreas Sturmlechner --- eclass/flag-o-matic.eclass | 28 +++- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass index d511a140592..e4fdfd0b62d 100644 --- a/eclass/flag-o-matic.eclass +++ b/eclass/flag-o-matic.eclass @@ -459,7 +459,25 @@ strip-flags() { return 0 } +# @FUNCTION: test-flag-PROG +# @USAGE: +# @INTERNAL +# @DESCRIPTION: +# Returns shell true if is supported by given , +# else returns shell false. test-flag-PROG() { + [[ ${EAPI} == [5-7] ]] || + die "Internal function ${FUNCNAME} is not available in >=EAPI-8." + _test-flag-PROG +} + +# @FUNCTION: _test-flag-PROG +# @USAGE: +# @INTERNAL +# @DESCRIPTION: +# Returns shell true if is supported by given , +# else returns shell false. +_test-flag-PROG() { local comp=$1 local lang=$2 shift 2 @@ -554,31 +572,31 @@ test-flag-PROG() { # @USAGE: # @DESCRIPTION: # Returns shell true if is supported by the C compiler, else returns shell false. -test-flag-CC() { test-flag-PROG "CC" c "$@"; } +test-flag-CC() { _test-flag-PROG "CC" c "$@"; } # @FUNCTION: test-flag-CXX # @USAGE: # @DESCRIPTION: # Returns shell true if is supported by the C++ compiler, else returns shell false. -test-flag-CXX() { test-flag-PROG "CXX" c++ "$@"; } +test-flag-CXX() { _test-flag-PROG "CXX" c++ "$@"; } # @FUNCTION: test-flag-F77 # @USAGE: # @DESCRIPTION: # Returns shell true if is supported by the Fortran 77 compiler, else returns shell false. -test-flag-F77() { test-flag-PROG "F77" f77 "$@"; } +test-flag-F77() { _test-flag-PROG "F77" f77 "$@"; } # @FUNCTION: test-flag-FC # @USAGE: # @DESCRIPTION: # Returns shell true if is supported by the Fortran 90 compiler, else returns shell false. -test-flag-FC() { test-flag-PROG "FC" f95 "$@"; } +test-flag-FC() { _test-flag-PROG "FC" f95 "$@"; } # @FUNCTION: test-flag-CCLD # @USAGE: # @DESCRIPTION: # Returns shell true if is supported by the C compiler and linker, else returns shell false. -test-flag-CCLD() { test-flag-PROG "CC" c+ld "$@"; } +test-flag-CCLD() { _test-flag-PROG "CC" c+ld "$@"; } test-flags-PROG() { local comp=$1 -- 2.31.0 signature.asc Description: This is a digitally signed message part.
Re: [gentoo-dev] [PATCH v2 2/5] flag-o-matic.eclass: get rid of eutils in
>From 6d1c665d06186dde5361905d5fb2057e044b040e Mon Sep 17 00:00:00 2001 From: Andreas Sturmlechner Date: Wed, 31 Mar 2021 00:22:12 +0200 Subject: [PATCH 2/5] flag-o-matic.eclass: Make setup-allowed-flags() internal Signed-off-by: Andreas Sturmlechner --- eclass/flag-o-matic.eclass | 16 +++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass index ab79f70392d..d511a140592 100644 --- a/eclass/flag-o-matic.eclass +++ b/eclass/flag-o-matic.eclass @@ -26,9 +26,23 @@ all-flag-vars() { echo {ADA,C,CPP,CXX,CCAS,F,FC,LD}FLAGS } +# @FUNCTION: setup-allowed-flags +# @INTERNAL +# @DESCRIPTION: # {C,CPP,CXX,CCAS,F,FC,LD}FLAGS that we allow in strip-flags # Note: shell globs and character lists are allowed setup-allowed-flags() { + [[ ${EAPI} == [5-7] ]] || + die "Internal function ${FUNCNAME} is not available in >=EAPI-8." + _setup-allowed-flags +} + +# @FUNCTION: _setup-allowed-flags +# @INTERNAL +# @DESCRIPTION: +# {C,CPP,CXX,CCAS,F,FC,LD}FLAGS that we allow in strip-flags +# Note: shell globs and character lists are allowed +_setup-allowed-flags() { ALLOWED_FLAGS=( -pipe -O '-O[12sg]' -mcpu -march -mtune '-fstack-protector*' '-fsanitize*' '-fstack-check*' -fno-stack-check @@ -412,7 +426,7 @@ strip-flags() { local x y var local ALLOWED_FLAGS - setup-allowed-flags + _setup-allowed-flags set -f # disable pathname expansion -- 2.31.0 signature.asc Description: This is a digitally signed message part.
Re: [gentoo-dev] [PATCH v2 1/5] flag-o-matic.eclass: get rid of eutils in
>From 0bdac63ac30fdbe2d1293d0ecbdbc2a5ea673112 Mon Sep 17 00:00:00 2001 From: Andreas Sturmlechner Date: Sun, 28 Mar 2021 11:41:32 +0200 Subject: [PATCH 1/5] flag-o-matic.eclass: SUPPORTED_EAPIS: 5,6,7; drop eutils, multilib - eutils was only used for eqawarn in old EAPI - multilib usage unknown, but is inherited by toolchain-funcs anyway Signed-off-by: Andreas Sturmlechner --- eclass/flag-o-matic.eclass | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass index 20ee39d98ba..ab79f70392d 100644 --- a/eclass/flag-o-matic.eclass +++ b/eclass/flag-o-matic.eclass @@ -1,9 +1,10 @@ -# Copyright 1999-2020 Gentoo Authors +# Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: flag-o-matic.eclass # @MAINTAINER: # toolch...@gentoo.org +# @SUPPORTED_EAPIS: 5 6 7 # @BLURB: common functions to manipulate and query toolchain flags # @DESCRIPTION: # This eclass contains a suite of functions to help developers sanely @@ -12,7 +13,13 @@ if [[ -z ${_FLAG_O_MATIC_ECLASS} ]]; then _FLAG_O_MATIC_ECLASS=1 -inherit eutils toolchain-funcs multilib +inherit toolchain-funcs + +case ${EAPI} in + [0-4]) die "flag-o-matic.eclass: EAPI ${EAPI} is too old." ;; + [5-7]) inherit eutils ;; + *) die "EAPI ${EAPI} is not supported by flag-o-matic.eclass." ;; +esac # Return all the flag variables that our high level funcs operate on. all-flag-vars() { -- 2.31.0 signature.asc Description: This is a digitally signed message part.