tests: don't fail if the C++ compiler does not work

Also, make sure that `make dist` generates a correct tarball even if
the C++ compiler does not work.

Reported by Nelson H. F. Beebe.

* m4/cxx.m4 (BISON_CXX_WORKS): Define to true/false instead of
true/exit 77.  The latter is too dangerous to use (it directly quits).
(ENABLE_CXX): New name for the Automake conditional, for consistency
with ENABLE_CXX11 etc.
* tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Adjust to the new
semantics of BISON_CXX_WORKS.
* examples/c++/local.mk: Skip the variant test if C++ does not work.
* examples/calc++/local.mk: Likewise.
This commit is contained in:
Akim Demaille
2018-11-04 11:26:17 +01:00
parent e93c40b33d
commit cf1446dc9e
5 changed files with 29 additions and 29 deletions

View File

@@ -50,14 +50,12 @@ AC_DEFUN([BISON_TEST_FOR_WORKING_CXX_COMPILER],
AC_LANG_POP([C++])])
case $bison_cv_cxx_works in
yes)
BISON_CXX_WORKS=':';;
no | cross)
BISON_CXX_WORKS='exit 77';;
yes) BISON_CXX_WORKS=':';;
no | cross) BISON_CXX_WORKS='false';;
esac
AC_SUBST([BISON_CXX_WORKS])
AM_CONDITIONAL(BISON_CXX_WORKS, test $bison_cv_cxx_works = yes)
AM_CONDITIONAL([ENABLE_CXX], [test $bison_cv_cxx_works = yes])
])
# BISON_CXX_COMPILER_POSIXLY_CORRECT