Changeset View
Changeset View
Standalone View
Standalone View
head/Mk/bsd.gcc.mk
Show All 11 Lines | |||||
# USE_GCC=any is similar, except that it also accepts the old GCC 4.2- | # USE_GCC=any is similar, except that it also accepts the old GCC 4.2- | ||||
# based system compiler where still present. | # based system compiler where still present. | ||||
# | # | ||||
# If your port needs a specific (minimum) version of GCC, you can easily | # If your port needs a specific (minimum) version of GCC, you can easily | ||||
# specify that with a USE_GCC= statement. Unless absolutely necessary | # specify that with a USE_GCC= statement. Unless absolutely necessary | ||||
# do so by specifying USE_GCC=X+ which requests at least GCC version X. | # do so by specifying USE_GCC=X+ which requests at least GCC version X. | ||||
# To request a specific version omit the trailing + sign. | # To request a specific version omit the trailing + sign. | ||||
# | # | ||||
# Optionally comma-separated arguments follow the version specifier. | |||||
# Currently we support: | |||||
# build ... which adds GCC as a build dependency (BUILD_DEPENDS) only. | |||||
# | |||||
# If no arguments are specified, GCC is added as both a build dependency | |||||
# and a run time dependency. | |||||
# | |||||
# | |||||
# Examples: | # Examples: | ||||
# USE_GCC= yes # port requires a current version of GCC | # USE_GCC= yes # port requires a current version of GCC | ||||
# # as defined in bsd.default-versions.mk. | # # as defined in bsd.default-versions.mk. | ||||
# USE_GCC= any # port requires GCC 4.2 or later. | # USE_GCC= any # port requires GCC 4.2 or later. | ||||
# USE_GCC= 9+ # port requires GCC 9 or later. | # USE_GCC= 9+ # port requires GCC 9 or later. | ||||
# USE_GCC= 8 # port requires GCC 8. | # USE_GCC= 8 # port requires GCC 8. | ||||
# USE_GCC= yes:build # port requires a current version of GCC at | |||||
# # build time only. | |||||
# USE_GCC= 9:build # port requires GCC 9 at build time only. | |||||
# USE_GCC= 11+:build # port requires GCC 11 or later at build | |||||
# # time only. | |||||
# | # | ||||
# If you are wondering what your port exactly does, use "make test-gcc" | # If you are wondering what your port exactly does, use "make test-gcc" | ||||
# to see some debugging. | # to see some debugging. | ||||
# | # | ||||
# $FreeBSD$ | # $FreeBSD$ | ||||
GCC_Include_MAINTAINER= gerald@FreeBSD.org | GCC_Include_MAINTAINER= gerald@FreeBSD.org | ||||
# All GCC versions supported by this framework. | # All GCC versions supported by this framework. | ||||
# | # | ||||
# When updating this, keep Mk/bsd.default-versions.mk in sync. | # When updating this, keep Mk/bsd.default-versions.mk in sync. | ||||
GCCVERSIONS= 4.8 7 8 9 10 11 | GCCVERSIONS= 4.8 7 8 9 10 11 | ||||
# No configurable parts below this. #################################### | # No configurable parts below this. #################################### | ||||
# | # | ||||
# Split arguments | |||||
.if defined(USE_GCC) | |||||
__USE_GCC:= ${USE_GCC:C/\:.*//} | |||||
_USE_GCC_ARGS:= ${USE_GCC:C/^[^\:]*(\:|\$)//:S/,/ /g} | |||||
USE_GCC= ${__USE_GCC} | |||||
.endif | |||||
.if ${_USE_GCC_ARGS:Mbuild} | |||||
_USE_GCC_ARGS:= ${_USE_GCC_ARGS:Nbuild} | |||||
.else | |||||
_USE_GCC_RUN_DEPENDS= yes | |||||
.endif | |||||
.if !empty(_USE_GCC_ARGS) | |||||
IGNORE= bad target specification in USE_GCC; only "build" is supported | |||||
.endif | |||||
.if defined(USE_GCC) && !defined(FORCE_BASE_CC_FOR_TESTING) | .if defined(USE_GCC) && !defined(FORCE_BASE_CC_FOR_TESTING) | ||||
.if ${USE_GCC} == any && exists(/usr/bin/gcc) | .if ${USE_GCC} == any && exists(/usr/bin/gcc) | ||||
CC:= gcc | CC:= gcc | ||||
CXX:= g++ | CXX:= g++ | ||||
. if exists(/usr/bin/gcpp) | . if exists(/usr/bin/gcpp) | ||||
CPP:= gcpp | CPP:= gcpp | ||||
. else | . else | ||||
▲ Show 20 Lines • Show All 61 Lines • ▼ Show 20 Lines | |||||
.undef V | .undef V | ||||
# Now filter unsupported flags for CC and CXX. | # Now filter unsupported flags for CC and CXX. | ||||
CFLAGS:= ${CFLAGS:N-mretpoline} | CFLAGS:= ${CFLAGS:N-mretpoline} | ||||
CXXFLAGS:= ${CXXFLAGS:N-mretpoline} | CXXFLAGS:= ${CXXFLAGS:N-mretpoline} | ||||
.if defined(_GCC_PORT) | .if defined(_GCC_PORT) | ||||
BUILD_DEPENDS+= ${CC}:lang/${_GCC_PORT} | BUILD_DEPENDS+= ${CC}:lang/${_GCC_PORT} | ||||
. if defined(_USE_GCC_RUN_DEPENDS) | |||||
RUN_DEPENDS+= ${CC}:lang/${_GCC_PORT} | RUN_DEPENDS+= ${CC}:lang/${_GCC_PORT} | ||||
. endif | |||||
# GCC ports already depend on binutils; make sure whatever we build | # GCC ports already depend on binutils; make sure whatever we build | ||||
# leverages this as well. | # leverages this as well. | ||||
USE_BINUTILS= yes | USE_BINUTILS= yes | ||||
.endif | .endif | ||||
.endif # USE_GCC=any | .endif # USE_GCC=any | ||||
.endif # defined(_USE_GCC) && !defined(FORCE_BASE_CC_FOR_TESTING) | .endif # defined(_USE_GCC) && !defined(FORCE_BASE_CC_FOR_TESTING) | ||||
Show All 22 Lines |