On Thu, 01 Apr 2021 11:59:48 +0200
Andreas Sturmlechner <ast...@gentoo.org> wrote:

> From 7b063ec3f4e2a76c43cd5de8a81a0a30c0f87a6d Mon Sep 17 00:00:00 2001
> From: Andreas Sturmlechner <ast...@gentoo.org>
> 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 <ast...@gentoo.org>
> ---
>  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: <compiler> <flag>
> +# @INTERNAL
> +# @DESCRIPTION:
> +# Returns shell true if <flag> is supported by given <compiler>,
> +# 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: <compiler> <flag>
> +# @INTERNAL
> +# @DESCRIPTION:
> +# Returns shell true if <flag> is supported by given <compiler>,
> +# else returns shell false.
> +_test-flag-PROG() {
>       local comp=$1
>       local lang=$2
>       shift 2
> @@ -554,31 +572,31 @@ test-flag-PROG() {
>  # @USAGE: <flag>
>  # @DESCRIPTION:
>  # Returns shell true if <flag> 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: <flag>
>  # @DESCRIPTION:
>  # Returns shell true if <flag> 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: <flag>
>  # @DESCRIPTION:
>  # Returns shell true if <flag> 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: <flag>
>  # @DESCRIPTION:
>  # Returns shell true if <flag> 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: <flag>
>  # @DESCRIPTION:
>  # Returns shell true if <flag> 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

Attachment: pgpfuGQRt2RUi.pgp
Description: Цифровая подпись OpenPGP

Reply via email to