configure Make: More detailed version information

Version information is in output of commands version, xdump version,
and in program output for option -v.  Looks like this:

    Wolfpack Empire 4.3.33

The version number is defined in configure.ac, and incremented
manually.  It identifies only the base release (here: 4.3.33).  Fine
when this is an unmodified released version.  Pretty much useless
during development.

Add a suffix to the version number that describes it further:

    V               Unmodified release V (same as before)
    V.N-H           Modified release built from a clean git tree
                    N is the number of additional commits, and
                    H is the abbreviated commit hash
    V.N-H-dirty     Same, but the working tree is dirty
    V-dirty         Modified release built from a tarball

A git tree is clean when the contents of its files are unchanged.
Changing only the their timestamps doesn't count.  It does count when
building from a tarball, because tracking contents isn't implemented
there.

Also use this suffixed version for tarball names.

The version reported by configure is fixed at configure generation
time, i.e. it is usually out of date during development.  Ensuring a
release tarball contains one with a current version is manual for now.
Running autoconf -f should do the trick.

Elsewhere, the version is determined at build time, so it is always
current.

Dirty tracking isn't implemented in the standalone client build.  If
you start with a clean tarball, the version will not change from V to
V-dirty when you build with modifications.

Steal build-aux/git-version-gen from autoconf 2.69 to help with
computing the version string.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
Markus Armbruster 2016-06-26 11:36:04 +02:00
parent db055aa8bc
commit 1ec9b94f74
7 changed files with 266 additions and 12 deletions

View file

@ -27,7 +27,7 @@
# configure.ac: Autoconf input file
#
# Known contributors to this file:
# Markus Armbruster, 2005-2015
# Markus Armbruster, 2005-2016
#
# Process this file with autoconf to produce a configure script.
@ -37,7 +37,9 @@
# whether it's worth fixing.
AC_PREREQ(2.69)
AC_INIT([Wolfpack Empire], [4.3.34], [wolfpack@wolfpackempire.com], [empire],
AC_INIT([Wolfpack Empire],
m4_esyscmd([build-aux/git-version-gen .tarball-version]),
[wolfpack@wolfpackempire.com], [empire],
[http://www.wolfpackempire.com/])
AC_CONFIG_SRCDIR([include/combat.h])
AC_CONFIG_AUX_DIR([build-aux])
@ -58,9 +60,13 @@ AC_ARG_VAR(NROFF, [nroff command])
AC_CHECK_PROG(NROFF, groff, [GROFF_NO_SGR= groff -Tascii -U], nroff)
# not really a check for a program, but close enough
if test -d $srcdir/.git; then revctrl=git
if test -d $srcdir/.git
then revctrl=git
else revctrl=
fi
if test "$revctrl" && test -r .tarball-version
then AC_MSG_ERROR([.tarball-version must not exist])
fi
AC_SUBST(revctrl,$revctrl)
# Not a program, but need to check this early