Merge branch 'master' of http://gnuradio.org/git/gnuradio
[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
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     if test "$GIT_VERSION" != "" ; then
44       RELEASE=$RELEASE-$GIT_VERSION
45     fi
46   else
47     if test "$MAINT_VERSION" == "git" ; then
48       dnl 3.3.1git-xxx-gxxxxxxxx
49       RELEASE=$RELEASE.$MINOR_VERSION$MAINT_VERSION
50       if test "$GIT_VERSION" != "" ; then
51         RELEASE=$RELEASE-$GIT_VERSION
52       fi
53     else
54       dnl This is a numbered reelase.
55       dnl Test if minor version is 0, which we don't encode, unless it is also
56       dnl a maintenance release
57       if test "$MINOR_VERSION" != "0" -o "$MAINT_VERSION" != "0"; then
58         dnl 3.3.1
59         RELEASE=$RELEASE.$MINOR_VERSION                          
60         if test "$MAINT_VERSION" != "0"; then
61           dnl 3.3.0.1, 3.3.1.1
62           RELEASE=$RELEASE.$MAINT_VERSION
63         fi
64       fi
65     fi
66   fi
67
68   AC_MSG_NOTICE([GNU Radio Release $RELEASE])
69 ])