r345708 worked for the base system, but unfortunately, caused a lot of
disruption for third-party packages that relied on C++, since bsd.sys.mk is
used by applications outside the base system. The defaults picked didn't match
the compiler's defaults and broke some builds that didn't specify a standard,
as well as some that overrode the value by setting -std=gnu++14 (for
example) manually.
This change takes a more relaxed approach to appending -std=${CXXSTD} to
CXXFLAGS, by only doing so when the value is specified, as opposed to
overriding the standard set by an end-user. This avoids the need for having
to bake NOP default into bsd.sys.mk for supported compiler-toolchain
versions.
In order to make this change possible, add CXXSTD to Makefile snippets which
relied on the default value (c++11) added in r345708. For those Makefile
snippets that allowed the end-user to override the standard, make it default
to the target standard used prior to r345708 to match the behavior from
before the change.
MFC after: 2 weeks
MFC with: r345708
Reported by: jbeich