1 dnl @synopsis MC_VERSION
3 dnl Get current version of Midnight Commander from git tags
5 dnl @author Slava Zanko <slavazanko@gmail.com>
6 dnl @version 2009-12-30
8 dnl @copyright Free Software Foundation, Inc.
10 AC_DEFUN([MC_VERSION],[
11 if test ! -f ${srcdir}/version.h; then
12 ${srcdir}/maint/version.sh ${srcdir}
14 if test -f ${srcdir}/version.h; then
15 VERSION=$(grep '^#define MC_CURRENT_VERSION' ${srcdir}/version.h | sed 's/.*"\(.*\)"$/\1/')
21 dnl Version and Release without dashes for the distro packages
22 DISTR_VERSION=`echo $VERSION | sed 's/^\([[^\-]]*\).*/\1/'`
23 DISTR_RELEASE=`echo $VERSION | sed 's/^[[^\-]]*\-\(.*\)/\1/' | sed 's/-/./g'`
25 if test `echo $VERSION | grep -c '\-pre'` -ne 0; then
26 DISTR_RELEASE="0.$DISTR_RELEASE"
28 if test `echo $VERSION | grep -c '\-'` -eq 0; then
31 DISTR_RELEASE="2.$DISTR_RELEASE"
35 AC_SUBST(DISTR_VERSION)
36 AC_SUBST(DISTR_RELEASE)