]> Savannah Git Hosting - gnulib.git/commitdiff
Correct interaction between gl_ANSI_CXX and AC_PROG_CXX.
authorBruno Haible <bruno@clisp.org>
Mon, 7 Dec 2020 13:05:09 +0000 (14:05 +0100)
committerBruno Haible <bruno@clisp.org>
Mon, 7 Dec 2020 13:05:09 +0000 (14:05 +0100)
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.

ChangeLog
m4/ansi-c++.m4
modules/uchar-c++-tests

index 6dfedc47f358898d8c8738d812e3faf4d3bd4083..249a50ba1152d305d9aab45f8fc5d8735f249ab9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,12 @@
-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
index f93c324335bb007e56119f382f0f0188c19adcfc..1b81996dad2533b4914b569b91af7b4912a41f8d 100644 (file)
@@ -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 <https://savannah.gnu.org/support/?110294>.
+  m4_provide([AC_PROG_CXX])
 ])
index 351bdff7b591ff9131c4b9fa631db71196d69d15..2cbc3312b52a95e6748b1b4e3f1cdea3084ee2b0 100644 (file)
@@ -16,16 +16,15 @@ if test "$CXX" != no; then
   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