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