[ltt-dev] [UST PATCH] Add a version.h header.

Yannick Brosseau yannick.brosseau at gmail.com
Wed May 25 17:52:16 EDT 2011


It contains the major and minor version numbers

Signed-off-by: Yannick Brosseau <yannick.brosseau at gmail.com>
---
 .gitignore               |    1 +
 configure.ac             |    9 +++++++++
 include/Makefile.am      |    3 ++-
 include/ust/version.h.in |   27 +++++++++++++++++++++++++++
 4 files changed, 39 insertions(+), 1 deletions(-)
 create mode 100644 include/ust/version.h.in

diff --git a/.gitignore b/.gitignore
index 6ae624e..e9cac90 100644
--- a/.gitignore
+++ b/.gitignore
@@ -23,6 +23,7 @@ config.status
 stamp-h1
 libtool
 ust.pc
+include/ust/version.h
 
 ustctl/ustctl
 ust-consumerd/ust-consumerd
diff --git a/configure.ac b/configure.ac
index 5d91432..d8f64a0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -11,6 +11,14 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 AC_CONFIG_SRCDIR([ustctl/ustctl.c])
 AC_CONFIG_HEADERS([config.h include/ust/config.h])
 AH_TEMPLATE([HAVE_EFFICIENT_UNALIGNED_ACCESS], [Use efficient unaligned access.])
+# Compute minor/major version numbers
+major_version=`echo AC_PACKAGE_VERSION | sed 's/\..*//'`
+minor_version=`echo AC_PACKAGE_VERSION | sed 's/.*\.//' | sed 's/^0//'`
+AC_SUBST([MAJOR_VERSION], [$major_version])
+AC_SUBST([MINOR_VERSION], [$minor_version])
+AC_DEFINE_UNQUOTED([VERSION_MAJOR],$major_version, [UST major version number])
+AC_DEFINE_UNQUOTED([VERSION_MINOR],$minor_version, [UST  minor version number])
+
 
 # Checks for programs.
 AC_PROG_CC
@@ -175,5 +183,6 @@ AC_CONFIG_FILES([
 	libustctl/Makefile
 	snprintf/Makefile
 	ust.pc
+	include/ust/version.h
 ])
 AC_OUTPUT
diff --git a/include/Makefile.am b/include/Makefile.am
index 9fd7dee..045ba16 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -7,7 +7,8 @@ nobase_include_HEADERS = \
 	ust/config.h \
 	ust/stringify.h \
 	ust/ustctl.h \
-	ust/ustconsumer.h
+	ust/ustconsumer.h \
+	ust/version.h
 
 noinst_HEADERS = \
 	share.h \
diff --git a/include/ust/version.h.in b/include/ust/version.h.in
new file mode 100644
index 0000000..4f9ea88
--- /dev/null
+++ b/include/ust/version.h.in
@@ -0,0 +1,27 @@
+/* ust/version.h.in. Contains the UST versions 
+ * 
+ * (C) Copyright 2011 Yannick Brosseau <Yannick.Brosseau at polymtl.ca>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
+ */
+#ifndef _UST_VERSION_H
+#define _UST_VERSION_H
+
+
+#define UST_MAJOR_VERSION @MAJOR_VERSION@
+#define UST_MINOR_VERSION @MINOR_VERSION@
+#define UST_VERSION @PACKAGE_VERSION@
+
+#endif  /* _UST_VERSION_H */
-- 
1.7.2.3





More information about the lttng-dev mailing list