From 8ad5f35a9013ca7c65e86e7aef92617903afeab0 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Wed, 3 Dec 2025 19:58:00 +0100 Subject: [PATCH] autoconf-archive: backport patch for C++23 support Backport upstream patch for C++23 support on ax_cxx_compile_stdcxx.m4. This is needed by Asterisk package to correctly configure. It's currently not possible to bump to a more recent autoconf-archive release 2024.10.16 as it's currently affected by multiple BUGs ([1]) [1] https://github.com/openwrt/openwrt/commit/e1acc7a67b92fa964710afe0a3ae2dad5c1f00c7 Signed-off-by: Christian Marangi --- ..._CXX_COMPILE_STDCXX-Add-C-23-support.patch | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 tools/autoconf-archive/patches/001-AX_CXX_COMPILE_STDCXX-Add-C-23-support.patch diff --git a/tools/autoconf-archive/patches/001-AX_CXX_COMPILE_STDCXX-Add-C-23-support.patch b/tools/autoconf-archive/patches/001-AX_CXX_COMPILE_STDCXX-Add-C-23-support.patch new file mode 100644 index 0000000000..c44409cc15 --- /dev/null +++ b/tools/autoconf-archive/patches/001-AX_CXX_COMPILE_STDCXX-Add-C-23-support.patch @@ -0,0 +1,90 @@ +From 833c9c2e5b65383c8c1353b6beb88f52dede640f Mon Sep 17 00:00:00 2001 +From: Olly Betts +Date: Wed, 29 May 2024 07:54:24 +1200 +Subject: [PATCH] AX_CXX_COMPILE_STDCXX: Add C++23 support + +--- + m4/ax_cxx_compile_stdcxx.m4 | 47 ++++++++++++++++++++++++++++++++++--- + 1 file changed, 44 insertions(+), 3 deletions(-) + +--- a/m4/ax_cxx_compile_stdcxx.m4 ++++ b/m4/ax_cxx_compile_stdcxx.m4 +@@ -10,8 +10,8 @@ + # + # Check for baseline language coverage in the compiler for the specified + # version of the C++ standard. If necessary, add switches to CXX and +-# CXXCPP to enable support. VERSION may be '11', '14', '17', or '20' for +-# the respective C++ standard version. ++# CXXCPP to enable support. VERSION may be '11', '14', '17', '20', or ++# '23' for the respective C++ standard version. + # + # The second argument, if specified, indicates whether you insist on an + # extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g. +@@ -43,7 +43,7 @@ + # and this notice are preserved. This file is offered as-is, without any + # warranty. + +-#serial 18 ++#serial 19 + + dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro + dnl (serial version number 13). +@@ -53,6 +53,7 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl + [$1], [14], [ax_cxx_compile_alternatives="14 1y"], + [$1], [17], [ax_cxx_compile_alternatives="17 1z"], + [$1], [20], [ax_cxx_compile_alternatives="20"], ++ [$1], [23], [ax_cxx_compile_alternatives="23"], + [m4_fatal([invalid first argument `$1' to AX_CXX_COMPILE_STDCXX])])dnl + m4_if([$2], [], [], + [$2], [ext], [], +@@ -186,6 +187,16 @@ m4_define([_AX_CXX_COMPILE_STDCXX_testbo + _AX_CXX_COMPILE_STDCXX_testbody_new_in_20 + ) + ++dnl Test body for checking C++23 support ++ ++m4_define([_AX_CXX_COMPILE_STDCXX_testbody_23], ++ _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 ++ _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 ++ _AX_CXX_COMPILE_STDCXX_testbody_new_in_17 ++ _AX_CXX_COMPILE_STDCXX_testbody_new_in_20 ++ _AX_CXX_COMPILE_STDCXX_testbody_new_in_23 ++) ++ + + dnl Tests for new features in C++11 + +@@ -1016,3 +1027,33 @@ namespace cxx20 + #endif // __cplusplus < 202002L && !defined _MSC_VER + + ]]) ++ ++ ++dnl Tests for new features in C++23 ++ ++m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_23], [[ ++ ++#ifndef __cplusplus ++ ++#error "This is not a C++ compiler" ++ ++#elif (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 202302L ++ ++#error "This is not a C++23 compiler" ++ ++#else ++ ++#include ++ ++namespace cxx23 ++{ ++ ++// As C++23 supports feature test macros in the standard, there is no ++// immediate need to actually test for feature availability on the ++// Autoconf side. ++ ++} // namespace cxx23 ++ ++#endif // (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 202302L ++ ++]])