-2020-12-06 Bruno Haible <bruno@clisp.org>
+2020-12-07 Bruno Haible <bruno@clisp.org>
+
+ Correct interaction between gl_ANSI_CXX and AC_PROG_CXX.
+ Suggested by Zack Weinberg in
+ <https://savannah.gnu.org/support/?110294>.
+ * m4/ansi-c++.m4 (gl_ANSI_CXX): Mark AC_PROG_CXX as provided.
+ * modules/uchar-c++-tests: Revert the workaround from 2020-08-18.
+
+2020-12-07 Bruno Haible <bruno@clisp.org>
Tweak the Windows oldnames workaround.
Reported by Daniel R. Hurtmans <Daniel.Hurtmans@ulb.ac.be> in
-# ansi-c++.m4 serial 11
+# ansi-c++.m4 serial 12
dnl Copyright (C) 2002-2003, 2005, 2010-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
AC_DEFUN([gl_ANSI_CXX],
[
gl_PROG_ANSI_CXX([CXX], [ANSICXX])
+ dnl This line is needed in order to avoid trouble with Autoconf. It makes
+ dnl sure that Autoconf does not insert expansions of AC_PROG_CXX at random
+ dnl places. See <https://savannah.gnu.org/support/?110294>.
+ m4_provide([AC_PROG_CXX])
])
dnl have the <cuchar> header file from C++11.
AC_CACHE_CHECK([whether the C++ compiler has <cuchar>],
[gl_cv_cxxheader_cuchar],
- [dnl We can't use AC_LANG_PUSH([C++]) and AC_LANG_POP([C++]) here, due to
- dnl an autoconf bug <https://savannah.gnu.org/support/?110294>.
- echo '#include <cuchar>' > conftest.cpp
- gl_command="$CXX $CXXFLAGS $CPPFLAGS -c conftest.cpp"
- if AC_TRY_EVAL([gl_command]); then
- gl_cv_cxxheader_cuchar=yes
- else
- gl_cv_cxxheader_cuchar=no
- fi
- rm -fr conftest*
+ [AC_LANG_PUSH([C++])
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <cuchar>]],
+ [[]])
+ ],
+ [gl_cv_cxxheader_cuchar=yes],
+ [gl_cv_cxxheader_cuchar=no])
+ AC_LANG_POP([C++])
])
else
gl_cv_cxxheader_cuchar=no