don't build C++ example if a C++ compiler isn't available
A message that is not in the archive (sent off-list or not yet received): [email protected]
Mathieu Desnoyers
AppliedQuoted 5 lines · * Samuel Martin ([email protected]) wrote:
By default lttng-ust builds a hello.cxx C++ example that demonstrates the usage of the userspace tracing library in a C++ program. Unfortunately, when no C++ support is available, the build of lttng-ust fails just because of this example code. So we make the compilation of this code conditional on whether a working C++ compiler was found.
merged into master, stable-2.1, stable-2.0 branches,
Thanks!
Mathieu
Quoted 56 lines
Signed-off-by Thomas Petazzoni <[email protected]>Signed-off-by Samuel Martin <[email protected]>--- configure.ac | 12 ++++++++++++ tests/Makefile.am | 6 +++++- 2 files changed, 17 insertions(+), 1 deletion(-)configure.ac +12
-0@@ -77,6 +77,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], [tests/Makefile.am +5
-1@@ -1,7 +1,11 @@ SUBDIRS = . hello hello-static-lib fork ust-basic-tracing ust-multi-test \ - demo hello.cxx daemon + demo daemon #SUBDIRS = . hello2 basic basic_long simple_include snprintf test-nevents test-libustinstr-malloc dlopen same_line_marker trace_event register_test tracepoint libustctl_function_tests exit-fast +if CXX_WORKS +SUBDIRS += hello.cxx +endif + dist_noinst_SCRIPTS = test_loop runtests trace_matches noinst_LIBRARIES = libtap.aSignature · 7 lines
1.8.1 _______________________________________________ lttng-dev mailing list [email protected] http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
Signature · 3 lines
Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com