summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authortheraven <theraven@FreeBSD.org>2013-09-06 20:08:03 +0000
committertheraven <theraven@FreeBSD.org>2013-09-06 20:08:03 +0000
commit1df952388b48e11694d9be00cbdb7fed2ca1c0f3 (patch)
tree323fdbecd93a672260c605a70c974da7b41353c6 /share
parent6965cdad6639b93d4b619f8e095c037377cd0d66 (diff)
downloadFreeBSD-src-1df952388b48e11694d9be00cbdb7fed2ca1c0f3.zip
FreeBSD-src-1df952388b48e11694d9be00cbdb7fed2ca1c0f3.tar.gz
On platforms where clang is the default compiler, don't build gcc or libstdc++.
To enable them, set WITH_GCC and WITH_GNUCXX in src.conf. Make clang default to using libc++ on FreeBSD 10. Bumped __FreeBSD_version for the change. GCC is still enabled on PC98, because the PC98 bootloader requires GCC to build (or, at least, hard-codes the use of gcc into its build). Thanks to everyone who helped make the ports tree ready for this (and bapt for coordinating them all). Also to imp for reviewing this and working on the forward-porting of the changes in our gcc so that we're getting to a much better place with regard to external toolchains. Sorry to all of the people who helped who I forgot to mention by name. Reviewed by: bapt, imp, dim, ...
Diffstat (limited to 'share')
-rw-r--r--share/mk/bsd.own.mk28
1 files changed, 27 insertions, 1 deletions
diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk
index da758d5..3eb8e51 100644
--- a/share/mk/bsd.own.mk
+++ b/share/mk/bsd.own.mk
@@ -284,7 +284,6 @@ __DEFAULT_YES_OPTIONS = \
FP_LIBC \
FREEBSD_UPDATE \
GAMES \
- GCC \
GCOV \
GDB \
GNU \
@@ -400,6 +399,11 @@ __T=${TARGET_ARCH}
.else
__T=${MACHINE_ARCH}
.endif
+.if defined(TARGET)
+__TT=${TARGET}
+.else
+__TT=${MACHINE_ARCH}
+.endif
# Clang is only for x86, powerpc and little-endian arm right now, by default.
.if ${__T} == "amd64" || ${__T} == "i386" || ${__T:Mpowerpc*}
__DEFAULT_YES_OPTIONS+=CLANG CLANG_FULL
@@ -414,8 +418,30 @@ __DEFAULT_NO_OPTIONS+=CLANG CLANG_FULL
.if ${__T} == "amd64" || ${__T} == "arm" || ${__T} == "armv6" || \
${__T} == "i386"
__DEFAULT_YES_OPTIONS+=CLANG_IS_CC
+# The pc98 bootloader requires gcc to build and so we must leave gcc enabled
+# for pc98 for now.
+.if ${__TT} == "pc98"
+__DEFAULT_NO_OPTIONS+=GNUCXX
+__DEFAULT_YES_OPTIONS+=GCC
+.else
+__DEFAULT_NO_OPTIONS+=GCC GNUCXX
+.endif
+# The libc++ headers use c++11 extensions. These are normally silenced because
+# they are treated as system headers, but we explicitly disable that warning
+# suppression when building the base system to catch bugs in our headers.
+# Eventually we'll want to start building the base system C++ code as C++11,
+# but not yet.
+CXXFLAGS+= -Wno-c++11-extensions
.else
+# If clang is not cc, then build gcc by default
__DEFAULT_NO_OPTIONS+=CLANG_IS_CC
+__DEFAULT_YES_OPTIONS+=GCC
+# And if g++ is c++, build the rest of the GNU C++ stack
+.if defined(WITHOUT_CXX)
+__DEFAULT_NO_OPTIONS+=GNUCXX
+.else
+__DEFAULT_YES_OPTIONS+=GNUCXX
+.endif
.endif
# FDT is needed only for arm, mips and powerpc
.if ${__T:Marm*} || ${__T:Mpowerpc*} || ${__T:Mmips*}
OpenPOWER on IntegriCloud