summaryrefslogtreecommitdiffstats
path: root/Mk/bsd.gcc.mk
diff options
context:
space:
mode:
authoredwin <edwin@FreeBSD.org>2005-06-03 01:42:54 +0000
committeredwin <edwin@FreeBSD.org>2005-06-03 01:42:54 +0000
commitb8252132bd4a77a0863838eff142438c2e2655fc (patch)
tree7b6c54c843ac852abd2bea4be7f623a94596250d /Mk/bsd.gcc.mk
parent1188a067f37b56e11e6214ed07db228fa2bf851b (diff)
downloadFreeBSD-ports-b8252132bd4a77a0863838eff142438c2e2655fc.zip
FreeBSD-ports-b8252132bd4a77a0863838eff142438c2e2655fc.tar.gz
USE_GCC=X.Y+ should prefer the stock compiler
USE_GCC=3.2+ on a 6-CURRENT system prefers the GCC 3.2 compiler instead of the GCC 3.4 default system compiler. One often uses USE_GCC=3.2+ to enable a port to build on RELENG_4, but that does not mean a 6-CURRENT user doesn't want to use the native compiler. I also argue that the correct algorithm for USE_GCC=3.2+ is: 1. Use system compiler if it's version is allowable by the USE_GCC invocation. 2. Prefer the highest version # found already installed and allowed by the USE_GCC invocation, rather than the lowest. 3. Install the specified GCC version and use if, if no other already installed compiler meets the USE_GCC invocation. #1 and #3 are implemented with this patch, but #2 isn't. The reason for it is because there is no highest version # specifiable with the USE_GCC command. What could be made is that the USE_GCC command accepts two arguments, where the first is the lower version, the second is the upper version. Or USE_GCC=-4.0, where everything <= 4.0 is allowed. PR: ports/81116 Reviewed by: David O'Brien <obrien@freebsd.org>
Diffstat (limited to 'Mk/bsd.gcc.mk')
-rw-r--r--Mk/bsd.gcc.mk15
1 files changed, 12 insertions, 3 deletions
diff --git a/Mk/bsd.gcc.mk b/Mk/bsd.gcc.mk
index be1a97e..466ead9 100644
--- a/Mk/bsd.gcc.mk
+++ b/Mk/bsd.gcc.mk
@@ -99,14 +99,23 @@ BROKEN= "Couldn't find your current GCCVERSION (OSVERSION=${OSVERSION})"
#
# If the GCC package defined in USE_GCC does not exist, but a later
# version is allowed (for example 3.1+), see if there is a later.
-# The first available version will be used.
+# First check if the base installed version is good enough, otherwise
+# get the first available version.
#
.if defined(_GCC_ORLATER)
. for v in ${GCCVERSIONS}
. if ${_USE_GCC} == ${_GCCVERSION_${v}_V}
-_GCC_MIN:= true
+_GCC_MIN1:= true
. endif
-. if defined(_GCC_MIN) && defined(_GCC_FOUND${v}) && !defined(_GCC_FOUND)
+. if defined(_GCC_MIN1) && defined(_GCC_FOUND${v}) && ${_GCC_FOUND${v}}=="base" && !defined(_GCC_FOUND)
+_GCC_FOUND:= ${_GCCVERSION_${v}_V}
+. endif
+. endfor
+. for v in ${GCCVERSIONS}
+. if ${_USE_GCC} == ${_GCCVERSION_${v}_V}
+_GCC_MIN2:= true
+. endif
+. if defined(_GCC_MIN2) && defined(_GCC_FOUND${v}) && !defined(_GCC_FOUND)
_GCC_FOUND:= ${_GCCVERSION_${v}_V}
. endif
. endfor
OpenPOWER on IntegriCloud