[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[sr #110294] AC_LANG_PUSH/AC_LANG_POP malfunction inside AC_DEFUN
From: |
Zack Weinberg |
Subject: |
[sr #110294] AC_LANG_PUSH/AC_LANG_POP malfunction inside AC_DEFUN |
Date: |
Sun, 6 Dec 2020 17:18:42 -0500 (EST) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0 |
Update of sr #110294 (project autoconf):
Status: None => Invalid
Open/Closed: Open => Closed
_______________________________________________________
Follow-up Comment #2:
After a bunch of head-scratching I have figured out what's going on. This
code
AC_LANG_PUSH([C++])
AC_CACHE_CHECK([whether the C++ compiler has <cuchar>],
[gl_cv_cxxheader_cuchar],
[
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#include <cuchar>]],
[[]])
],
[gl_cv_cxxheader_cuchar=yes],
[gl_cv_cxxheader_cuchar=no])
])
AC_LANG_POP([C++])
-verbatim+
invokes AC_COMPILE_IFELSE with the current language set to C++.
AC_COMPILE_IFELSE calls AC_LANG_COMPILER_REQUIRE, which AC_REQUIREs
AC_LANG_COMPILER(C++), which AC_REQUIREs AC_PROG_CXX. Because of your earlier
"kind of an optional AC_PROG_CXX" code, this causes the AC_LANG machinery to
get confused about what the correct setting for $ac_compile is, for checks in
between the top of the AC_DEFUN and the AC_LANG_PUSH.
We can't support your code as-is in Autoconf 2.70. However, I can offer you a
simple workaround. Move all of the "optional AC_PROG_CXX" code into a new
AC_DEFUN. Make the last line of that AC_DEFUN be
m4_provide([AC_PROG_CXX])
(right after the "Determine a good default for CXXFLAGS" if-block).
In my testing, those modifications make your sample configure script work
correctly. They should be harmless with 2.69.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/support/?110294>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [sr #110294] AC_LANG_PUSH/AC_LANG_POP malfunction inside AC_DEFUN,
Zack Weinberg <=