Gentoo Archives: gentoo-commits

From: "Justin Lecher (jlec)" <jlec@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in eclass: ChangeLog fortran-2.eclass
Date: Wed, 28 Nov 2012 13:03:41
Message-Id: 20121128130330.C01B320C65@flycatcher.gentoo.org
1 jlec 12/11/28 13:03:30
2
3 Modified: ChangeLog fortran-2.eclass
4 Log:
5 * Reduce potential clash of function names in global scope
6 * Use more manpage tags
7 * resort phase functions to the end
8 * require at least arguments for _fortran_compile_test()
9 * log compile tests
10
11 Revision Changes Path
12 1.528 eclass/ChangeLog
13
14 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.528&view=markup
15 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.528&content-type=text/plain
16 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?r1=1.527&r2=1.528
17
18 Index: ChangeLog
19 ===================================================================
20 RCS file: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v
21 retrieving revision 1.527
22 retrieving revision 1.528
23 diff -u -r1.527 -r1.528
24 --- ChangeLog 28 Nov 2012 12:11:51 -0000 1.527
25 +++ ChangeLog 28 Nov 2012 13:03:30 -0000 1.528
26 @@ -1,6 +1,13 @@
27 # ChangeLog for eclass directory
28 # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
29 -# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.527 2012/11/28 12:11:51 jlec Exp $
30 +# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.528 2012/11/28 13:03:30 jlec Exp $
31 +
32 + 28 Nov 2012; Justin Lecher <jlec@g.o> fortran-2.eclass:
33 + * Reduce potential clash of function names in global scope
34 + * Use more manpage tags
35 + * resort phase functions to the end
36 + * require at least arguments for _fortran_compile_test()
37 + * log compile tests
38
39 28 Nov 2012; Justin Lecher <jlec@g.o> fortran-2.eclass:
40 Use man page tags
41
42
43
44 1.16 eclass/fortran-2.eclass
45
46 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/fortran-2.eclass?rev=1.16&view=markup
47 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/fortran-2.eclass?rev=1.16&content-type=text/plain
48 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/fortran-2.eclass?r1=1.15&r2=1.16
49
50 Index: fortran-2.eclass
51 ===================================================================
52 RCS file: /var/cvsroot/gentoo-x86/eclass/fortran-2.eclass,v
53 retrieving revision 1.15
54 retrieving revision 1.16
55 diff -u -r1.15 -r1.16
56 --- fortran-2.eclass 28 Nov 2012 12:11:51 -0000 1.15
57 +++ fortran-2.eclass 28 Nov 2012 13:03:30 -0000 1.16
58 @@ -1,6 +1,6 @@
59 # Copyright 1999-2012 Gentoo Foundation
60 # Distributed under the terms of the GNU General Public License v2
61 -# $Header: /var/cvsroot/gentoo-x86/eclass/fortran-2.eclass,v 1.15 2012/11/28 12:11:51 jlec Exp $
62 +# $Header: /var/cvsroot/gentoo-x86/eclass/fortran-2.eclass,v 1.16 2012/11/28 13:03:30 jlec Exp $
63
64 # @ECLASS: fortran-2.eclass
65 # @MAINTAINER:
66 @@ -72,11 +72,11 @@
67 done
68 RDEPEND="${DEPEND}"
69
70 -# @FUNCTION: _write_testsuite
71 +# @FUNCTION: _fortran_write_testsuite
72 # @INTERNAL
73 # @DESCRIPTION:
74 # writes fortran test code
75 -_write_testsuite() {
76 +_fortran_write_testsuite() {
77 local filebase=${T}/test-fortran
78
79 # f77 code
80 @@ -96,23 +96,24 @@
81 EOF
82 }
83
84 -# @FUNCTION: _compile_test
85 +# @FUNCTION: _fortran_compile_test
86 +# @USAGE: <compiler> [dialect]
87 # @INTERNAL
88 # @DESCRIPTION:
89 # Takes fortran compiler as first argument and dialect as second.
90 # Checks whether the passed fortran compiler speaks the fortran dialect
91 -_compile_test() {
92 +_fortran_compile_test() {
93 local filebase=${T}/test-fortran
94 local fcomp=${1}
95 local fdia=${2}
96 local fcode=${filebase}.f${fdia}
97 local ret
98
99 - [[ $# -eq 0 ]] && die "_compile_test() needs at least one argument"
100 + [[ $# -lt 1 ]] && die "_fortran_compile_test() needs at least one arguments"
101
102 - [[ -f ${fcode} ]] || _write_testsuite
103 + [[ -f ${fcode} ]] || _fortran_write_testsuite
104
105 - ${fcomp} "${fcode}" -o "${fcode}.x" >&/dev/null
106 + ${fcomp} "${fcode}" -o "${fcode}.x" &>> "${T}"/_fortran_compile_test.log
107 ret=$?
108
109 rm -f "${fcode}.x"
110 @@ -120,6 +121,7 @@
111 }
112
113 # @FUNCTION: _fortran-has-openmp
114 +# @RETURN: compilers return value
115 # @INTERNAL
116 # @DESCRIPTION:
117 # See if the fortran supports OpenMP.
118 @@ -136,7 +138,7 @@
119 EOF
120
121 for flag in -fopenmp -xopenmp -openmp -mp -omp -qsmp=omp; do
122 - ${_fc} ${flag} "${fcode}" -o "${fcode}.x" >&/dev/null
123 + ${_fc} ${flag} "${fcode}" -o "${fcode}.x" &>> "${T}"/_fortran_compile_test.log
124 ret=$?
125 (( ${ret} )) || break
126 done
127 @@ -145,11 +147,11 @@
128 return ${ret}
129 }
130
131 -# @FUNCTION: _die_msg
132 +# @FUNCTION: _fortran_die_msg
133 # @INTERNAL
134 # @DESCRIPTION:
135 # Detailed description how to handle fortran support
136 -_die_msg() {
137 +_fortran_die_msg() {
138 echo
139 eerror "Please install currently selected gcc version with USE=fortran."
140 eerror "If you intend to use a different compiler then gfortran, please"
141 @@ -159,31 +161,6 @@
142 die "Currently no working fortran compiler is available"
143 }
144
145 -# @FUNCTION: fortran-2_pkg_setup
146 -# @DESCRIPTION:
147 -# Setup functionallity, checks for a valid fortran compiler and optionally for its openmp support.
148 -fortran-2_pkg_setup() {
149 -for _f_use in ${FORTRAN_NEEDED}; do
150 - case ${_f_use} in
151 - always)
152 - _fortran_test_function && break
153 - ;;
154 - no)
155 - einfo "Forcing fortran support off"
156 - break
157 - ;;
158 - *)
159 - if use ${_f_use}; then
160 - _fortran_test_function && break
161 - else
162 - unset FC
163 - unset F77
164 - fi
165 - ;;
166 - esac
167 -done
168 -}
169 -
170 # @FUNCTION: _fortran_test_function
171 # @INTERNAL
172 # @DESCRIPTION:
173 @@ -196,9 +173,9 @@
174 : ${FORTRAN_STANDARD:=77}
175 for dialect in ${FORTRAN_STANDARD}; do
176 case ${dialect} in
177 - 77) _compile_test $(tc-getF77) || _die_msg ;;
178 - 90|95) _compile_test $(tc-getFC) 90 || _die_msg ;;
179 - 2003) _compile_test $(tc-getFC) 03 || _die_msg ;;
180 + 77) _fortran_compile_test $(tc-getF77) || _fortran_die_msg ;;
181 + 90|95) _fortran_compile_test $(tc-getFC) 90 || _fortran_die_msg ;;
182 + 2003) _fortran_compile_test $(tc-getFC) 03 || _fortran_die_msg ;;
183 2008) die "Future" ;;
184 *) die "${dialect} is not a Fortran dialect." ;;
185 esac
186 @@ -218,6 +195,31 @@
187 fi
188 }
189
190 +# @FUNCTION: fortran-2_pkg_setup
191 +# @DESCRIPTION:
192 +# Setup functionallity, checks for a valid fortran compiler and optionally for its openmp support.
193 +fortran-2_pkg_setup() {
194 + for _f_use in ${FORTRAN_NEEDED}; do
195 + case ${_f_use} in
196 + always)
197 + _fortran_test_function && break
198 + ;;
199 + no)
200 + einfo "Forcing fortran support off"
201 + break
202 + ;;
203 + *)
204 + if use ${_f_use}; then
205 + _fortran_test_function && break
206 + else
207 + unset FC
208 + unset F77
209 + fi
210 + ;;
211 + esac
212 + done
213 +}
214 +
215 case ${EAPI:-0} in
216 0|1|2|3|4|5) EXPORT_FUNCTIONS pkg_setup ;;
217 *) die "EAPI=${EAPI} is not supported" ;;