Namespace check_sdt_works custom macro
authorMichael Jeanson <mjeanson@efficios.com>
Tue, 16 Apr 2019 20:43:45 +0000 (16:43 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 24 Apr 2019 22:37:40 +0000 (18:37 -0400)
The ax_ prefix is for macros that are copied from the
Autoconf archive project.

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
configure.ac
m4/ax_check_sdt_works.m4 [deleted file]
m4/lttng_check_sdt_works.m4 [new file with mode: 0644]

index 136a7507668c7914432678a826e0c2af4a718a43..256b522274007ecba3f9aa1ba35443cebe4ee19a 100644 (file)
@@ -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 (file)
index 49ee684..0000000
+++ /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 (file)
index 0000000..7f2a1ba
--- /dev/null
@@ -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@efficios.com>
+#   Copyright (c) 2019 Michael Jeanson <mjeanson@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], :)
+  ])
+])
This page took 0.027083 seconds and 4 git commands to generate.