Commit d5fd92ed authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Provide more flexible version numbers to the code

Having the individual parts in the code allows us to build version
numbers like "1.2" while leaving "3" out in a clean fashion, that is
without regular expressions or the like. This might be used together
with configuration format versions.

Why m4 code? AM_INIT_AUTOMAKE, which could take a shell variable, is
considered deprecated[1] and should be replaced by AC_INIT. Unfortunately,
AC_INIT is expanded at build time, so one has to use m4 to build
composite values like this version number[2].

[1] http://www.gnu.org/software/libtool/manual/automake/Public-macros.html
[2] http://www.mail-archive.com/autoconf@gnu.org/msg16720.html

Reviewed-by: iustinp
parent e994fcba
# Configure script for Ganeti
m4_define([gnt_version_major], [1])
m4_define([gnt_version_minor], [2])
m4_define([gnt_version_revision], [3])
m4_define([gnt_version_suffix], [])
m4_define([gnt_version_full],
m4_format([%d.%d.%d%s],
gnt_version_major, gnt_version_minor,
gnt_version_revision, gnt_version_suffix))
AC_PREREQ(2.59)
AC_INIT(ganeti, 1.2.3, ganeti@googlegroups.com)
AC_INIT(ganeti, gnt_version_full, ganeti@googlegroups.com)
AC_CONFIG_AUX_DIR(autotools)
AC_CONFIG_SRCDIR(configure)
AM_INIT_AUTOMAKE([foreign tar-ustar])
AC_SUBST([VERSION_MAJOR], gnt_version_major)
AC_SUBST([VERSION_MINOR], gnt_version_minor)
AC_SUBST([VERSION_REVISION], gnt_version_revision)
AC_SUBST([VERSION_SUFFIX], gnt_version_suffix)
AC_SUBST([VERSION_FULL], gnt_version_full)
# --with-ssh-initscript=...
AC_ARG_WITH([ssh-initscript],
[AS_HELP_STRING([--with-ssh-initscript=SCRIPT],
......
......@@ -12,6 +12,11 @@ _autoconf.py: Makefile
{ echo '# This file is automatically generated, do not edit!'; \
echo '#'; \
echo "PACKAGE_VERSION = '$(PACKAGE_VERSION)'"; \
echo "VERSION_MAJOR = '$(VERSION_MAJOR)'"; \
echo "VERSION_MINOR = '$(VERSION_MINOR)'"; \
echo "VERSION_REVISION = '$(VERSION_REVISION)'"; \
echo "VERSION_SUFFIX = '$(VERSION_SUFFIX)'"; \
echo "VERSION_FULL = '$(VERSION_FULL)'"; \
echo "LOCALSTATEDIR = '$(localstatedir)'"; \
echo "SYSCONFDIR = '$(sysconfdir)'"; \
echo "SSH_INITD_SCRIPT = '$(SSH_INITD_SCRIPT)'"; \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment