Gentoo Archives: gentoo-commits

From: Andrew Savchenko <bircoph@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Sat, 17 Nov 2018 11:30:31
Message-Id: 1542454096.2e27acb704c15f3c83ae6590a5a8cb3d0d6a8cb5.bircoph@gentoo
1 commit: 2e27acb704c15f3c83ae6590a5a8cb3d0d6a8cb5
2 Author: Andrew Savchenko <bircoph <AT> gentoo <DOT> org>
3 AuthorDate: Sat Nov 17 11:28:16 2018 +0000
4 Commit: Andrew Savchenko <bircoph <AT> gentoo <DOT> org>
5 CommitDate: Sat Nov 17 11:28:16 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2e27acb7
7
8 fortran-2.eclass: cleanup and improvements
9
10 Fix problems in the eclass found during EAPI 7 support review, but
11 unrelated to the EAPI 7 update. Thanks all reviewes for their work.
12
13 Signed-off-by: Andrew Savchenko <bircoph <AT> gentoo.org>
14
15 eclass/fortran-2.eclass | 22 +++++++++++-----------
16 1 file changed, 11 insertions(+), 11 deletions(-)
17
18 diff --git a/eclass/fortran-2.eclass b/eclass/fortran-2.eclass
19 index 4b405ee5c18..b871d16e3e0 100644
20 --- a/eclass/fortran-2.eclass
21 +++ b/eclass/fortran-2.eclass
22 @@ -1,4 +1,4 @@
23 -# Copyright 1999-2017 Gentoo Foundation
24 +# Copyright 1999-2018 Gentoo Authors
25 # Distributed under the terms of the GNU General Public License v2
26
27 # @ECLASS: fortran-2.eclass
28 @@ -95,7 +95,7 @@ unset _f_use
29 fortran_int64_abi_fflags() {
30 debug-print-function ${FUNCNAME} "${@}"
31
32 - _FC=$(tc-getFC)
33 + local _FC=$(tc-getFC)
34 if [[ ${_FC} == *gfortran* ]]; then
35 echo "-fdefault-integer-8"
36 elif [[ ${_FC} == ifort ]]; then
37 @@ -115,17 +115,17 @@ _fortran_write_testsuite() {
38 local filebase=${T}/test-fortran
39
40 # f77 code
41 - cat <<- EOF > "${filebase}.f"
42 + cat <<- EOF > "${filebase}.f" || die
43 end
44 EOF
45
46 # f90/95 code
47 - cat <<- EOF > "${filebase}.f90"
48 + cat <<- EOF > "${filebase}.f90" || die
49 end
50 EOF
51
52 # f2003 code
53 - cat <<- EOF > "${filebase}.f03"
54 + cat <<- EOF > "${filebase}.f03" || die
55 procedure(), pointer :: p
56 end
57 EOF
58 @@ -173,7 +173,7 @@ _fortran-has-openmp() {
59 local ret
60 local _fc=$(tc-getFC)
61
62 - cat <<- EOF > "${fcode}"
63 + cat <<- EOF > "${fcode}" || die
64 call omp_get_num_threads
65 end
66 EOF
67 @@ -182,7 +182,7 @@ _fortran-has-openmp() {
68 ${_fc} ${flag} "${fcode}" -o "${fcode}.x" \
69 &>> "${T}"/_fortran_compile_test.log
70 ret=$?
71 - (( ${ret} )) || break
72 + [[ ${ret} == 0 ]] && break
73 done
74
75 rm -f "${fcode}.x"
76 @@ -196,12 +196,12 @@ _fortran-has-openmp() {
77 _fortran_die_msg() {
78 debug-print-function ${FUNCNAME} "${@}"
79
80 - echo
81 + eerror
82 eerror "Please install currently selected gcc version with USE=fortran."
83 eerror "If you intend to use a different compiler then gfortran, please"
84 eerror "set FC variable accordingly and take care that the necessary"
85 eerror "fortran dialects are supported."
86 - echo
87 + eerror
88 die "Currently no working fortran compiler is available (see ${T}/_fortran_compile_test.log for information)"
89 }
90
91 @@ -253,7 +253,7 @@ _fortran-2_pkg_setup() {
92 for _f_use in ${FORTRAN_NEEDED}; do
93 case ${_f_use} in
94 always)
95 - _fortran_test_function && break
96 + _fortran_test_function && break 2
97 ;;
98 no)
99 einfo "Forcing fortran support off"
100 @@ -261,7 +261,7 @@ _fortran-2_pkg_setup() {
101 ;;
102 *)
103 if use ${_f_use}; then
104 - _fortran_test_function && break
105 + _fortran_test_function && break 2
106 else
107 unset FC
108 unset F77