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
7 # Script copied from the lttng-ust project.
9 AC_DEFUN([rw_PROG_CXX_WORKS], [
10 AC_REQUIRE([AC_PROG_CXX])
11 AC_CACHE_CHECK([whether the C++ compiler works],
12 [rw_cv_prog_cxx_works],
15 AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [
16 check_cxx_designated_initializers=yes
18 rw_cv_prog_cxx_works=no
21 AS_IF([test "x$check_cxx_designated_initializers" = "xyes"], [
22 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
23 struct foo { int a; int b; };
26 struct foo f = { .a = 0, .b = 1 };
29 rw_cv_prog_cxx_works=yes
31 rw_cv_prog_cxx_works=no