Tue Jul 23 13:57:04 2019 UTC ()
mk/compiler.mk: Add c++17

We have a new language making its way into pkgsrc: C++17!  Add gnu++17
and c++17 to the list of _CXX_STD_VERSIONS.


(gdt)
diff -r1.93 -r1.94 pkgsrc/mk/compiler.mk

cvs diff -r1.93 -r1.94 pkgsrc/mk/compiler.mk (expand / switch to unified diff)

--- pkgsrc/mk/compiler.mk 2019/07/15 16:06:19 1.93
+++ pkgsrc/mk/compiler.mk 2019/07/23 13:57:04 1.94
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: compiler.mk,v 1.93 2019/07/15 16:06:19 ryoon Exp $ 1# $NetBSD: compiler.mk,v 1.94 2019/07/23 13:57:04 gdt Exp $
2# 2#
3# This Makefile fragment implements handling for supported C/C++/Fortran 3# This Makefile fragment implements handling for supported C/C++/Fortran
4# compilers. 4# compilers.
5# 5#
6# The following variables may be set by the pkgsrc user in mk.conf: 6# The following variables may be set by the pkgsrc user in mk.conf:
7# 7#
8# PKGSRC_COMPILER 8# PKGSRC_COMPILER
9# A list of values specifying the chain of compilers to be used by 9# A list of values specifying the chain of compilers to be used by
10# pkgsrc to build packages. 10# pkgsrc to build packages.
11# 11#
12# Valid values are: 12# Valid values are:
13# ccc Compaq C Compilers (Tru64) 13# ccc Compaq C Compilers (Tru64)
14# ccache compiler cache (chainable) 14# ccache compiler cache (chainable)
@@ -35,28 +35,28 @@ @@ -35,28 +35,28 @@
35# 35#
36# COMPILER_USE_SYMLINKS 36# COMPILER_USE_SYMLINKS
37# If set to yes, use symlinks for the compiler drivers, otherwise 37# If set to yes, use symlinks for the compiler drivers, otherwise
38# shell scripts are created. The default is yes. 38# shell scripts are created. The default is yes.
39# 39#
40# The following variables may be set by a package: 40# The following variables may be set by a package:
41# 41#
42# USE_LANGUAGES 42# USE_LANGUAGES
43# Declares the languages used in the source code of the package. 43# Declares the languages used in the source code of the package.
44# This is used to determine the correct compilers to make 44# This is used to determine the correct compilers to make
45# visible to the build environment, installing them if 45# visible to the build environment, installing them if
46# necessary. Flags such as -std=c++99 are also added. 46# necessary. Flags such as -std=c++99 are also added.
47# Valid values are: c, c99, c++, c++03, gnu++03, c++0x, gnu++0x, 47# Valid values are: c, c99, c++, c++03, gnu++03, c++0x, gnu++0x,
48# c++11, gnu++11, c++14, gnu++14, fortran, fortran77, java, objc, 48# c++11, gnu++11, c++14, gnu++14, c++17, gnu++17, fortran,
49# obj-c++, and ada. The default is "c". 49# fortran77, java, objc, obj-c++, and ada. The default is "c".
50# 50#
51# The above is partly aspirational. As an example c++11 does 51# The above is partly aspirational. As an example c++11 does
52# not force a new enough version of gcc. 52# not force a new enough version of gcc.
53# 53#
54# The following variables are defined, and available for testing in 54# The following variables are defined, and available for testing in
55# package Makefiles: 55# package Makefiles:
56# 56#
57# CC_VERSION 57# CC_VERSION
58# The compiler and version being used, e.g., 58# The compiler and version being used, e.g.,
59# 59#
60# .include "../../mk/compiler.mk" 60# .include "../../mk/compiler.mk"
61# 61#
62# .if !empty(CC_VERSION:Mgcc-3*) 62# .if !empty(CC_VERSION:Mgcc-3*)
@@ -73,27 +73,27 @@ _USER_VARS.compiler= PKGSRC_COMPILER USE @@ -73,27 +73,27 @@ _USER_VARS.compiler= PKGSRC_COMPILER USE
73_PKG_VARS.compiler= USE_LANGUAGES GCC_REQD NOT_FOR_COMPILER ONLY_FOR_COMPILER 73_PKG_VARS.compiler= USE_LANGUAGES GCC_REQD NOT_FOR_COMPILER ONLY_FOR_COMPILER
74_SYS_VARS.compiler= CC_VERSION 74_SYS_VARS.compiler= CC_VERSION
75 75
76.include "bsd.fast.prefs.mk" 76.include "bsd.fast.prefs.mk"
77 77
78# Since most packages need a C compiler, this is the default value. 78# Since most packages need a C compiler, this is the default value.
79USE_LANGUAGES?= c 79USE_LANGUAGES?= c
80 80
81# Add c support if c99 is set 81# Add c support if c99 is set
82.if !empty(USE_LANGUAGES:Mc99) 82.if !empty(USE_LANGUAGES:Mc99)
83USE_LANGUAGES+= c 83USE_LANGUAGES+= c
84.endif 84.endif
85 85
86_CXX_STD_VERSIONS= gnu++14 c++14 gnu++11 c++11 gnu++0x c++0x gnu++03 c++03 86_CXX_STD_VERSIONS= gnu++17 c++17 gnu++14 c++14 gnu++11 c++11 gnu++0x c++0x gnu++03 c++03
87.for _version_ in ${_CXX_STD_VERSIONS} 87.for _version_ in ${_CXX_STD_VERSIONS}
88. if !empty(USE_LANGUAGES:M${_version_}) 88. if !empty(USE_LANGUAGES:M${_version_})
89USE_LANGUAGES+= c++ 89USE_LANGUAGES+= c++
90. endif 90. endif
91.endfor 91.endfor
92 92
93COMPILER_USE_SYMLINKS?= yes 93COMPILER_USE_SYMLINKS?= yes
94 94
95_COMPILERS= ccc clang gcc hp icc ido \ 95_COMPILERS= ccc clang gcc hp icc ido \
96 mipspro mipspro-ucode pcc sunpro xlc 96 mipspro mipspro-ucode pcc sunpro xlc
97_PSEUDO_COMPILERS= ccache distcc f2c g95 97_PSEUDO_COMPILERS= ccache distcc f2c g95
98 98
99.if defined(NOT_FOR_COMPILER) && !empty(NOT_FOR_COMPILER) 99.if defined(NOT_FOR_COMPILER) && !empty(NOT_FOR_COMPILER)