Commit Graph

19 Commits

Author SHA1 Message Date
Simon J. Gerraty
10b60135a9 Mention what 'common' is for 2015-06-10 19:36:53 +00:00
Simon J. Gerraty
b17ff922d4 Merge from head 2015-05-26 21:52:57 +00:00
Enji Cooper
65051f5755 The previous commit should have been a logical or not a logical "and"
Pointyhat to: me
2014-12-08 03:32:26 +00:00
Enji Cooper
a8374a76b1 ${CC} --version doesn't need to be queried if both COMPILER_TYPE and
COMPILER_VERSION are known
2014-12-06 04:02:56 +00:00
Enji Cooper
9f1bd9c146 Fix typos in comments and wrap to <80 columns
MFC after: 3 days
2014-12-06 03:12:57 +00:00
Simon J. Gerraty
9268022b74 Merge from head@274682 2014-11-19 01:07:58 +00:00
Baptiste Daroussin
d8d1a9ad6c When using an external toolchain note that gcc 4.8+ supports C++11
Submitted by:	imp
2014-10-21 19:58:23 +00:00
Simon J. Gerraty
ee7b0571c2 Merge head from 7/28 2014-08-19 06:50:54 +00:00
Warner Losh
79f387daa8 Allow CC to not actually exist. During the ports INDEX run, all the
Makefiles are evaluated without building things. In a normal build,
the prerequisites would be built, and CC would be an actual thing. In
an INDEX build, though, they don't exists. Redirect stderr to get rid
of annoying messages, and assume that the compiler version is 0 if the
actual compiler can't tell us. Do this in preference to guessing based
on numbers because gcc410 might be 4.10, or 4.1.0 and without
carefully crafted special knowledge we differentiate between them
easily (also ming-gcc has no clues at all). Elsewhere, don't trust
the compiler version if it is 0.
2014-05-23 14:34:22 +00:00
Warner Losh
999298523e Support, to the extent we generate proper command lines, compiling
with clang 3.3. Useful for test building -current on a -stable system
in individual directories. Potentially useful if we ever want to
support, say, gcc 4.8 or 4.9's new warnings when building with an
external toolchain (but such support not yet committed). Document
the bsd.compiler.mk interface.
2014-05-10 16:37:44 +00:00
Simon J. Gerraty
cc3f4b9965 Merge from head 2014-05-08 23:54:15 +00:00
Warner Losh
bd871f14b7 bsd.compiler.mk was implicitly included by bsd.own.mk in historical
versions. With its movement to src.opts.mk, bsd.prog.mk was testing
COMPILER_TYPE without including the bsd.compiler.mk anymore. In the
source tree, this caused no problems, for reasons that aren't clear,
but does cause problems outside of the source tree. Allow
bsd.compiler.mk to be included multiple times safely, and always
include bsd.compiler.mk at the top of bsd.prog.mk. Resist the urge to
put it in bsd.init.mk, since that would reintroduce the implicit
include.
2014-05-07 18:15:02 +00:00
Simon J. Gerraty
1c19778e8d Some warnings depened on the version of clang, allow us to check.
Reviewed by: obrien
2014-05-02 01:39:44 +00:00
Simon J. Gerraty
9d82612e13 Avoid errors when MACHINE is a pseudo machine like "common". 2013-10-12 23:49:26 +00:00
Brooks Davis
0837595205 Provide slightly more helpful feedback when we can't figure out what
compiler the user is using.

PR:		misc/173914
2013-03-01 03:25:43 +00:00
Dimitry Andric
8d7f35458a Fix typo in bsd.compiler.mk. 2012-11-06 07:51:20 +00:00
Brooks Davis
909c4d7ec0 Allow CC to be gcc46 or similar by matching gcc*.
Don't test the value of the :M matches, either the string matches or does
not.
2012-11-05 23:05:14 +00:00
Brooks Davis
815e67dd3b Add a COMPILER_FEATURES variable that is set in bsd.compiler.mk.
When the compiler is clang add c++11 to COMPILER_FEATURES.

When the compiler supports c++11, default to building libc++.  This will
not impact the compliation of programs, but will make it easier for
users with clang compiled systems to test libc++ by passing -stdlib=libc++
to their c++ compliations.
2012-09-26 17:25:15 +00:00
Brooks Davis
9215d178a4 Introduce a new make variable COMPILER_TYPE that specifies what
type of compiler is being used (currently clang or gcc).  COMPILER_TYPE
is set in the new bsd.compiler.mk file based on the value of the CC
variable or, should it prove informative, by running ${CC} --version
and examining the output.

To avoid negative performance impacts in the default case and correct
value for COMPILER_TYPE type is determined and passed in the environment
of submake instances while building world.

Replace adhoc attempts at determining the compiler type by examining
CC or MK_CLANG_IS_CC with checks of COMPILER_TYPE.  This eliminates
bootstrapping complications when first setting WITH_CLANG_IS_CC.

Sponsored by:	DARPA, AFRL
Reviewed by:	Yamaya Takashi <yamayan@kbh.biglobe.ne.jp>, imp, linimon
		(with some modifications post review)
MFC after:	2 weeks
2012-09-13 16:00:46 +00:00