public inbox for gentoo-science@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-science] [RFC] Fortran.eclass
@ 2010-07-03 11:49 Kacper Kowalik
  2010-07-03 12:45 ` justin
  0 siblings, 1 reply; 2+ messages in thread
From: Kacper Kowalik @ 2010-07-03 11:49 UTC (permalink / raw
  To: gentoo-science, Nathan Phillip Brink (ohnobinki), Thomas Sachau

[-- Attachment #1: Type: text/plain, Size: 628 bytes --]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,
I would like to propose changes to fortran.eclass to deal with bug
323555 [1].
Waiting for you comments before pushing to g-dev.
Cheers,
Kacper

[1] https://bugs.gentoo.org/show_bug.cgi?id=323555
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iJwEAQECAAYFAkwvI+IACgkQIiMqcbOVdxRuSQP/cqNQnxm5HG3yEgjMcHeIoRpJ
6ISJC7o07zvuCmPHtFl0g4LnDBrIMmtQv1+nMkqA3eCEs7QOJym8FcWVWJ/yui5r
jbKy/jrnuVazRv+8OXz7KkF47agddaMK9bkFjBGy1T6ZMD0EQCQ+CB/fbtsqgtCB
jYCv0MsdKHPTIu0miE0=
=yGrR
-----END PGP SIGNATURE-----


[-- Attachment #2: fortran.diff --]
[-- Type: text/plain, Size: 1318 bytes --]

--- fortran.eclass
+++ fortran.eclass
@@ -5,7 +5,7 @@
 # Author: Danny van Dyk <kugelfang@gentoo.org>
 #
 
-inherit eutils autotools
+inherit eutils autotools toolchain-funcs
 
 DESCRIPTION="Based on the ${ECLASS} eclass"
 
@@ -50,13 +50,13 @@
 	for PROFILE in $@; do
 		case ${PROFILE} in
 			gfortran)
-				if [ -x "$(type -P gfortran 2> /dev/null)" ]; then
-					AVAILABLE="${AVAILABLE} gfortran"
+				if [ -n "$(tc-getFC)" ]; then
+					AVAILABLE="${AVAILABLE} $(tc-getFC)"
 				fi
 				;;
 			g77)
-				if [ -x "$(type -P g77 2> /dev/null)" ]; then
-					AVAILABLE="${AVAILABLE} g77"
+				if [ -n "$(tc-getF77)" ]; then
+					AVAILABLE="${AVAILABLE} $(tc-getF77)"
 				fi
 				;;
 			f2c)
@@ -155,9 +155,9 @@
 		# default to gfortran if available, g77 if not
 		use debug && echo "MY_FORTRAN: \"${MY_FORTRAN}\""
 		if hasq gfortran ${AVAILABLE}; then
-			MY_FORTRAN=${MY_FORTRAN:=gfortran}
+			MY_FORTRAN=${MY_FORTRAN:=$(tc-getFC)}
 		elif hasq g77 ${AVAILABLE}; then
-			MY_FORTRAN=${MY_FORTRAN:=g77}
+			MY_FORTRAN=${MY_FORTRAN:=$(tc-getF77)}
 		else
 			# Default to the first valid Fortran compiler
 			for i in ${AVAILABLE}; do
@@ -173,7 +173,7 @@
 		fi
 
 		case ${MY_FORTRAN} in
-			gfortran|g77|ifc|ifort|f2c|f95)
+			$(tc-getFC)|$(tc-getF77)|ifc|ifort|f2c|f95)
 				FORTRANC="${MY_FORTRAN}"
 		esac
 	fi

[-- Attachment #3: fortran.diff.sig --]
[-- Type: application/pgp-signature, Size: 158 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-07-03 12:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-03 11:49 [gentoo-science] [RFC] Fortran.eclass Kacper Kowalik
2010-07-03 12:45 ` justin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox