>From 797d26ad9fe861c9c332f54a0f856a17af32ee53 Mon Sep 17 00:00:00 2001 From: Andreas Sturmlechner <ast...@gentoo.org> 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 <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 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 <flag> 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: <compiler> <flag> [more flags...] +# @INTERNAL +# @DESCRIPTION: +# Returns shell true if <flags> are supported by given <compiler>, +# 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: <compiler> <flag> [more flags...] +# @INTERNAL +# @DESCRIPTION: +# Returns shell true if <flags> are supported by given <compiler>, +# else returns shell false. +_test-flags-PROG() { local comp=$1 local flags=() local x @@ -635,31 +653,31 @@ test-flags-PROG() { # @USAGE: <flags> # @DESCRIPTION: # Returns shell true if <flags> 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: <flags> # @DESCRIPTION: # Returns shell true if <flags> 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: <flags> # @DESCRIPTION: # Returns shell true if <flags> 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: <flags> # @DESCRIPTION: # Returns shell true if <flags> 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: <flags> # @DESCRIPTION: # Returns shell true if <flags> 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: <flags> -- 2.31.0
signature.asc
Description: This is a digitally signed message part.