From: Andreas Sturmlechner <asturm@gentoo.org>
To: gentoo-dev@lists.gentoo.org, Sergei Trofimovich <slyfox@gentoo.org>
Subject: Re: [gentoo-dev] [PATCH v2 4/5] flag-o-matic.eclass: get rid of eutils in <EAPI-8, fix eclassdoc, make some funcs internal
Date: Thu, 01 Apr 2021 12:01:24 +0200 [thread overview]
Message-ID: <6603455.9J7NaK4W3v@tuxbook> (raw)
In-Reply-To: <3350735.dWV9SEqChM@tuxbook>
[-- Attachment #1: Type: text/plain, Size: 2821 bytes --]
From 797d26ad9fe861c9c332f54a0f856a17af32ee53 Mon Sep 17 00:00:00 2001
From: Andreas Sturmlechner <asturm@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 <asturm@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
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 618 bytes --]
next prev parent reply other threads:[~2021-04-01 10:01 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-31 6:39 [gentoo-dev] [PATCH] flag-o-matic.eclass: get rid of eutils in <EAPI-8, fix eclassdoc, make some funcs internal Andreas Sturmlechner
2021-03-31 7:33 ` Sergei Trofimovich
2021-03-31 7:45 ` Andreas Sturmlechner
2021-03-31 9:13 ` Sergei Trofimovich
2021-03-31 10:03 ` Wolfgang E. Sanyer
2021-04-01 13:42 ` Andreas Sturmlechner
2021-04-01 9:57 ` [gentoo-dev] [PATCH v2 1/5] " Andreas Sturmlechner
2021-04-01 9:58 ` [gentoo-dev] [PATCH v2 2/5] " Andreas Sturmlechner
2021-04-01 9:59 ` [gentoo-dev] [PATCH v2 3/5] " Andreas Sturmlechner
2021-04-01 10:01 ` Andreas Sturmlechner [this message]
2021-04-01 10:02 ` [gentoo-dev] [PATCH v2 5/5] " Andreas Sturmlechner
2021-04-01 18:40 ` Sergei Trofimovich
2021-04-01 18:39 ` [gentoo-dev] [PATCH v2 4/5] " Sergei Trofimovich
2021-04-01 18:37 ` [gentoo-dev] [PATCH v2 3/5] " Sergei Trofimovich
2021-04-01 21:42 ` Ulrich Mueller
2021-04-02 9:49 ` Andreas Sturmlechner
2021-04-01 18:30 ` [gentoo-dev] [PATCH v2 2/5] " Sergei Trofimovich
2021-04-01 18:26 ` [gentoo-dev] [PATCH v2 1/5] " Sergei Trofimovich
2021-03-31 7:36 ` [gentoo-dev] [PATCH] " Sam James
2021-03-31 9:09 ` Ulrich Mueller
2021-04-01 21:57 ` Sam James
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6603455.9J7NaK4W3v@tuxbook \
--to=asturm@gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
--cc=slyfox@gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox