Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: mjeanson@efficios.com (Michael Jeanson)
Subject: [lttng-dev] [PATCH lttng-tools 3/5] Harmonize rw_prog_cxx_works macro across projects
Date: Tue, 16 Apr 2019 16:43:46 -0400	[thread overview]
Message-ID: <20190416204348.29127-3-mjeanson@efficios.com> (raw)
In-Reply-To: <20190416204348.29127-1-mjeanson@efficios.com>

Signed-off-by: Michael Jeanson <mjeanson at efficios.com>
---
 configure.ac            |  2 +-
 m4/rw_prog_cxx_works.m4 | 69 ++++++++++++++++++++++++-----------------
 2 files changed, 42 insertions(+), 29 deletions(-)

diff --git a/configure.ac b/configure.ac
index f95ccb7e..f0a4d975 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@ AC_SYS_LARGEFILE
 AC_PROG_CC
 AC_PROG_CC_STDC
 AC_PROG_CXX
-rw_PROG_CXX_WORKS
+RW_PROG_CXX_WORKS
 AM_CONDITIONAL([CXX_WORKS], [test "x$rw_cv_prog_cxx_works" = "xyes"])
 
 LTTNG_CHECK_SDT_WORKS
diff --git a/m4/rw_prog_cxx_works.m4 b/m4/rw_prog_cxx_works.m4
index 1950d94d..f3d6bde6 100644
--- a/m4/rw_prog_cxx_works.m4
+++ b/m4/rw_prog_cxx_works.m4
@@ -1,37 +1,50 @@
-# rw_PROG_CXX_WORKS
+# SYNOPSIS
 #
-# Check whether the C++ compiler works. There's a bit of oversight in
-# autoconf that will set the C++ compiler to g++ if no compiler is found,
-# even if g++ is not present! So we need an extra test to make sure that
-# the compiler works.
-# Script copied from the lttng-ust project.
+#   RW_PROG_CXX_WORKS
 #
-AC_DEFUN([rw_PROG_CXX_WORKS], [
+# DESCRIPTION
+#
+#   RW_PROG_CXX_WORKS checks whether the C++ compiler works.
+#
+#   There's a bit of oversight in autoconf that will set the C++ compiler to
+#   g++ if no compiler is found, even if g++ is not present! So we need an
+#   extra test to make sure that the compiler works.
+#
+# LICENSE
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved. This file is offered as-is, without any
+#   warranty.
+
+#serial 1
+
+AC_DEFUN([RW_PROG_CXX_WORKS], [
 AC_REQUIRE([AC_PROG_CXX])
 AC_CACHE_CHECK([whether the C++ compiler works],
-   [rw_cv_prog_cxx_works],
-   [AC_LANG_PUSH([C++])
+	[rw_cv_prog_cxx_works],
+	[AC_LANG_PUSH([C++])
 
-   AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [
-       check_cxx_designated_initializers=yes
-   ], [
-       rw_cv_prog_cxx_works=no
-   ])
+	AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [
+		check_cxx_designated_initializers=yes
+	], [
+		rw_cv_prog_cxx_works=no
+	])
 
-   AS_IF([test "x$check_cxx_designated_initializers" = "xyes"], [
-       AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
-           struct foo { int a; int b; };
-           void fct(void)
-           {
-               struct foo f = { .a = 0, .b = 1 };
-           }
-       ]])], [
-           rw_cv_prog_cxx_works=yes
-       ], [
-           rw_cv_prog_cxx_works=no
-       ])
-   ])
+	AS_IF([test "x$check_cxx_designated_initializers" = "xyes"], [
+		AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+			struct foo { int a; int b; };
+			void fct(void)
+			{
+				struct foo f = { .a = 0, .b = 1 };
+			}
+		]])], [
+			rw_cv_prog_cxx_works=yes
+		], [
+			rw_cv_prog_cxx_works=no
+		])
+	])
 
-   AC_LANG_POP([C++])
+	AC_LANG_POP([C++])
 ])
 ])
-- 
2.17.1



  parent reply	other threads:[~2019-04-16 20:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-16 20:43 [lttng-dev] [PATCH lttng-tools 1/5] Update macros from the autoconf archive Michael Jeanson
2019-04-16 20:43 ` [lttng-dev] [PATCH lttng-tools 2/5] Namespace check_sdt_works custom macro Michael Jeanson
2019-04-16 20:43 ` Michael Jeanson [this message]
2019-04-16 20:43 ` [lttng-dev] [PATCH lttng-tools 4/5] Update the ac_define_dir macro from the autoconf archive Michael Jeanson
2019-04-16 20:43 ` [lttng-dev] [PATCH lttng-tools 5/5] Harmonize pprint macro across projects Michael Jeanson
2019-04-25 18:28 ` [lttng-dev] [PATCH lttng-tools 1/5] Update macros from the autoconf archive Jérémie Galarneau

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=20190416204348.29127-3-mjeanson@efficios.com \
    --to=mjeanson@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