bsd.compiler.mk (0275f9dbf73b01e9478dc7d6ab5fab4f8e077448) bsd.compiler.mk (481640801657a20e3066e5bccf1e676bb750a1e2)
1# $FreeBSD$
2
3# Setup variables for the compiler
4#
5# COMPILER_TYPE is the major type of compiler. Currently gcc and clang support
6# automatic detection. Other compiler types can be shoe-horned in, but require
7# explicit setting of the compiler type. The compiler type can also be set
8# explicitly if, say, you install gcc as clang...

--- 5 unchanged lines hidden (view full) ---

14# against 30300 for gcc likely isn't what you wanted (since versions of gcc
15# prior to 4.2 likely have no prayer of working).
16#
17# COMPILER_FREEBSD_VERSION is the compiler's __FreeBSD_cc_version value.
18#
19# COMPILER_FEATURES will contain one or more of the following, based on
20# compiler support for that feature:
21#
1# $FreeBSD$
2
3# Setup variables for the compiler
4#
5# COMPILER_TYPE is the major type of compiler. Currently gcc and clang support
6# automatic detection. Other compiler types can be shoe-horned in, but require
7# explicit setting of the compiler type. The compiler type can also be set
8# explicitly if, say, you install gcc as clang...

--- 5 unchanged lines hidden (view full) ---

14# against 30300 for gcc likely isn't what you wanted (since versions of gcc
15# prior to 4.2 likely have no prayer of working).
16#
17# COMPILER_FREEBSD_VERSION is the compiler's __FreeBSD_cc_version value.
18#
19# COMPILER_FEATURES will contain one or more of the following, based on
20# compiler support for that feature:
21#
22# - c++11 : supports full (or nearly full) C++11 programming environment.
22# - c++11: supports full (or nearly full) C++11 programming environment.
23# - retpoline: supports the retpoline speculative execution vulnerability
24# mitigation.
23#
24# These variables with an X_ prefix will also be provided if XCC is set.
25#
26# This file may be included multiple times, but only has effect the first time.
27#
28
29.if !target(__<bsd.compiler.mk>__)
30__<bsd.compiler.mk>__:

--- 142 unchanged lines hidden (view full) ---

173# If we get a literal "__FreeBSD_cc_version" back then the compiler
174# is a non-FreeBSD build that doesn't support it or some other error
175# occurred.
176.if ${${X_}COMPILER_FREEBSD_VERSION} == "__FreeBSD_cc_version"
177${X_}COMPILER_FREEBSD_VERSION= unknown
178.endif
179.endif
180
25#
26# These variables with an X_ prefix will also be provided if XCC is set.
27#
28# This file may be included multiple times, but only has effect the first time.
29#
30
31.if !target(__<bsd.compiler.mk>__)
32__<bsd.compiler.mk>__:

--- 142 unchanged lines hidden (view full) ---

175# If we get a literal "__FreeBSD_cc_version" back then the compiler
176# is a non-FreeBSD build that doesn't support it or some other error
177# occurred.
178.if ${${X_}COMPILER_FREEBSD_VERSION} == "__FreeBSD_cc_version"
179${X_}COMPILER_FREEBSD_VERSION= unknown
180.endif
181.endif
182
183${X_}COMPILER_FEATURES=
181.if ${${X_}COMPILER_TYPE} == "clang" || \
182 (${${X_}COMPILER_TYPE} == "gcc" && ${${X_}COMPILER_VERSION} >= 40800)
184.if ${${X_}COMPILER_TYPE} == "clang" || \
185 (${${X_}COMPILER_TYPE} == "gcc" && ${${X_}COMPILER_VERSION} >= 40800)
183${X_}COMPILER_FEATURES= c++11
184.else
185${X_}COMPILER_FEATURES=
186${X_}COMPILER_FEATURES+= c++11
186.endif
187.endif
188.if ${${X_}COMPILER_TYPE} == "clang" && ${${X_}COMPILER_VERSION} >= 60000
189${X_}COMPILER_FEATURES+= retpoline
190.endif
187
188.else
189# Use CC's values
190X_COMPILER_TYPE= ${COMPILER_TYPE}
191X_COMPILER_VERSION= ${COMPILER_VERSION}
192X_COMPILER_FREEBSD_VERSION= ${COMPILER_FREEBSD_VERSION}
193X_COMPILER_FEATURES= ${COMPILER_FEATURES}
194.endif # ${cc} == "CC" || (${cc} == "XCC" && ${XCC} != ${CC})

--- 14 unchanged lines hidden ---
191
192.else
193# Use CC's values
194X_COMPILER_TYPE= ${COMPILER_TYPE}
195X_COMPILER_VERSION= ${COMPILER_VERSION}
196X_COMPILER_FREEBSD_VERSION= ${COMPILER_FREEBSD_VERSION}
197X_COMPILER_FEATURES= ${COMPILER_FEATURES}
198.endif # ${cc} == "CC" || (${cc} == "XCC" && ${XCC} != ${CC})

--- 14 unchanged lines hidden ---