3 # Check whether the C++ compiler works. There's a bit of oversight in
4 # autoconf that will set the C++ compiler to g++ if no compiler is found,
5 # even if g++ is not present! So we need an extra test to make sure that
8 AC_DEFUN([rw_PROG_CXX_WORKS], [
9 AC_REQUIRE([AC_PROG_CXX])
10 AC_CACHE_CHECK([whether the C++ compiler works],
11 [rw_cv_prog_cxx_works],
14 AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [
15 check_cxx_designated_initializers=yes
17 rw_cv_prog_cxx_works=no
20 AS_IF([test "x$check_cxx_designated_initializers" = "xyes"], [
21 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
22 struct foo { int a; int b; };
25 struct foo f = { .a = 0, .b = 1 };
28 rw_cv_prog_cxx_works=yes
30 rw_cv_prog_cxx_works=no