source: box/trunk/infrastructure/m4/ax_split_version.m4 @ 288

Revision 288, 834 bytes checked in by martin, 6 years ago (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.

Line 
1dnl @synopsis AX_SPLIT_VERSION(DEFINE, VERSION)
2dnl
3dnl Splits a version number in the format MAJOR.MINOR.POINT into it's
4dnl separate components and AC_DEFINES <DEFINE>_MAJOR etc with the values.
5dnl
6dnl @category Automake
7dnl @author Martin Ebourne <martin@zepler.org>
8dnl @version
9dnl @license AllPermissive
10
11AC_DEFUN([AX_SPLIT_VERSION],[
12  ax_major_version=`echo "$2" | sed 's/\([[^.]][[^.]]*\).*/\1/'`
13  ax_minor_version=`echo "$2" | sed 's/[[^.]][[^.]]*.\([[^.]][[^.]]*\).*/\1/'`
14  ax_point_version=`echo "$2" | sed 's/[[^.]][[^.]]*.[[^.]][[^.]]*.\(.*\)/\1/'`
15
16  AC_DEFINE_UNQUOTED([$1_MAJOR], [$ax_major_version], [Define to major version for $1])
17  AC_DEFINE_UNQUOTED([$1_MINOR], [$ax_minor_version], [Define to minor version for $1])
18  AC_DEFINE_UNQUOTED([$1_POINT], [$ax_point_version], [Define to point version for $1])
19])
Note: See TracBrowser for help on using the repository browser.