Fix the case where neither gfortran nor g77 will compile a package -- fall back to...
authorDonnie Berkholz <dberkholz@gentoo.org>
Mon, 5 Jun 2006 06:56:08 +0000 (06:56 +0000)
committerDonnie Berkholz <dberkholz@gentoo.org>
Mon, 5 Jun 2006 06:56:08 +0000 (06:56 +0000)
eclass/fortran.eclass

index 01e8120382087106a02f0d4ed05b07ba10fa0767..e883343ba864a051e16f1de613dec030aff559c5 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/fortran.eclass,v 1.14 2006/04/28 01:20:27 spyderous Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/fortran.eclass,v 1.15 2006/06/05 06:56:08 spyderous Exp $
 #
 # Author: Danny van Dyk <kugelfang@gentoo.org>
 #
@@ -130,8 +130,14 @@ need_fortran() {
                use debug && echo "MY_FORTRAN: \"${MY_FORTRAN}\""
                if hasq gfortran ${AVAILABLE}; then
                        MY_FORTRAN=${MY_FORTRAN:=gfortran}
-               else
+               elif hasq g77 ${AVAILABLE}; then
                        MY_FORTRAN=${MY_FORTRAN:=g77}
+               else
+                       # Default to the first valid Fortran compiler
+                       for i in ${AVAILABLE}; do
+                               MY_FORTRAN=$i
+                               break
+                       done
                fi
                use debug && echo "MY_FORTRAN: \"${MY_FORTRAN}\""