summaryrefslogtreecommitdiff
path: root/m4/macros/split-package-version.m4
blob: 8f7941d005d7555a154aae1b57ec4d049b7a1719 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# SPLIT_PACKAGE_VERSION
# ---------------------------
# Split package version in four parts
AC_DEFUN([SPLIT_PACKAGE_VERSION],
	[
	AC_REQUIRE([AC_PROG_SED])
	PACKAGE_VERSION_MAJOR=`echo "$PACKAGE_VERSION" | $SED 's/\([[0-9]]\+\).*/\1/'`
	PACKAGE_VERSION_MINOR=`echo "$PACKAGE_VERSION" | $SED 's/[[0-9]]\+\.\([[0-9]]\+\).*/\1/'`
	PACKAGE_VERSION_BUILD=`echo "$PACKAGE_VERSION" | $SED 's/[[0-9]]\+\.[[0-9]]\+\.\([[0-9]]\+\).*/\1/'`
	PACKAGE_VERSION_REVIEW=`echo "$PACKAGE_VERSION" | $SED 's/[[0-9]]\+\.[[0-9]]\+\.[[0-9]]\+\(.*\)/\1/'`
	AC_SUBST([PACKAGE_VERSION_MAJOR])
	AC_SUBST([PACKAGE_VERSION_MINOR])
	AC_SUBST([PACKAGE_VERSION_BUILD])
	AC_SUBST([PACKAGE_VERSION_REVIEW])
	]
)