Change version numbering to always include minor release
[debian/gnuradio] / config / gr_version.m4
1 dnl Copyright 2009 Free Software Foundation, Inc.
2 dnl 
3 dnl This file is part of GNU Radio
4 dnl 
5 dnl GNU Radio is free software; you can redistribute it and/or modify
6 dnl it under the terms of the GNU General Public License as published by
7 dnl the Free Software Foundation; either version 3, or (at your option)
8 dnl any later version.
9 dnl 
10 dnl GNU Radio is distributed in the hope that it will be useful,
11 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
12 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 dnl GNU General Public License for more details.
14 dnl 
15 dnl You should have received a copy of the GNU General Public License
16 dnl along with GNU Radio; see the file COPYING.  If not, write to
17 dnl the Free Software Foundation, Inc., 51 Franklin Street,
18 dnl Boston, MA 02110-1301, USA.
19
20 AC_DEFUN([GR_VERSION],[
21   dnl Computed version based on version.sh
22   dnl Does not force recompile on rev change
23   dnl
24   dnl Source the variables describing the release version
25   dnl 
26   dnl MAJOR_VERSION          Major release generation (2.x, 3.x, etc.)
27   dnl API_COMPAT             API compatibility version (3.2.x, 3.3.x, etc.)
28   dnl MINOR_VERSION          Minor release version (3.3.0, 3.3.1, etc.)
29   dnl MAINT_VERSION          Pure bugfix additions to make maintenance release
30   dnl
31   dnl The last two fields can have 'git' instead of a number to indicate
32   dnl that this branch is between versions.
33   . $srcdir/version.sh
34   RELEASE=$MAJOR_VERSION.$API_COMPAT
35   
36   dnl Get git version if available
37   GR_GIT
38
39   dnl Test if we should use git version
40   if test "$MINOR_VERSION" == "git"; then
41     dnl 3.3git-xxx-gxxxxxxxx
42     RELEASE=$RELEASE$MINOR_VERSION
43     DOCVER=$RELEASE
44     if test "$GIT_VERSION" != "" ; then
45       RELEASE=$RELEASE-$GIT_VERSION
46     fi
47   else
48     if test "$MAINT_VERSION" == "git" ; then
49       dnl 3.3.1git-xxx-gxxxxxxxx
50       RELEASE=$RELEASE.$MINOR_VERSION$MAINT_VERSION
51       DOCVER=$RELEASE
52       if test "$GIT_VERSION" != "" ; then
53         RELEASE=$RELEASE-$GIT_VERSION
54       fi
55     else
56       dnl This is a numbered release.
57       RELEASE=$RELEASE.$MINOR_VERSION
58       if test "$MAINT_VERSION" != "0"; then
59         RELEASE=$RELEASE.$MAINT_VERSION
60       fi
61
62       DOCVER=$RELEASE
63     fi
64   fi
65
66   AC_MSG_NOTICE([GNU Radio Release $RELEASE])
67   AC_SUBST(RELEASE)
68   AC_SUBST(DOCVER)
69 ])