Fix: don't build C++ example if a C++ compiler isn't available
[lttng-ust.git] / configure.ac
index b442a81dc271eb7bb1f10739d6e0defb04b49931..24d16e9d4bfdbfd3615db0ac490dff1949dd0d78 100644 (file)
@@ -72,6 +72,18 @@ AC_PROG_CXX
 AC_PROG_MAKE_SET
 LT_INIT
 
+# rw_PROG_CXX_WORKS
+# Check whether the C++ compiler works.
+AC_CACHE_CHECK([whether the C++ compiler works],
+               [rw_cv_prog_cxx_works],
+               [AC_LANG_PUSH([C++])
+               AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
+                               [rw_cv_prog_cxx_works=yes],
+                               [rw_cv_prog_cxx_works=no])
+               AC_LANG_POP([C++])])
+
+AM_CONDITIONAL([CXX_WORKS], [test "x$rw_cv_prog_cxx_works" = "xyes"])
+
 ## Checks for libraries.
 AC_CHECK_LIB([dl], [dlopen])
 AC_CHECK_LIB([pthread], [pthread_create])
This page took 0.023738 seconds and 4 git commands to generate.