diff options
author | Marc-André Lureau <marcandre.lureau@gmail.com> | 2014-10-24 17:46:31 +0200 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@gmail.com> | 2014-11-27 14:27:33 +0100 |
commit | ab12cf414c87e0cc3b43bdc47f57bef837986f3b (patch) | |
tree | 15749a4fc49cdb336fab3f315da4d28639b12e3d | |
parent | 6f798ba1f75360e6c66260b0ac2de76efa0a7d1d (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)
-rw-r--r-- | configure.ac | 11 | ||||
-rw-r--r-- | server/spice-version.h.in (renamed from server/spice-version.h) | 2 |
2 files changed, 12 insertions, 1 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 diff --git a/server/spice-version.h b/server/spice-version.h.in index b5c8eb0c..69e97e9f 100644 --- a/server/spice-version.h +++ b/server/spice-version.h.in @@ -22,6 +22,6 @@ #error "Only spice.h can be included directly." #endif -#define SPICE_SERVER_VERSION 0x000c06 /* release 0.12.6 */ +#define SPICE_SERVER_VERSION @SPICE_SERVER_VERSION@ #endif /* SPICE_VERSION_H_ */ |