From aa2943800f9c00823720af98da036813ebf5cd2c Mon Sep 17 00:00:00 2001 From: Reinhard Tartler Date: Wed, 14 Feb 2007 09:01:45 +0100 Subject: initial commit --- infrastructure/m4/ax_split_version.m4 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 infrastructure/m4/ax_split_version.m4 (limited to 'infrastructure/m4/ax_split_version.m4') diff --git a/infrastructure/m4/ax_split_version.m4 b/infrastructure/m4/ax_split_version.m4 new file mode 100644 index 00000000..20b353df --- /dev/null +++ b/infrastructure/m4/ax_split_version.m4 @@ -0,0 +1,19 @@ +dnl @synopsis AX_SPLIT_VERSION(DEFINE, VERSION) +dnl +dnl Splits a version number in the format MAJOR.MINOR.POINT into it's +dnl separate components and AC_DEFINES _MAJOR etc with the values. +dnl +dnl @category Automake +dnl @author Martin Ebourne +dnl @version +dnl @license AllPermissive + +AC_DEFUN([AX_SPLIT_VERSION],[ + ax_major_version=`echo "$2" | sed 's/\([[^.]][[^.]]*\).*/\1/'` + ax_minor_version=`echo "$2" | sed 's/[[^.]][[^.]]*.\([[^.]][[^.]]*\).*/\1/'` + ax_point_version=`echo "$2" | sed 's/[[^.]][[^.]]*.[[^.]][[^.]]*.\(.*\)/\1/'` + + AC_DEFINE_UNQUOTED([$1_MAJOR], [$ax_major_version], [Define to major version for $1]) + AC_DEFINE_UNQUOTED([$1_MINOR], [$ax_minor_version], [Define to minor version for $1]) + AC_DEFINE_UNQUOTED([$1_POINT], [$ax_point_version], [Define to point version for $1]) +]) -- cgit v1.2.3