summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@gmail.com>2014-10-24 17:46:31 +0200
committerMarc-André Lureau <marcandre.lureau@gmail.com>2014-11-27 14:27:33 +0100
commitab12cf414c87e0cc3b43bdc47f57bef837986f3b (patch)
tree15749a4fc49cdb336fab3f315da4d28639b12e3d /configure.ac
parent6f798ba1f75360e6c66260b0ac2de76efa0a7d1d (diff)
build-sys: generate spice-version.h
Editing the hexadecimal value of spice-version and keeping it in sync with actual release is a bit tedious. Let's generate it automatically (although handling of bumps will need temporarily static versions, when 0.12 -> 1.0 for example)
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac11
1 files changed, 11 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 3c81adf4..8b731ee4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -18,6 +18,16 @@ m4_define([SPICE_AGE], [9])
AC_INIT(spice, [m4_esyscmd(build-aux/git-version-gen .tarball-version)],
[spice-devel@lists.freedesktop.org], spice)
+major=`echo $PACKAGE_VERSION | cut -d. -f1`
+minor=`echo $PACKAGE_VERSION | cut -d. -f2`
+micro=`echo $PACKAGE_VERSION | cut -d. -f3`
+git=`echo $PACKAGE_VERSION | cut -d. -f4`
+if test x"$git" != x ; then
+ micro=$(($micro+1))
+fi
+SPICE_SERVER_VERSION=`printf "0x%02x%02x%02x" $major $minor $micro`
+AC_SUBST(SPICE_SERVER_VERSION)
+
AC_CONFIG_MACRO_DIR([m4])
AM_CONFIG_HEADER([config.h])
AC_CONFIG_AUX_DIR(.)
@@ -510,6 +520,7 @@ AC_OUTPUT([
Makefile
spice-server.pc
server/Makefile
+server/spice-version.h
server/tests/Makefile
client/Makefile
docs/Makefile