]> Savannah Git Hosting - gnulib.git/commitdiff
uchar C++ tests: Fix side effect on math modules (regr. 2020-08-17).
authorBruno Haible <bruno@clisp.org>
Wed, 19 Aug 2020 01:18:52 +0000 (03:18 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 19 Aug 2020 01:18:52 +0000 (03:18 +0200)
* modules/uchar-c++-tests (configure.ac): Don't use AC_LANG_PUSH and
AC_LANG_POP.

ChangeLog
modules/uchar-c++-tests

index 9ba0cda9276633c7cbbf8938fbfc39482dd01319..cbd3803a3c1106480c60115c61936958ac2ba4dd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2020-08-18  Bruno Haible  <bruno@clisp.org>
+
+       uchar C++ tests: Fix side effect on math modules (regr. 2020-08-17).
+       * modules/uchar-c++-tests (configure.ac): Don't use AC_LANG_PUSH and
+       AC_LANG_POP.
+
 2020-08-17  Paul Eggert  <eggert@cs.ucla.edu>
 
        verify: avoid __built_assume on Clang
index 2cbc3312b52a95e6748b1b4e3f1cdea3084ee2b0..351bdff7b591ff9131c4b9fa631db71196d69d15 100644 (file)
@@ -16,15 +16,16 @@ 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],
-    [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++])
+    [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*
     ])
 else
   gl_cv_cxxheader_cuchar=no