Jessica Clarke 9c6954329a bsd.compiler.mk: Detect distribution-provided GCC when executed as cc
Clang always prints "clang $VERSION" regardless of the name used to
execute it, whereas GCC prints "$progname $VERSION", meaning if CC is
set to cc and cc is GCC it will print "cc $VERSION". We are able to
detect some of those cases since it then prints "($PKGVERSION)", where
the default is "GCC", but many distributions override that to print
their name and the package version number (e.g. "Debian 10.2.1-6"), so
nothing tells us it's GCC other than the fact that it's not Clang (and
that there's an FSF copyright disclaimer).

However, GCC's -v option will always print "gcc version $VERSION", so
fall back on using that to detect GCC. Whilst Clang also supports this
option, we should never get here, so Clang handling is not added.

Reviewed by:	brooks, emaste, arichardson
Differential Revision:	https://reviews.freebsd.org/D28315
2021-02-09 21:40:24 +00:00
..
2021-01-21 19:10:07 -05:00
2020-11-24 21:45:38 +00:00
2021-01-07 09:31:03 +00:00
2021-01-07 09:31:03 +00:00
2019-11-20 21:06:29 +00:00
2021-02-01 09:32:07 +00:00
2021-01-07 09:31:03 +00:00
2021-01-07 09:31:03 +00:00
2020-04-30 22:08:40 +00:00
2021-01-07 09:31:03 +00:00
2020-11-24 21:45:38 +00:00
2019-11-21 18:14:26 +00:00
2019-11-21 19:54:10 +00:00
2020-11-24 21:45:38 +00:00
2020-11-24 21:45:38 +00:00
2020-11-24 21:45:38 +00:00
2018-07-27 10:44:38 +00:00
2018-07-27 10:44:38 +00:00