Gentoo Archives: gentoo-dev

From: Andrew Savchenko <bircoph@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [PATCH v3 2/2] fortran-2.eclass: support EAPI 7
Date: Mon, 05 Nov 2018 15:39:41
Message-Id: 20181105183755.49d349a86277e17613e0da4a@gentoo.org
In Reply to: Re: [gentoo-dev] [PATCH v2] fortran-2.eclass: support EAPI 7 by Andrew Savchenko
1 Hi all!
2
3 Here follow updated patches for fortran-2.eclass EAPI 7 update.
4
5 Patch 2 contains only code cleanup and fixes unrelated to EAPI 7
6 update:
7
8 diff --git a/eclass/fortran-2.eclass b/eclass/fortran-2.eclass
9 index 820cbbcb49bd..b871d16e3e05 100644
10 --- a/eclass/fortran-2.eclass
11 +++ b/eclass/fortran-2.eclass
12 @@ -1,4 +1,4 @@
13 -# Copyright 1999-2017 Gentoo Foundation
14 +# Copyright 1999-2018 Gentoo Authors
15 # Distributed under the terms of the GNU General Public License v2
16
17 # @ECLASS: fortran-2.eclass
18 @@ -92,7 +95,7 @@ unset _f_use
19 fortran_int64_abi_fflags() {
20 debug-print-function ${FUNCNAME} "${@}"
21
22 - _FC=$(tc-getFC)
23 + local _FC=$(tc-getFC)
24 if [[ ${_FC} == *gfortran* ]]; then
25 echo "-fdefault-integer-8"
26 elif [[ ${_FC} == ifort ]]; then
27 @@ -112,17 +115,17 @@ _fortran_write_testsuite() {
28 local filebase=${T}/test-fortran
29
30 # f77 code
31 - cat <<- EOF > "${filebase}.f"
32 + cat <<- EOF > "${filebase}.f" || die
33 end
34 EOF
35
36 # f90/95 code
37 - cat <<- EOF > "${filebase}.f90"
38 + cat <<- EOF > "${filebase}.f90" || die
39 end
40 EOF
41
42 # f2003 code
43 - cat <<- EOF > "${filebase}.f03"
44 + cat <<- EOF > "${filebase}.f03" || die
45 procedure(), pointer :: p
46 end
47 EOF
48 @@ -170,7 +173,7 @@ _fortran-has-openmp() {
49 local ret
50 local _fc=$(tc-getFC)
51
52 - cat <<- EOF > "${fcode}"
53 + cat <<- EOF > "${fcode}" || die
54 call omp_get_num_threads
55 end
56 EOF
57 @@ -179,7 +182,7 @@ _fortran-has-openmp() {
58 ${_fc} ${flag} "${fcode}" -o "${fcode}.x" \
59 &>> "${T}"/_fortran_compile_test.log
60 ret=$?
61 - (( ${ret} )) || break
62 + [[ ${ret} == 0 ]] && break
63 done
64
65 rm -f "${fcode}.x"
66 @@ -193,12 +196,12 @@ _fortran-has-openmp() {
67 _fortran_die_msg() {
68 debug-print-function ${FUNCNAME} "${@}"
69
70 - echo
71 + eerror
72 eerror "Please install currently selected gcc version with USE=fortran."
73 eerror "If you intend to use a different compiler then gfortran, please"
74 eerror "set FC variable accordingly and take care that the necessary"
75 eerror "fortran dialects are supported."
76 - echo
77 + eerror
78 die "Currently no working fortran compiler is available (see ${T}/_fortran_compile_test.log for information)"
79 }
80
81 @@ -250,7 +253,7 @@ _fortran-2_pkg_setup() {
82 for _f_use in ${FORTRAN_NEEDED}; do
83 case ${_f_use} in
84 always)
85 - _fortran_test_function && break
86 + _fortran_test_function && break 2
87 ;;
88 no)
89 einfo "Forcing fortran support off"
90 @@ -258,7 +261,7 @@ _fortran-2_pkg_setup() {
91 ;;
92 *)
93 if use ${_f_use}; then
94 - _fortran_test_function && break
95 + _fortran_test_function && break 2
96 else
97 unset FC
98 unset F77
99
100
101 Best regards,
102 Andrew Savchenko

Replies

Subject Author
Re: [gentoo-dev] [PATCH v3 2/2] fortran-2.eclass: support EAPI 7 Andrew Savchenko <bircoph@g.o>