View | Details | Raw Unified | Return to bug 244008
Collapse All | Expand All

(-)Mk/bsd.gcc.mk (-37 / +10 lines)
Lines 82-99 Link Here
82
82
83
. endif # ${USE_GCC} == any
83
. endif # ${USE_GCC} == any
84
84
85
# Initialize _GCC_FOUND${v}.  In parallel, check if USE_GCC points to a
85
# See whether we have the specific version requested installed already
86
# valid version to begin with.
86
# and save that into _GCC_FOUND.  In parallel, check if USE_GCC refers
87
# to a valid version to begin with.
87
.for v in ${GCCVERSIONS}
88
.for v in ${GCCVERSIONS}
88
. if exists(${LOCALBASE}/bin/gcc${_GCCVERSION_${v}_V:S/.//})
89
_GCC_FOUND${v}=	port
90
. elif ${OSVERSION} < ${_GCCVERSION_${v}_R}
91
.  if exists(/usr/bin/gcc)
92
_GCC_FOUND${v}=	base
93
.  endif
94
. endif
95
. if ${_USE_GCC}==${_GCCVERSION_${v}_V}
89
. if ${_USE_GCC}==${_GCCVERSION_${v}_V}
96
_GCCVERSION_OKAY=	true
90
_GCCVERSION_OKAY=	true
91
.  if exists(${LOCALBASE}/bin/gcc${_GCCVERSION_${v}_V:S/.//})
92
_GCC_FOUND:=		${_USE_GCC}
93
.  elif ${OSVERSION} < ${_GCCVERSION_${v}_R} && exists(/usr/bin/gcc)
94
_GCC_FOUND:=		${_USE_GCC}
95
.  endif
97
. endif
96
. endif
98
.endfor
97
.endfor
99
98
Lines 102-132 Link Here
102
.endif
101
.endif
103
102
104
# If the GCC package defined in USE_GCC does not exist, but a later
103
# If the GCC package defined in USE_GCC does not exist, but a later
105
# version is allowed (for example 4.7+), see if there is a later.
104
# version is allowed (for example 8+), go and use the default.
106
# First check if the base installed version is good enough, otherwise
107
# get the first available version.
108
#
109
.if defined(_GCC_ORLATER)
105
.if defined(_GCC_ORLATER)
110
. for v in ${GCCVERSIONS}
106
. if !defined(_GCC_FOUND) && ${_USE_GCC} < ${GCC_DEFAULT}
111
.  if ${_USE_GCC} == ${_GCCVERSION_${v}_V}
112
_GCC_MIN1:=	true
113
.  endif
114
.  if defined(_GCC_MIN1) && defined(_GCC_FOUND${v}) && ${_GCC_FOUND${v}}=="base" && !defined(_GCC_FOUND)
115
_GCC_FOUND:=	${_GCCVERSION_${v}_V}
116
.  endif
117
. endfor
118
. for v in ${GCCVERSIONS}
119
.  if ${_USE_GCC} == ${_GCCVERSION_${v}_V}
120
_GCC_MIN2:=	true
121
.  endif
122
.  if defined(_GCC_MIN2) && defined(_GCC_FOUND${v}) && !defined(_GCC_FOUND)
123
_GCC_FOUND:=	${_GCCVERSION_${v}_V}
124
.  endif
125
. endfor
126
127
. if defined(_GCC_FOUND)
128
_USE_GCC:=	${_GCC_FOUND}
129
. elif ${_USE_GCC} < ${GCC_DEFAULT}
130
_USE_GCC:=	${GCC_DEFAULT}
107
_USE_GCC:=	${GCC_DEFAULT}
131
. endif
108
. endif
132
.endif # defined(_GCC_ORLATER)
109
.endif # defined(_GCC_ORLATER)
Lines 198-208 Link Here
198
.endif
175
.endif
199
.for v in ${GCCVERSIONS}
176
.for v in ${GCCVERSIONS}
200
	@echo -n "GCC version: ${_GCCVERSION_${v}_V} "
177
	@echo -n "GCC version: ${_GCCVERSION_${v}_V} "
201
.if defined(_GCC_FOUND${v})
202
	@echo -n "(${_GCC_FOUND${v}}) "
203
.endif
204
	@echo "- OSVERSION up to ${_GCCVERSION_${v}_R}"
178
	@echo "- OSVERSION up to ${_GCCVERSION_${v}_R}"
205
#	@echo ${v} - ${_GCC_FOUND${v}} - up to ${_GCCVERSION_${v}_R} - ${_GCCVERSION_${v}_V}
206
.endfor
179
.endfor
207
	@echo Using GCC version ${_USE_GCC}
180
	@echo Using GCC version ${_USE_GCC}
208
.endif
181
.endif

Return to bug 244008