aboutsummaryrefslogtreecommitdiffstats
path: root/Mk
diff options
context:
space:
mode:
authorbrd <brd@FreeBSD.org>2015-07-15 04:32:14 +0800
committerbrd <brd@FreeBSD.org>2015-07-15 04:32:14 +0800
commit634e1e6410827593dcfbf5c675e9b481e0400fe2 (patch)
treef00ec812c730cebd001c01dca9affe349c343e37 /Mk
parentc6c0c981cf5c1632b37a4b852a8fe552c36c93c0 (diff)
downloadfreebsd-ports-gnome-634e1e6410827593dcfbf5c675e9b481e0400fe2.tar.gz
freebsd-ports-gnome-634e1e6410827593dcfbf5c675e9b481e0400fe2.tar.zst
freebsd-ports-gnome-634e1e6410827593dcfbf5c675e9b481e0400fe2.zip
Add support for USES= compiler:c++14
PR: 201076 Approved by: bapt, bdrewery (mentor)
Diffstat (limited to 'Mk')
-rw-r--r--Mk/Uses/compiler.mk33
1 files changed, 31 insertions, 2 deletions
diff --git a/Mk/Uses/compiler.mk b/Mk/Uses/compiler.mk
index ef2784519d05..9df9e9198dc2 100644
--- a/Mk/Uses/compiler.mk
+++ b/Mk/Uses/compiler.mk
@@ -8,6 +8,7 @@
#
# c++0x: The port needs a compiler understanding C++0X
# c++11-lang: The port needs a compiler understanding C++11
+# c++14-lang: The port needs a compiler understanding C++14
# gcc-c++11-lib:The port needs g++ compiler with a C++11 library
# c++11-lib: The port needs a compiler understanding C++11 and with a C++11 ready standard library
# c11: The port needs a compiler understanding C11
@@ -34,7 +35,7 @@ _INCLUDE_USES_COMPILER_MK= yes
compiler_ARGS= env
.endif
-VALID_ARGS= c++11-lib c++11-lang c11 features openmp env nestedfct c++0x gcc-c++11-lib
+VALID_ARGS= c++11-lib c++11-lang c++14-lang c11 features openmp env nestedfct c++0x gcc-c++11-lib
.if ${compiler_ARGS} == gcc-c++11-lib
_COMPILER_ARGS+= features gcc-c++11-lib
@@ -44,6 +45,8 @@ _COMPILER_ARGS+= features c++11-lib
_COMPILER_ARGS+= features c++0x
.elif ${compiler_ARGS} == c++11-lang
_COMPILER_ARGS+= features c++11-lang
+.elif ${compiler_ARGS} == c++14-lang
+_COMPILER_ARGS+= features c++14-lang
.elif ${compiler_ARGS} == c11
_COMPILER_ARGS+= features c11
.elif ${compiler_ARGS} == features
@@ -114,7 +117,7 @@ COMPILER_FEATURES= libstdc++
.endif
CSTD= c89 c99 c11 gnu89 gnu99 gnu11
-CXXSTD= c++98 c++11 gnu++98 gnu++11 c++0x
+CXXSTD= c++98 c++0x c++11 c++14 gnu++98 gnu++11
.for std in ${CSTD} ${CXXSTD}
_LANG=c
@@ -138,6 +141,32 @@ CHOSEN_COMPILER_TYPE= gcc
.endif
.endif
+.if ${_COMPILER_ARGS:Mc++14-lang}
+.if !${COMPILER_FEATURES:Mc++14}
+.if (defined(FAVORITE_COMPILER) && ${FAVORITE_COMPILER} == gcc) || (${ARCH} != amd64 && ${ARCH} != i386) # clang not always supported on Tier-2
+USE_GCC= 5+
+CHOSEN_COMPILER_TYPE= gcc
+.elif (${COMPILER_TYPE} == clang && ${COMPILER_VERSION} < 35) || ${COMPILER_TYPE} == gcc
+.if ${ALT_COMPILER_TYPE} == clang && ${ALT_COMPILER_VERSION} >= 35
+CPP= clang-cpp
+CC= clang
+CXX= clang++
+CHOSEN_COMPILER_TYPE= clang
+.else
+BUILD_DEPENDS+= ${LOCALBASE}/bin/clang35:${PORTSDIR}/lang/clang35
+CPP= ${LOCALBASE}/bin/clang-cpp35
+CC= ${LOCALBASE}/bin/clang35
+CXX= ${LOCALBASE}/bin/clang++35
+CHOSEN_COMPILER_TYPE= clang
+.if ${OSVERSION} < 900033
+USE_BINUTILS= yes
+LDFLAGS+= -B${LOCALBASE}/bin
+.endif
+.endif
+.endif
+.endif
+.endif
+
.if ${_COMPILER_ARGS:Mc++11-lang}
.if !${COMPILER_FEATURES:Mc++11}
.if (defined(FAVORITE_COMPILER) && ${FAVORITE_COMPILER} == gcc) || (${ARCH} != amd64 && ${ARCH} != i386) # clang not always supported on Tier-2