mk: add support for c++23/gnu++23

This commit is contained in:
wiz 2024-01-27 00:03:49 +00:00
parent 459c5e896b
commit 2936c79f21
3 changed files with 16 additions and 10 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: compiler.mk,v 1.110 2024/01/03 12:20:21 gdt Exp $
# $NetBSD: compiler.mk,v 1.111 2024/01/27 00:03:49 wiz Exp $
#
# This Makefile fragment implements handling for supported C/C++/Fortran
# compilers.
@ -67,7 +67,7 @@
#
# Deprecated values are: c99, gnu99, c11, gnu11, c17, gnu17,
# c++03, gnu++03, c++0x, gnu++0x, c++11, gnu++11, c++14,
# gnu++14, c++17, gnu++17, c++20, gnu++20.
# gnu++14, c++17, gnu++17, c++20, gnu++20, c++23, gnu++23.
#
# The default is "c".
#
@ -87,7 +87,7 @@
# This is used to (optionally) install a newer compiler
# than provided by the system, to or skip building the package.
#
# Valid values are: c++11, c++14, c++17, c++20, has_include,
# Valid values are: c++11, c++14, c++17, c++20, c++23, has_include,
# regex, filesystem, unique_ptr, charconv, parallelism_ts,
# put_time, is_trivially_copy_constructible.
#
@ -111,8 +111,8 @@
# versions is not consistent. It is also useful if a package
# uses GNU language extensions without setting -std=gnu++XX.
#
# Valid values are: c++03, c++11, c++14, c++17, c++20, gnu++03,
# gnu++11, gnu++17, gnu++20
# Valid values are: c++03, c++11, c++14, c++17, c++20, c++23,
# gnu++03, gnu++11, gnu++17, gnu++20, gnu++23
#
# The following variables are defined, and available for testing in
# package Makefiles:
@ -148,7 +148,7 @@ USE_LANGUAGES+= c
. endif
.endfor
_CXX_STD_VERSIONS= gnu++20 c++20 gnu++17 c++17 gnu++14 c++14 gnu++11 c++11 gnu++0x c++0x gnu++03 c++03
_CXX_STD_VERSIONS= gnu++23 c++23 gnu++20 c++20 gnu++17 c++17 gnu++14 c++14 gnu++11 c++11 gnu++0x c++0x gnu++03 c++03
.for _version_ in ${_CXX_STD_VERSIONS}
. if !empty(USE_LANGUAGES:M${_version_})
USE_LANGUAGES+= c++

View File

@ -1,4 +1,4 @@
# $NetBSD: gcc-style-args.mk,v 1.3 2023/08/02 15:59:58 nia Exp $
# $NetBSD: gcc-style-args.mk,v 1.4 2024/01/27 00:03:50 wiz Exp $
#
# Some compilers (e.g. clang) share command line argument formats with GCC.
@ -27,10 +27,10 @@ _GCC_C_DIALECTS+= gnu89 gnu90 gnu99 gnu9x gnu11 gnu1x gnu17 gnu18 \
gnu2x
_GCC_CXX_DIALECTS= c++98 c++03 c++0x c++11 c++1y c++14 \
c++1z c++17 c++2a c++20
c++1z c++17 c++2a c++20 c++23
_GCC_CXX_DIALECTS+= gnu++98 gnu++03 gnu++0x gnu++11 gnu++1y gnu++14 \
gnu++1z gnu++17 gnu++2a gnu++20
gnu++1z gnu++17 gnu++2a gnu++20 gnu++23
.if !empty(FORCE_C_STD)
. for std in ${_GCC_C_DIALECTS}

View File

@ -1,4 +1,4 @@
# $NetBSD: gcc.mk,v 1.271 2024/01/03 14:06:30 gdt Exp $
# $NetBSD: gcc.mk,v 1.272 2024/01/27 00:03:50 wiz Exp $
#
# This is the compiler definition for the GNU Compiler Collection.
#
@ -177,6 +177,12 @@ GCC_REQD+= 2.8.0
# https://gcc.gnu.org/c99status.html
#
.if !empty(USE_CXX_FEATURES:Mc++23)
# GCC 11 is the first version to support -std=c++23,
# but it was never packaged for pkgsrc, so use GCC 12 instead.
GCC_REQD+= 12
.endif
.if !empty(USE_CXX_FEATURES:Mc++20)
# GCC 10 is chosen because it is planned to be shipped with NetBSD 10,
# so is fairly battle-hardened with pkgsrc.