summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorNeil Roberts <neil@linux.intel.com>2012-04-11 16:59:05 +0100
committerKristian Høgsberg <krh@bitplanet.net>2012-04-12 17:54:44 -0400
commit18a770c80d59ef672e54688761bc8d0d9e660e12 (patch)
tree15700164694250a777c527c71a732431b832ed65 /configure.ac
parent8e5866a54d068bd7d4228cdd257256962744ded0 (diff)
Add a public header for the version number
This adds a public header so that applications can get the Wayland version number at compile time. This can be used to make applications that support compiling against multiple versions of Wayland. There is a separate installed header called cogl-version.h which gets included by both wayland-client.h and wayland-server.h The canonical place for the version number is the configure.ac script which splits it into three separate m4 defines for the major, minor and micro version. These are copied into the generated wayland-version.h header using AC_SUBST. There is also a string form of the complete version number. The version number is now also automatically copied into the two .pc files. Because the major, minor and micro parts are required it is no longer possible to leave the version number as 'master' when building from git. Most projects seem to immediately bump the git repo to a fake version number (usually odd) after making a release so that there is always a relative number that can be used for comparison. This patch sets the git version to 0.99.0 under the assumption that the next release will be 1.0.0.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac15
1 files changed, 14 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 194850c..615dfdb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,10 +1,22 @@
AC_PREREQ([2.64])
+
+m4_define([wayland_major_version], [0])
+m4_define([wayland_minor_version], [89])
+m4_define([wayland_micro_version], [0])
+m4_define([wayland_version],
+ [wayland_major_version.wayland_minor_version.wayland_micro_version])
+
AC_INIT([wayland],
- [master],
+ [wayland_version],
[https://bugs.freedesktop.org/enter_bug.cgi?product=wayland],
[wayland],
[http://wayland.freedesktop.org/])
+AC_SUBST([WAYLAND_VERSION_MAJOR], [wayland_major_version])
+AC_SUBST([WAYLAND_VERSION_MINOR], [wayland_minor_version])
+AC_SUBST([WAYLAND_VERSION_MICRO], [wayland_micro_version])
+AC_SUBST([WAYLAND_VERSION], [wayland_version])
+
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
@@ -69,6 +81,7 @@ AC_CONFIG_FILES([Makefile
src/Makefile
src/wayland-server.pc
src/wayland-client.pc
+ src/wayland-version.h
protocol/Makefile
tests/Makefile])
AC_OUTPUT