7 # RW_PROG_CXX_WORKS checks whether the C++ compiler works.
9 # There's a bit of oversight in autoconf that will set the C++ compiler to
10 # g++ if no compiler is found, even if g++ is not present! So we need an
11 # extra test to make sure that the compiler works.
15 # Copying and distribution of this file, with or without modification, are
16 # permitted in any medium without royalty provided the copyright notice
17 # and this notice are preserved. This file is offered as-is, without any
22 AC_DEFUN([RW_PROG_CXX_WORKS], [
23 AC_REQUIRE([AC_PROG_CXX])
24 AC_CACHE_CHECK([whether the C++ compiler works],
25 [rw_cv_prog_cxx_works],
28 AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [
29 check_cxx_designated_initializers=yes
31 rw_cv_prog_cxx_works=no
34 AS_IF([test "x$check_cxx_designated_initializers" = "xyes"], [
35 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
36 struct foo { int a; int b; };
39 struct foo f = { .a = 0, .b = 1 };
42 rw_cv_prog_cxx_works=yes
44 rw_cv_prog_cxx_works=no