Gentoo Archives: gentoo-dev

From: Sergei Trofimovich <slyfox@g.o>
To: Andreas Sturmlechner <asturm@g.o>
Cc: gentoo-dev@l.g.o
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 18:39:15
Message-Id: 20210401193907.51de270c@sf
In Reply to: Re: [gentoo-dev] [PATCH v2 4/5] flag-o-matic.eclass: get rid of eutils in by Andreas Sturmlechner
1 On Thu, 01 Apr 2021 12:01:24 +0200
2 Andreas Sturmlechner <asturm@g.o> wrote:
3
4 > From 797d26ad9fe861c9c332f54a0f856a17af32ee53 Mon Sep 17 00:00:00 2001
5 > From: Andreas Sturmlechner <asturm@g.o>
6 > Date: Wed, 31 Mar 2021 00:29:55 +0200
7 > Subject: [PATCH 4/5] flag-o-matic.eclass: Make test-flags-PROG() internal
8 >
9 > Signed-off-by: Andreas Sturmlechner <asturm@g.o>
10 > ---
11 > eclass/flag-o-matic.eclass | 28 +++++++++++++++++++++++-----
12 > 1 file changed, 23 insertions(+), 5 deletions(-)
13 >
14 > diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass
15 > index e4fdfd0b62d..a35f0bef269 100644
16 > --- a/eclass/flag-o-matic.eclass
17 > +++ b/eclass/flag-o-matic.eclass
18 > @@ -598,7 +598,25 @@ test-flag-FC() { _test-flag-PROG "FC" f95 "$@"; }
19 > # Returns shell true if <flag> is supported by the C compiler and linker, else returns shell false.
20 > test-flag-CCLD() { _test-flag-PROG "CC" c+ld "$@"; }
21 >
22 > +# @FUNCTION: test-flags-PROG
23 > +# @USAGE: <compiler> <flag> [more flags...]
24 > +# @INTERNAL
25 > +# @DESCRIPTION:
26 > +# Returns shell true if <flags> are supported by given <compiler>,
27 > +# else returns shell false.
28 > test-flags-PROG() {
29 > + [[ ${EAPI} == [5-7] ]] ||
30
31 '[[ ${EAPI} == [567] ]] ||'. Otherwise patch looks ok.
32
33 > + die "Internal function ${FUNCNAME} is not available in >=EAPI-8."
34 > + _test-flags-PROG
35 > +}
36 > +
37 > +# @FUNCTION: _test-flags-PROG
38 > +# @USAGE: <compiler> <flag> [more flags...]
39 > +# @INTERNAL
40 > +# @DESCRIPTION:
41 > +# Returns shell true if <flags> are supported by given <compiler>,
42 > +# else returns shell false.
43 > +_test-flags-PROG() {
44 > local comp=$1
45 > local flags=()
46 > local x
47 > @@ -635,31 +653,31 @@ test-flags-PROG() {
48 > # @USAGE: <flags>
49 > # @DESCRIPTION:
50 > # Returns shell true if <flags> are supported by the C compiler, else returns shell false.
51 > -test-flags-CC() { test-flags-PROG "CC" "$@"; }
52 > +test-flags-CC() { _test-flags-PROG "CC" "$@"; }
53 >
54 > # @FUNCTION: test-flags-CXX
55 > # @USAGE: <flags>
56 > # @DESCRIPTION:
57 > # Returns shell true if <flags> are supported by the C++ compiler, else returns shell false.
58 > -test-flags-CXX() { test-flags-PROG "CXX" "$@"; }
59 > +test-flags-CXX() { _test-flags-PROG "CXX" "$@"; }
60 >
61 > # @FUNCTION: test-flags-F77
62 > # @USAGE: <flags>
63 > # @DESCRIPTION:
64 > # Returns shell true if <flags> are supported by the Fortran 77 compiler, else returns shell false.
65 > -test-flags-F77() { test-flags-PROG "F77" "$@"; }
66 > +test-flags-F77() { _test-flags-PROG "F77" "$@"; }
67 >
68 > # @FUNCTION: test-flags-FC
69 > # @USAGE: <flags>
70 > # @DESCRIPTION:
71 > # Returns shell true if <flags> are supported by the Fortran 90 compiler, else returns shell false.
72 > -test-flags-FC() { test-flags-PROG "FC" "$@"; }
73 > +test-flags-FC() { _test-flags-PROG "FC" "$@"; }
74 >
75 > # @FUNCTION: test-flags-CCLD
76 > # @USAGE: <flags>
77 > # @DESCRIPTION:
78 > # Returns shell true if <flags> are supported by the C compiler and default linker, else returns shell false.
79 > -test-flags-CCLD() { test-flags-PROG "CCLD" "$@"; }
80 > +test-flags-CCLD() { _test-flags-PROG "CCLD" "$@"; }
81 >
82 > # @FUNCTION: test-flags
83 > # @USAGE: <flags>
84 > --
85 > 2.31.0
86 >
87
88
89 --
90
91 Sergei