From: mathieu.desnoyers@efficios.com (Mathieu Desnoyers)
Subject: [lttng-dev] [PATCH] don't build C++ example if a C++ compiler isn't available
Date: Sun, 13 Jan 2013 11:44:55 -0500 [thread overview]
Message-ID: <20130113164455.GA31623@Krystal> (raw)
In-Reply-To: <1357979088-28687-1-git-send-email-s.martin49@gmail.com>
* Samuel Martin (s.martin49 at gmail.com) 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
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>
> Signed-off-by: Samuel Martin <s.martin49 at gmail.com>
> ---
> configure.ac | 12 ++++++++++++
> tests/Makefile.am | 6 +++++-
> 2 files changed, 17 insertions(+), 1 deletion(-)
>
> diff --git a/configure.ac b/configure.ac
> index c4377a5..d33be32 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -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],
> [
> diff --git a/tests/Makefile.am b/tests/Makefile.am
> index 2b12422..7365ce4 100644
> --- a/tests/Makefile.am
> +++ b/tests/Makefile.am
> @@ -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.a
> --
> 1.8.1
>
>
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
--
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
prev parent reply other threads:[~2013-01-13 16:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-12 8:24 Samuel Martin
2013-01-13 16:44 ` Mathieu Desnoyers [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130113164455.GA31623@Krystal \
--to=mathieu.desnoyers@efficios.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox