Merge branch '4524_cleanup'
[midnight-commander.git] / m4.include / mc-version.m4
blobba89b5f9936a65d1c6264611faac1f8333cd6842
1 dnl @synopsis mc_VERSION
2 dnl
3 dnl Get current version of Midnight Commander from git tags
4 dnl
5 dnl @author Slava Zanko <slavazanko@gmail.com>
6 dnl @version 2021-04-04
7 dnl @license GPL
8 dnl @copyright Free Software Foundation, Inc.
9 dnl @modified Andrew Borodin <aborodin@vmail.ru>
11 AC_DEFUN([mc_VERSION],[
12     if test -f ${srcdir}/mc-version.h; then
13         VERSION=$(grep '^#define MC_CURRENT_VERSION' ${srcdir}/mc-version.h | ${SED-sed} 's/.*"\(.*\)"$/\1/')
14     else
15         VERSION="unknown"
16     fi
18     dnl Version without dashes for the man page
19     MAN_VERSION=`echo $VERSION | sed 's/^\([[^\-]]*\).*/\1/'`
20     AC_SUBST(MAN_VERSION)