From c24ac2d8ddb273e640b43ca0af9b83e0ccf499a9 Mon Sep 17 00:00:00 2001 From: Andreas Sturmlechner Date: Sun, 11 Apr 2021 22:37:10 +0200 Subject: flag-o-matic.eclass: Make test-flag-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 8357050193bd..378ff0877400 100644 --- a/eclass/flag-o-matic.eclass +++ b/eclass/flag-o-matic.eclass @@ -461,7 +461,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} == [567] ]] || + die "Internal function ${FUNCNAME} is not available in EAPI ${EAPI}." + _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 @@ -556,31 +574,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 -- cgit v1.2.3-65-gdbad