From: Akim Demaille Date: Fri, 23 Mar 2012 15:05:15 +0000 (+0100) Subject: tests: when using the C++ compiler, use its flags too. X-Git-Tag: v2.5.1_rc2~75 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/c84134b6440bdae276bd3d1b4d54951ddc75de93 tests: when using the C++ compiler, use its flags too. * tests/local.at: Go for colors. (--compile-c-with-cxx): New option. We used to pass "CC=$CXX" as command line argument, but it was not possible to adjust CFLAGS accordingly in atlocal, since it is loaded before assignments on the command line are honored (so that the command line takes precedence). * tests/atlocal.in: Implement it. * tests/local.mk: Use it. (cherry picked from commit ac3f2e33b464a168b84ddb8a2da2195a6656dd19) Conflicts: tests/local.mk --- diff --git a/tests/Makefile.am b/tests/Makefile.am index bc59d660..7a2139df 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -78,7 +78,7 @@ installcheck-local: # Be real mean with it. .PHONY: maintainer-check-g++ maintainer-check-g++: $(TESTSUITE) - $(TESTSUITE) CC='$(CXX)' + $(TESTSUITE) --compile-c-with-cxx .PHONY: maintainer-check-posix maintainer-check-posix: $(TESTSUITE) diff --git a/tests/atlocal.in b/tests/atlocal.in index 8f5b1a90..11554b33 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 dd4cd555..462301db 100644 --- a/tests/local.at +++ b/tests/local.at @@ -629,4 +629,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])