From: Paul Eggert Date: Sun, 30 May 2004 00:56:57 +0000 (+0000) Subject: Fix some "make check" problems with Tru64 C++. X-Git-Tag: BISON-2_0~142 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/0797198341a1753f7f03569f69e9abdd2fd2ed14?ds=inline Fix some "make check" problems with Tru64 C++. --- diff --git a/ChangeLog b/ChangeLog index 6ff584f1..5d97691e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2004-05-29 Paul Eggert + + Fix some "make check" problems with C++ reported by + Albert Chin-A-Young for Tru64 C++ in this thread: + http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html + + * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr. + * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): + Output to a .cc file for C++, not to a .c file. + * tests/calc.at (AT_CHECK_CALC): Likewise. + * tests/regression.at (AT_CHECK_DANCER): Likewise. + * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c. + 2004-05-28 Albert Chin-A-Young * tests/calc.at, tests/actions.at: Workaround for SGI diff --git a/m4/cxx.m4 b/m4/cxx.m4 index 1d17e836..4394b049 100644 --- a/m4/cxx.m4 +++ b/m4/cxx.m4 @@ -29,7 +29,8 @@ AC_DEFUN([BISON_TEST_FOR_WORKING_CXX_COMPILER], [AC_LANG_PROGRAM( [#include using namespace std;], - [cout << "";])], + [std::cerr << ""; + cout << "";])], [bison_cv_cxx_works=yes], [bison_cv_cxx_works=no], [bison_cv_cxx_works=cross]) diff --git a/tests/actions.at b/tests/actions.at index 87126e88..6dfb6f15 100644 --- a/tests/actions.at +++ b/tests/actions.at @@ -500,9 +500,11 @@ main (void) } ]]) -AT_CHECK([bison -o input.c input.y]) -AT_LALR1_CC_IF([AT_COMPILE_CXX([input])], - [AT_COMPILE([input])]) +AT_LALR1_CC_IF( + [AT_CHECK([bison -o input.cc input.y]) + AT_COMPILE_CXX([input])], + [AT_CHECK([bison -o input.c input.y]) + AT_COMPILE([input])]) AT_PARSER_CHECK([./input], 1, [[sending: 'x' (0@0-9) thing (0@0-9): 'x' (0@0-9) diff --git a/tests/calc.at b/tests/calc.at index 7da26178..f54cebcb 100644 --- a/tests/calc.at +++ b/tests/calc.at @@ -442,11 +442,11 @@ AT_BISON_OPTION_PUSHDEFS([$1]) AT_DATA_CALC_Y([$1]) -# Specify the output files to avoid problems on different file systems. -AT_CHECK([bison -o calc.c calc.y]) - -AT_LALR1_CC_IF([AT_COMPILE_CXX([calc])], - [AT_COMPILE([calc])]) +AT_LALR1_CC_IF( + [AT_CHECK([bison -o calc.cc calc.y]) + AT_COMPILE_CXX([calc])], + [AT_CHECK([bison -o calc.c calc.y]) + AT_COMPILE([calc])]) # Test the priorities. _AT_CHECK_CALC([$1], diff --git a/tests/local.at b/tests/local.at index aba19079..4a9331b4 100644 --- a/tests/local.at +++ b/tests/local.at @@ -173,13 +173,13 @@ m4_define([AT_COMPILE], [AT_CHECK([$CC $CFLAGS $CPPFLAGS m4_bmatch([$1], [[.]], [], [$LDFLAGS ])m4_default([$2], [$1.c]) m4_bmatch([$1], [[.]], [], [$LIBS ])-o $1], 0, [ignore], [ignore])]) -# AT_COMPILE_CXX(OUTPUT, [SOURCES = OUTPUT.c]) +# AT_COMPILE_CXX(OUTPUT, [SOURCES = OUTPUT.cc]) # -------------------------------------------- # If the C++ compiler does not work, ignore the test. m4_define([AT_COMPILE_CXX], [AT_KEYWORDS(c++) AT_CHECK([$BISON_CXX_WORKS], 0, ignore, ignore) -AT_CHECK([$CXX $CXXFLAGS $CPPFLAGS m4_default([$2], [$1.c]) -o $1], +AT_CHECK([$CXX $CXXFLAGS $CPPFLAGS m4_default([$2], [$1.cc]) -o $1], 0, [ignore], [ignore])]) diff --git a/tests/regression.at b/tests/regression.at index 94422bd3..ebc3e874 100644 --- a/tests/regression.at +++ b/tests/regression.at @@ -780,8 +780,11 @@ m4_define([AT_CHECK_DANCER], AT_BISON_OPTION_PUSHDEFS([$1]) _AT_DATA_DANCER_Y([$1]) AT_CHECK([bison -o dancer.c dancer.y]) -AT_LALR1_CC_IF([AT_COMPILE_CXX([dancer])], - [AT_COMPILE([dancer])]) +AT_LALR1_CC_IF( + [AT_CHECK([bison -o dancer.cc dancer.y]) + AT_COMPILE_CXX([dancer])], + [AT_CHECK([bison -o dancer.c dancer.y]) + AT_COMPILE([dancer])]) AT_PARSER_CHECK([./dancer], 1, [], [syntax error, unexpected ':' ])