From ab12cf414c87e0cc3b43bdc47f57bef837986f3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Fri, 24 Oct 2014 17:46:31 +0200 Subject: [PATCH] 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) --- configure.ac | 11 +++++++++++ server/{spice-version.h => spice-version.h.in} | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) rename server/{spice-version.h => spice-version.h.in} (94%) 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 similarity index 94% rename from server/spice-version.h rename to 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_ */