diff options
author | Martin Ebourne <martin@ebourne.me.uk> | 2005-12-28 11:38:04 +0000 |
---|---|---|
committer | Martin Ebourne <martin@ebourne.me.uk> | 2005-12-28 11:38:04 +0000 |
commit | e0e2d305e59231485377eae91e16de2441b205ba (patch) | |
tree | d96556a144d3a4f610ddb5c02e7fcacdd8132410 /infrastructure/m4/ax_split_version.m4 | |
parent | fe460a91023e90632bda8ab447824e18c378376d (diff) |
Now supports Berkeley DB versions >= 4.1 in addition to 1.x. The versions inbetween are not supported because they require code changes and I don't have them available to test against.
Diffstat (limited to 'infrastructure/m4/ax_split_version.m4')
-rw-r--r-- | infrastructure/m4/ax_split_version.m4 | 19 |
1 files changed, 19 insertions, 0 deletions
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 <DEFINE>_MAJOR etc with the values. +dnl +dnl @category Automake +dnl @author Martin Ebourne <martin@zepler.org> +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]) +]) |