diff --git a/tests/atlocal.in b/tests/atlocal.in index b66e9543..0b888d16 100644 --- a/tests/atlocal.in +++ b/tests/atlocal.in @@ -62,3 +62,10 @@ CONF_JAVA='@CONF_JAVA@' # Use simple quotes (lib/quote.c). LC_CTYPE=C export LC_CTYPE + + +# Handle --compile-c-with-cxx here, once CXX and CXXFLAGS are known. +if "$at_arg_compile_c_with_cxx"; then + CC=$CXX + CFLAGS=$CXXFLAGS +fi diff --git a/tests/local.at b/tests/local.at index a8b38762..2e975d0a 100644 --- a/tests/local.at +++ b/tests/local.at @@ -634,4 +634,15 @@ m4_popdef([AT_COND_CASE])]) AT_INIT +# Cannot assign CC and CFLAGS here, since atlocal is loaded after +# options are processed, so we don't know the value of CXX and +# CXXFLAGS yet. +# +# Note that it also means that command line values for CXX and +# CXXFLAGS will not be propagated to CC and CFLAGS. +AT_ARG_OPTION([compile-c-with-cxx], + [compile C parsers with the C++ compiler]) + +AT_COLOR_TESTS + AT_TESTED([bison]) diff --git a/tests/local.mk b/tests/local.mk index 183c371d..12668c41 100644 --- a/tests/local.mk +++ b/tests/local.mk @@ -97,8 +97,8 @@ installcheck-local: $(RUN_TESTSUITE_deps) # Be real mean with it. .PHONY: maintainer-check-g++ - $(RUN_TESTSUITE) CC='$(CXX)' maintainer-check-g++: $(RUN_TESTSUITE_deps) + $(RUN_TESTSUITE) --compile-c-with-cxx .PHONY: maintainer-check-posix maintainer-check-posix: $(RUN_TESTSUITE_deps)