diff options
author | linimon <linimon@FreeBSD.org> | 2012-10-08 03:33:19 +0800 |
---|---|---|
committer | linimon <linimon@FreeBSD.org> | 2012-10-08 03:33:19 +0800 |
commit | dae25ebb6d9be88e21a7786f12db3b7eba12d52f (patch) | |
tree | f95395c102a0b3870cb9ebe07e5d79174622a8e9 | |
parent | 58cc958f263b4b0fd9e4b17cb0532efc88e46189 (diff) | |
download | freebsd-ports-graphics-dae25ebb6d9be88e21a7786f12db3b7eba12d52f.tar.gz freebsd-ports-graphics-dae25ebb6d9be88e21a7786f12db3b7eba12d52f.tar.zst freebsd-ports-graphics-dae25ebb6d9be88e21a7786f12db3b7eba12d52f.zip |
Introduce the new semantic USE_GCC=any, which can be set in any port
Makefile. For systems where CC is gcc, this has no effect. For systems
where CC is clang, this forces the use of the base GCC suite. (Some
forward compatibility is also covered in the patch.)
Confirmed to have no ill-effects via multiple runs with gcc as CC:
http://pointyhat-west.isc.freebsd.org/errorlogs/amd64-errorlogs/e.8-exp-bcm.20121006012556.pointyhat-west/
and clang as CC:
http://pointyhat-west.isc.freebsd.org/errorlogs/amd64-errorlogs/e.9-exp-clang.20121005165436.pointyhat-west/
This change is necessary (but insufficient) for the upcoming switch to
clang as CC for the tier-1 architectures.
Finally, accept FORCE_BASE_CC_FOR_TESTING as an override for USE_GCC,
for those who wish to help debug ports with clang. It is an absolute
override; it overrides not only the value "any" but also any value such
as "4.4+".
Reviewed by: brooks, gerald
Approved by: maintainer (gerald)
-rw-r--r-- | Mk/bsd.gcc.mk | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/Mk/bsd.gcc.mk b/Mk/bsd.gcc.mk index 72fe92ea9a6..25883ae3aa5 100644 --- a/Mk/bsd.gcc.mk +++ b/Mk/bsd.gcc.mk @@ -100,7 +100,16 @@ MAKE_ENV+= F77="${F77}" FC="${FC}" FFLAGS="${FFLAGS}" .endif -.if defined(USE_GCC) +.if defined(USE_GCC) && !defined(FORCE_BASE_CC_FOR_TESTING) + +. if ${USE_GCC} == any + +# enable the clang-is-cc workaround. default to the last gcc imported +# into base. +_USE_GCC:= 4.2 +_GCC_ORLATER:= true + +. else # ${USE_GCC} == any # See if we can use a later version or exclusively the one specified. _USE_GCC:= ${USE_GCC:S/+//} @@ -108,6 +117,8 @@ _USE_GCC:= ${USE_GCC:S/+//} _GCC_ORLATER:= true .endif +. endif # ${USE_GCC} == any + # Check if USE_GCC points to a valid version. .for v in ${GCCVERSIONS} . for j in ${GCCVERSION_${v}} @@ -200,9 +211,17 @@ FFLAGS+= -Wl,-rpath=${_GCC_RUNTIME} # The following is for the sakes of some ports which use this without # ever telling us; to be fixed. _GCC_BUILD_DEPENDS:= ${_GCC_PORT_DEPENDS} +. endif # ${_USE_GCC} != 3.4 +. else # ${OSVERSION} < ${_GCCVERSION_${v}_L} || ${OSVERSION} > ${_GCCVERSION_${v}_R} +CC:= gcc +CXX:= g++ +. if exists(/usr/bin/gcpp) +CPP:= gcpp +. else +CPP:= cpp . endif -. endif -. endif +. endif # ${OSVERSION} < ${_GCCVERSION_${v}_L} || ${OSVERSION} > ${_GCCVERSION_${v}_R} +. endif # ${_USE_GCC} == ${_GCCVERSION_${v}_V} .endfor .undef V @@ -217,7 +236,7 @@ USE_BINUTILS= yes . endif . endif .endif -.endif # defined(_USE_GCC) +.endif # defined(_USE_GCC) && !defined(FORCE_BASE_CC_FOR_TESTING) test-gcc: |