Add a version.h header
authorYannick Brosseau <yannick.brosseau@gmail.com>
Wed, 1 Jun 2011 15:06:32 +0000 (11:06 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 1 Jun 2011 15:06:32 +0000 (11:06 -0400)
It contains the major and minor version numbers

[ edit: coding style fixes by Mathieu Desnoyers ]

Signed-off-by: Yannick Brosseau <yannick.brosseau@gmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
.gitignore
configure.ac
include/Makefile.am
include/ust/version.h.in [new file with mode: 0644]

index 6ae624eec65ab425850e93554e74ac3110d83f24..e9cac90c5713cc674889979f3261595c04661036 100644 (file)
@@ -23,6 +23,7 @@ config.status
 stamp-h1
 libtool
 ust.pc
+include/ust/version.h
 
 ustctl/ustctl
 ust-consumerd/ust-consumerd
index 5d914322b1158df69f6b8f931f91fc80c5936baf..cbe239691fea17330fda29575fac30e8d6be9dfd 100644 (file)
@@ -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
index c6e92b83f6d0cda0e2014b0f53a41496d5876829..eedde64ff080681642ea82b5ce0d1fb79763d0ee 100644 (file)
@@ -2,7 +2,8 @@ nobase_include_HEADERS = \
        ust/marker.h \
        ust/tracepoint.h \
        ust/tracepoint_event.h \
-       ust/probe.h
+       ust/probe.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 (file)
index 0000000..d65b920
--- /dev/null
@@ -0,0 +1,28 @@
+#ifndef _UST_VERSION_H
+#define _UST_VERSION_H
+
+/*
+ * ust/version.h.in. Contains the UST versions 
+ * 
+ * (C) Copyright 2011 Yannick Brosseau <Yannick.Brosseau@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
+ */
+
+#define UST_MAJOR_VERSION @MAJOR_VERSION@
+#define UST_MINOR_VERSION @MINOR_VERSION@
+#define UST_VERSION @PACKAGE_VERSION@
+
+#endif  /* _UST_VERSION_H */
This page took 0.02537 seconds and 4 git commands to generate.