From: Bruno Haible Date: Mon, 7 Dec 2020 13:05:09 +0000 (+0100) Subject: Correct interaction between gl_ANSI_CXX and AC_PROG_CXX. X-Git-Tag: v1.0~3405 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=a0654cff8f1cbb705fbcba80841c58747b993440;p=gnulib.git Correct interaction between gl_ANSI_CXX and AC_PROG_CXX. Suggested by Zack Weinberg in . * m4/ansi-c++.m4 (gl_ANSI_CXX): Mark AC_PROG_CXX as provided. * modules/uchar-c++-tests: Revert the workaround from 2020-08-18. --- diff --git a/ChangeLog b/ChangeLog index 6dfedc47f3..249a50ba11 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,12 @@ -2020-12-06 Bruno Haible +2020-12-07 Bruno Haible + + Correct interaction between gl_ANSI_CXX and AC_PROG_CXX. + Suggested by Zack Weinberg in + . + * 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 Tweak the Windows oldnames workaround. Reported by Daniel R. Hurtmans in diff --git a/m4/ansi-c++.m4 b/m4/ansi-c++.m4 index f93c324335..1b81996dad 100644 --- a/m4/ansi-c++.m4 +++ b/m4/ansi-c++.m4 @@ -1,4 +1,4 @@ -# 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, @@ -145,4 +145,8 @@ EOF 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 . + m4_provide([AC_PROG_CXX]) ]) diff --git a/modules/uchar-c++-tests b/modules/uchar-c++-tests index 351bdff7b5..2cbc3312b5 100644 --- a/modules/uchar-c++-tests +++ b/modules/uchar-c++-tests @@ -16,16 +16,15 @@ if test "$CXX" != no; then dnl have the header file from C++11. AC_CACHE_CHECK([whether the C++ compiler has ], [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 . - echo '#include ' > 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 ]], + [[]]) + ], + [gl_cv_cxxheader_cuchar=yes], + [gl_cv_cxxheader_cuchar=no]) + AC_LANG_POP([C++]) ]) else gl_cv_cxxheader_cuchar=no