commit:     9e3d332825999fbdc9573158f418e14dd60f853a
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 29 04:04:49 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Nov 29 04:08:11 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9e3d3328

dev-build/autoconf: backport patch for C++20 vs C++17 compiler test

slyfox mentioned that autoconf gets confused and downgrades to -std=gnu++11
from -std=gnu++17 (which autoconf defaults to) because the test is built
using -std=gnu++20 (new default) and it's invalid there.

Digging into that, it looks like it got fixed already a little while ago
by Paul, so just backport the patch.

Reported-by: Sergei Trofimovich <slyich <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-build/autoconf/autoconf-2.72-r5.ebuild         | 104 +++++++++++++++++++++
 .../autoconf-2.72-Port-C11-test-to-C-20.patch      |  28 ++++++
 2 files changed, 132 insertions(+)

diff --git a/dev-build/autoconf/autoconf-2.72-r5.ebuild 
b/dev-build/autoconf/autoconf-2.72-r5.ebuild
new file mode 100644
index 000000000000..440a2e6e897a
--- /dev/null
+++ b/dev-build/autoconf/autoconf-2.72-r5.ebuild
@@ -0,0 +1,104 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# Bumping notes:
+# * Remember to modify LAST_KNOWN_VER 'upstream' in dev-build/autoconf-wrapper
+# on new autoconf releases, as well as the dependency in RDEPEND below too.
+# * Update _WANT_AUTOCONF and _autoconf_atom case statement in 
autotools.eclass.
+
+if [[ ${PV} == 9999 ]] ; then
+       EGIT_REPO_URI="https://git.savannah.gnu.org/git/autoconf.git";
+       inherit git-r3
+else
+       # For _beta handling replace with real version number
+       MY_PV="${PV}"
+       MY_P="${PN}-${MY_PV}"
+       #PATCH_TARBALL_NAME="${PN}-2.70-patches-01"
+
+       VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/zackweinberg.asc
+       inherit verify-sig
+
+       SRC_URI="
+               mirror://gnu/${PN}/${MY_P}.tar.xz
+               https://alpha.gnu.org/pub/gnu/${PN}/${MY_P}.tar.xz
+               https://meyering.net/ac/${P}.tar.xz
+               verify-sig? ( mirror://gnu/${PN}/${MY_P}.tar.xz.sig )
+       "
+       S="${WORKDIR}"/${MY_P}
+
+       if [[ ${PV} != *_beta* ]] && ! [[ $(ver_cut 3) =~ [a-z] ]] ; then
+               KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips 
~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos 
~ppc-macos ~x64-macos ~x64-solaris"
+       fi
+
+       BDEPEND="verify-sig? ( sec-keys/openpgp-keys-zackweinberg )"
+fi
+
+inherit toolchain-autoconf multiprocessing
+
+DESCRIPTION="Used to create autoconfiguration files"
+HOMEPAGE="https://www.gnu.org/software/autoconf/autoconf.html";
+
+LICENSE="GPL-3+"
+SLOT="$(ver_cut 1-2)"
+
+BDEPEND+="
+       >=dev-lang/perl-5.10
+       >=sys-devel/m4-1.4.16
+"
+RDEPEND="
+       ${BDEPEND}
+       >=dev-build/autoconf-wrapper-20231224
+       sys-devel/gnuconfig
+       !~${CATEGORY}/${P}:2.5
+"
+[[ ${PV} == 9999 ]] && BDEPEND+=" >=sys-apps/texinfo-4.3"
+
+PATCHES=(
+       
"${FILESDIR}"/${PN}-2.72-gettext-0.25-autoreconf-Invoke-autopoint-in-more-situations.patch
+       
"${FILESDIR}"/${PN}-2.72-gettext-0.25-autoreconf-Adapt-to-the-on-disk-situation-after-auto.patch
+       "${FILESDIR}"/${PN}-2.72-Port-C11-test-to-C-20.patch
+)
+
+src_prepare() {
+       if [[ ${PV} == *9999 ]] ; then
+               # Avoid the "dirty" suffix in the git version by generating it
+               # before we run later stages which might modify source files.
+               local ver=$(./build-aux/git-version-gen .tarball-version)
+               echo "${ver}" > .tarball-version || die
+
+               autoreconf -f -i || die
+       fi
+
+       # usr/bin/libtool is provided by binutils-apple, need gnu libtool
+       if [[ ${CHOST} == *-darwin* ]] ; then
+               PATCHES+=( "${FILESDIR}"/${PN}-2.71-darwin.patch )
+       fi
+
+       # Save timestamp to avoid later makeinfo call
+       touch -r doc/{,old_}autoconf.texi || die
+
+       toolchain-autoconf_src_prepare
+
+       # Restore timestamp to avoid makeinfo call
+       # We already have an up to date autoconf.info page at this point.
+       touch -r doc/{old_,}autoconf.texi || die
+}
+
+src_test() {
+       emake check TESTSUITEFLAGS="--jobs=$(get_makeopts_jobs)"
+}
+
+src_install() {
+       toolchain-autoconf_src_install
+
+       # dissuade Portage from removing our dir file
+       touch "${ED}"/usr/share/${P}/info/.keepinfodir || die
+
+       local f
+       for f in config.{guess,sub} ; do
+               ln -fs ../../gnuconfig/${f} \
+                       "${ED}"/usr/share/autoconf-*/build-aux/${f} || die
+       done
+}

diff --git a/dev-build/autoconf/files/autoconf-2.72-Port-C11-test-to-C-20.patch 
b/dev-build/autoconf/files/autoconf-2.72-Port-C11-test-to-C-20.patch
new file mode 100644
index 000000000000..798e2936e4d0
--- /dev/null
+++ b/dev-build/autoconf/files/autoconf-2.72-Port-C11-test-to-C-20.patch
@@ -0,0 +1,28 @@
+From e6c9cb69c8c0a4ef9ce0538d7b4106dad3d7ad47 Mon Sep 17 00:00:00 2001
+From: Paul Eggert <[email protected]>
+Date: Sun, 26 May 2024 07:04:19 -0700
+Subject: [PATCH] Port C11 test to C++20
+
+Trivial fix suggested by Peter Johansson in:
+https://lists.gnu.org/r/autoconf/2024-05/msg00004.html
+* lib/autoconf/c.m4 (_AC_CXX_CXX11_TEST_MAIN):
+Do not test assigning u8"..." to char const *, as this
+runs afoul of C++20.
+---
+ lib/autoconf/c.m4 | 3 +--
+ 1 files changed, 1 insertions(+), 2 deletions(-)
+
+diff --git a/lib/autoconf/c.m4 b/lib/autoconf/c.m4
+index d4f7fbe..673d62e 100644
+--- a/lib/autoconf/c.m4
++++ b/lib/autoconf/c.m4
+@@ -2638,8 +2638,7 @@ ac_cxx_conftest_cxx11_main='
+   test_template<::test_template<int>> v(test_template<int>(12));
+ }
+ {
+-  // Unicode literals
+-  char const *utf8 = u8"UTF-8 string \u2500";
++  // Unicode literals.  Do not test u8"..." as C++20 would reject it.
+   char16_t const *utf16 = u"UTF-8 string \u2500";
+   char32_t const *utf32 = U"UTF-32 string \u2500";
+ }

Reply via email to