m4_define([AT_COMPILE_CXX],
[AT_KEYWORDS(c++)
AT_CHECK([$CXX --version || exit 77], 0, ignore, ignore)
-AT_CHECK([$CXX $CFLAGS $CPPFLAGS m4_default([$2], [$1.c]) -o $1],
+AT_CHECK([$CXX $CXXFLAGS $CPPFLAGS m4_default([$2], [$1.c]) -o $1],
0, [], [ignore])])