From af5f25332e9f23bd3213c91ade4534466357537f Mon Sep 17 00:00:00 2001 From: Gerald Pfeifer Date: Sun, 30 Oct 2011 01:34:38 +0000 Subject: When USE_GCC=X.Y+ has been specified, prefer the default version of GCC (the one which also USE_FORTRAN=yes chooses) in case we do have to install GCC in any case. Only if an acceptable version of GCC is already present use that one. This will ease the load on tinderboxes, further the use of current versions of GCC, and minimize the need to download/carry several versions of GCC for users of pre-built packages. PR: 160507 Submitted by: bf --- Mk/bsd.gcc.mk | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'Mk/bsd.gcc.mk') diff --git a/Mk/bsd.gcc.mk b/Mk/bsd.gcc.mk index e6ab7d137677..1444379f8052 100644 --- a/Mk/bsd.gcc.mk +++ b/Mk/bsd.gcc.mk @@ -48,6 +48,9 @@ GCCVERSION_040500= 0 0 4.5 GCCVERSION_040600= 0 0 4.6 GCCVERSION_040700= 0 0 4.7 +GCC_DEFAULT_VERSION= 4.6 +GCC_DEFAULT_V= ${GCC_DEFAULT_VERSION:S/.//} + # # No configurable parts below this. # @@ -73,9 +76,9 @@ _GCCVERSION_${v}_V= ${j} # The default case, with a current lang/gcc port. . if ${USE_FORTRAN} == yes -_USE_GCC:= 4.6 -FC:= gfortran46 -F77:= gfortran46 +_USE_GCC:= ${GCC_DEFAULT_VERSION} +FC:= gfortran${GCC_DEFAULT_V} +F77:= gfortran${GCC_DEFAULT_V} # Intel Fortran compiler from lang/ifc. . elif ${USE_FORTRAN} == ifort @@ -160,7 +163,9 @@ _GCC_FOUND:= ${_GCCVERSION_${v}_V} . endfor .endif .if defined(_GCC_FOUND) -_USE_GCC:=${_GCC_FOUND} +_USE_GCC:= ${_GCC_FOUND} +.elif ${_USE_GCC} < ${GCC_DEFAULT_VERSION} +_USE_GCC:= ${GCC_DEFAULT_VERSION} .endif .endif # defined(USE_GCC) -- cgit