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

The ax_ prefix is for macros that are copied from the
Autoconf archive project.

Signed-off-by: Michael Jeanson <mjeanson at efficios.com>
---
 configure.ac                |  4 ++--
 m4/ax_check_sdt_works.m4    | 20 ----------------
 m4/lttng_check_sdt_works.m4 | 46 +++++++++++++++++++++++++++++++++++++
 3 files changed, 48 insertions(+), 22 deletions(-)
 delete mode 100644 m4/ax_check_sdt_works.m4
 create mode 100644 m4/lttng_check_sdt_works.m4

diff --git a/configure.ac b/configure.ac
index f11d1b86..f95ccb7e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -25,8 +25,8 @@ AC_PROG_CXX
 rw_PROG_CXX_WORKS
 AM_CONDITIONAL([CXX_WORKS], [test "x$rw_cv_prog_cxx_works" = "xyes"])
 
-ax_CHECK_SDT_WORKS
-AM_CONDITIONAL([SDT_WORKS], [test "x$ax_check_sdt_works" = "xyes"])
+LTTNG_CHECK_SDT_WORKS
+AM_CONDITIONAL([SDT_WORKS], [test "x$lttng_cv_sdt_works" = "xyes"])
 
 # Checks for programs.
 AC_PROG_GREP
diff --git a/m4/ax_check_sdt_works.m4 b/m4/ax_check_sdt_works.m4
deleted file mode 100644
index 49ee6844..00000000
--- a/m4/ax_check_sdt_works.m4
+++ /dev/null
@@ -1,20 +0,0 @@
-# ac_CHECK_SDT_WORKS
-#
-# Check whether it's possible to build a binary with Systemtap SDT probes.
-
-AC_DEFUN([ax_CHECK_SDT_WORKS], [
-AC_COMPILE_IFELSE(
-[AC_LANG_SOURCE([[
-		#define SDT_USE_VARIADIC
-		#include <sys/sdt.h>
-		void fct(void)
-		{
-			STAP_PROBEV(provider,name,1,2,3,4,5,6,7,8,9,10);
-		}
-	]])], [
-		ax_check_sdt_works=yes
-	], [
-		ax_check_sdt_works=no
-	]
-)
-])
diff --git a/m4/lttng_check_sdt_works.m4 b/m4/lttng_check_sdt_works.m4
new file mode 100644
index 00000000..7f2a1ba5
--- /dev/null
+++ b/m4/lttng_check_sdt_works.m4
@@ -0,0 +1,46 @@
+# SYNOPSIS
+#
+#   LTTNG_CHECK_SDT_WORKS([ACTION-SUCCESS], [ACTION-FAILURE])
+#
+# DESCRIPTION
+#
+#   Check whether it's possible to build a binary with Systemtap SDT probes.
+#
+#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
+#   success/failure.
+#
+# LICENSE
+#
+#   Copyright (c) 2018 Francis Deslauriers <francis.deslauriers at efficios.com>
+#   Copyright (c) 2019 Michael Jeanson <mjeanson at efficios.com>
+#
+#   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([LTTNG_CHECK_SDT_WORKS], [
+  AC_CACHE_CHECK([whether SDT probes compile], [lttng_cv_sdt_works], [
+    AC_COMPILE_IFELSE([
+      AC_LANG_SOURCE([[
+	#define SDT_USE_VARIADIC
+	#include <sys/sdt.h>
+	void fct(void)
+	{
+		STAP_PROBEV(provider,name,1,2,3,4,5,6,7,8,9,10);
+	}
+      ]])
+    ], [
+      lttng_cv_sdt_works=yes
+    ], [
+      lttng_cv_sdt_works=no
+    ])
+  ])
+  AS_IF([test "x$lttng_cv_sdt_works" = "xyes"], [
+    m4_default([$1], :)
+  ], [
+    m4_default([$2], :)
+  ])
+])
-- 
2.17.1



  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 ` Michael Jeanson [this message]
2019-04-16 20:43 ` [lttng-dev] [PATCH lttng-tools 3/5] Harmonize rw_prog_cxx_works macro across projects Michael Jeanson
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-2-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