Define VERSION in configure, and add git describe output if available.

The client release version is now defined in configure.in rather than
source/irc.c.  The gitversion.sh script is used to automatically add a
suffix to the version number for versions of the client built from git.

Also removed AC_REVISION() from configure.in, because $Revision$ doesn't
make sense with git.
This commit is contained in:
Kevin Easton 2015-03-16 23:04:43 +11:00
parent aab85f807a
commit 3b80790a31
4 changed files with 27 additions and 21 deletions

12
configure vendored
View File

@ -1,5 +1,4 @@
#! /bin/sh
# From configure.in Revision: 467 .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.59.
#
@ -1350,12 +1349,11 @@ topdir="`pwd`"
ac_config_headers="$ac_config_headers include/defs.h"
VERSION=`sed -n -e 's/";$//' -e '/ const char irc_version.. = "/s///p' -e '/const char irc_version/q' < $srcdir/source/irc.c 2>/dev/null`
if test x"$VERSION" = x""; then
VERSION="BitchX-1.0"
fi
_VERSION_="BitchX"
VERSION_NUMBER="`echo "$VERSION" | sed 's/BitchX-//'`"
RELEASE_TAG="bitchx-1.2.1"
RELEASE="1.2.1"
VERSION_NUMBER="$RELEASE`"$srcdir/gitversion.sh" "$RELEASE_TAG" "$srcdir"`"
VERSION="$_VERSION_-$VERSION_NUMBER"
cat >>confdefs.h <<_ACEOF
#define VERSION_NUMBER "$VERSION_NUMBER"
@ -17209,7 +17207,7 @@ fi
echo
echo BitchX \(c\) 1996-2012 Colten Edwards et al
echo BitchX \(c\) 1996-2015 Colten Edwards et al
echo ----------------------------------------------------------
echo
echo The configuration script has finished. You should look through

View File

@ -3,21 +3,17 @@ dnl Copyright (c) 1999-2001 David Walluck
dnl All rights reserved.
AC_PREREQ(2.59)
AC_REVISION($Revision$)
AC_INIT
AC_CONFIG_SRCDIR([$srcdir/source/irc.c])
topdir="`pwd`"
AC_SUBST(topdir)
AC_CONFIG_HEADERS(include/defs.h)
dnl Get the version number from source/irc.c.
dnl Maybe it's better to set the VERSION in here instead.
VERSION=`sed -n -e 's/";$//' -e '/ const char irc_version.. = "/s///p' -e '/const char irc_version/q' < $srcdir/source/irc.c 2>/dev/null`
if test x"$VERSION" = x""; then
VERSION="BitchX-1.0"
fi
_VERSION_="BitchX"
VERSION_NUMBER="`echo "$VERSION" | sed 's/BitchX-//'`"
RELEASE_TAG="bitchx-1.2.1"
RELEASE="1.2.1"
VERSION_NUMBER="$RELEASE`"$srcdir/gitversion.sh" "$RELEASE_TAG" "$srcdir"`"
VERSION="$_VERSION_-$VERSION_NUMBER"
AC_DEFINE_UNQUOTED(VERSION_NUMBER, "$VERSION_NUMBER", Define BitchX version number here.)
AC_SUBST(VERSION_NUMBER)
echo Welcome to the "$VERSION" configuration
@ -1115,7 +1111,7 @@ AC_CONFIG_COMMANDS([default],[[ echo timestamp > stamp-h
AC_OUTPUT
echo
echo BitchX \(c\) 1996-2012 Colten Edwards et al
echo BitchX \(c\) 1996-2015 Colten Edwards et al
echo ----------------------------------------------------------
echo
echo The configuration script has finished. You should look through

16
gitversion.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/sh
test $# -gt 0 || exit
tag="$1"
if test $# -gt 1; then
cd $2 || exit
fi
test -d .git || exit
desc=`git describe --match "$tag" 2>/dev/null` || exit
echo "$desc" | sed -e "s@^$tag@@"

View File

@ -62,11 +62,7 @@ CVS_REVISION(irc_c)
#include <signame.h>
#endif
#ifndef VERSION
const char irc_version[] = "BitchX-1.2.1";
#else
const char irc_version[] = VERSION;
#endif
const char irc_version[] = VERSION;
/* Format of bitchx_numver: MMmmpp
* MM = major version (eg 10 = 1.0)