build: export major/minor/patchlevel numbers
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 5 Aug 2013 19:23:27 +0000 (15:23 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 5 Aug 2013 19:23:27 +0000 (15:23 -0400)
Acked-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
configure.ac

index 2f71a60bb12d77fb0fc629c6c557574265650afb..32efa93572c49b31a6c8b9eb8bcc270a90ba482b 100644 (file)
@@ -6,6 +6,18 @@ AC_CONFIG_MACRO_DIR([config])
 AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip])
 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 
+# Compute minor/major/patchlevel version numbers
+AC_PROG_SED
+major_version=$(echo AC_PACKAGE_VERSION | sed 's/^\([[0-9]]\)*\.[[0-9]]*\.[[0-9]]*.*$/\1/')
+minor_version=$(echo AC_PACKAGE_VERSION | sed 's/^[[0-9]]*\.\([[0-9]]*\)\.[[0-9]]*.*$/\1/')
+patchlevel_version=$(echo AC_PACKAGE_VERSION | sed 's/^[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\).*$/\1/')
+AC_SUBST([MAJOR_VERSION], [$major_version])
+AC_SUBST([MINOR_VERSION], [$minor_version])
+AC_SUBST([PATCHLEVEL_VERSION], [$patchlevel_version])
+AC_DEFINE_UNQUOTED([VERSION_MAJOR], $major_version, [UST major version number])
+AC_DEFINE_UNQUOTED([VERSION_MINOR], $minor_version, [UST minor version number])
+AC_DEFINE_UNQUOTED([VERSION_PATCHLEVEL], $patchlevel_version, [UST patchlevel version number])
+
 version_name="Dominus Vobiscum"
 version_description="A very succulent line-up of beers brewed at Microbrasserie Charlevoix. Elaborated starting from special malts and fermented with a Belgian yeast. These beers are refermented in bottle and will make you discover the richness of wheat, amber and triple styles."
 
This page took 0.025965 seconds and 4 git commands to generate.