-AT_CHECK([$CXX --version || exit 77], 0, ignore, ignore)
-AT_CHECK([$CXX $CXXFLAGS $CPPFLAGS m4_default([$2], [$1.c]) -o $1],
- 0, [], [ignore])])
+AT_CHECK([$BISON_CXX_WORKS], 0, ignore, ignore)
+AT_CHECK([$CXX $CXXFLAGS $CPPFLAGS m4_bmatch([$1], [[.]], [], [$LDFLAGS ])-o $1 m4_default([$2], [$1.cc])],
+ 0, [ignore], [ignore])])