From bebf48f48763ad6966a702f24bdabf225448cc98 Mon Sep 17 00:00:00 2001 From: Andreas Sturmlechner Date: Sun, 11 Apr 2021 22:37:12 +0200 Subject: flag-o-matic.eclass: Make test-flags-PROG() internal Signed-off-by: Andreas Sturmlechner Signed-off-by: Sam James --- eclass/flag-o-matic.eclass | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) (limited to 'eclass/flag-o-matic.eclass') diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass index 378ff0877400..0d2760d686f2 100644 --- a/eclass/flag-o-matic.eclass +++ b/eclass/flag-o-matic.eclass @@ -600,7 +600,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} == [567] ]] || + die "Internal function ${FUNCNAME} is not available in EAPI ${EAPI}." + _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 @@ -637,31 +655,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: -- cgit v1.2.3-65-gdbad