+
+ AC_LANG_PUSH(C++)
+ if test "x$cf_with_cxx" != xno
+ then
+ # Several of the C++ configurations do not work, particularly when
+ # cross-compiling (20140913 -TD)
+ AC_MSG_CHECKING(if $CXX works)
+
+ save_CPPFLAGS="$CPPFLAGS"
+ eval cf_includedir=${includedir}
+ CPPFLAGS="$CPPFLAGS -I${cf_includedir}"
+ AC_TRY_COMPILE([
+#include <stdlib.h>
+#include <stdio.h>
+],
+ [
+ printf("Hello world!\n")
+ ],
+ [cf_cxx_works=yes],
+ [cf_cxx_works=no])
+ CPPFLAGS="$save_CPPFLAGS"
+
+ AC_MSG_RESULT($cf_cxx_works)
+ if test "x$cf_cxx_works" = xno
+ then
+ AC_MSG_WARN([Ignore $CXX, since it cannot compile hello-world.])
+ cf_with_cxx=no; CXX=""; GXX="";
+ fi
+ fi
+ AC_LANG_POP
+