1 |
|
---|
2 | AC_DEFUN([ERFA_NUMVER],[
|
---|
3 | AS_VAR_PUSHDEF([MAJOR],[MAJOR_VERSION])dnl
|
---|
4 | AS_VAR_PUSHDEF([MINOR],[MINOR_VERSION])dnl
|
---|
5 | AS_VAR_PUSHDEF([MICRO],[MICRO_VERSION])dnl
|
---|
6 | AS_VAR_PUSHDEF([PATCH],[PATCH_VERSION])dnl
|
---|
7 | test ".$PACKAGE_VERSION" = "." && PACKAGE_VERSION="$VERSION"
|
---|
8 | AC_MSG_CHECKING([split $PACKAGE_VERSION])
|
---|
9 | MINOR=`echo $PACKAGE_VERSION`
|
---|
10 | MAJOR=`echo "$MINOR" | sed -e 's/[[.]].*//'`
|
---|
11 | MINOR=`echo "$MINOR" | sed -e "s/^$MAJOR//" -e 's/^.//'`
|
---|
12 | MICRO="$MINOR"
|
---|
13 | MINOR=`echo "$MICRO" | sed -e 's/[[.]].*//'`
|
---|
14 | MICRO=`echo "$MICRO" | sed -e "s/^$MINOR//" -e 's/^.//'`
|
---|
15 | PATCH="$MICRO"
|
---|
16 | MICRO=`echo "$PATCH" | sed -e 's/[[^0-9]].*//'`
|
---|
17 | PATCH=`echo "$PATCH" | sed -e "s/^$MICRO//" -e 's/[[-.]]//'`
|
---|
18 | if test "_$MICRO" = "_" ; then MICRO="0" ; fi
|
---|
19 | if test "_$MINOR" = "_" ; then MINOR="$MAJOR" ; MAJOR="0" ; fi
|
---|
20 | MINOR=`echo "$MINOR" | sed -e 's/[[^0-9]].*//'`
|
---|
21 | AC_MSG_RESULT([ $MAJOR $MINOR $MICRO $PATCH])
|
---|
22 | AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MAJOR, $MAJOR, [Define to the major version of this package.])
|
---|
23 | AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MINOR, $MINOR, [Define to the minor version of this package.])
|
---|
24 | AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MICRO, $MICRO, [Define to the micro version of this package.])
|
---|
25 | AC_SUBST(PATCH)
|
---|
26 | AS_VAR_POPDEF([PATCH])dnl
|
---|
27 | AS_VAR_POPDEF([MICRO])dnl
|
---|
28 | AS_VAR_POPDEF([MINOR])dnl
|
---|
29 | AS_VAR_POPDEF([MAJOR])dnl
|
---|
30 | ])
|
---|
31 |
|
---|
32 | AC_DEFUN([ERFA_LIB_VERSION_INFO],[
|
---|
33 | m4_ifndef([ERFA_C], [m4_define([ERFA_C], [$1])])
|
---|
34 | m4_ifndef([ERFA_R], [m4_define([ERFA_R], [$2])])
|
---|
35 | m4_ifndef([ERFA_A], [m4_define([ERFA_A], [$3])])
|
---|
36 | m4_if(
|
---|
37 | m4_ifdef([ERFA_C], [ok]):m4_ifdef([ERFA_R], [ok]):m4_ifdef([ERFA_A], [ok]),
|
---|
38 | [ok:ok:ok],,
|
---|
39 | [m4_fatal([ERFA_LIB_VERSION_INFO should be called with current, revision and age arguments])])dnl
|
---|
40 | AC_SUBST([VI_CURR], [m4_ifdef([ERFA_C], ['ERFA_C'])])dnl
|
---|
41 | AC_SUBST([VI_REL], [m4_ifdef([ERFA_R], ['ERFA_R'])])dnl
|
---|
42 | AC_SUBST([VI_AGE], [m4_ifdef([ERFA_A], ['ERFA_A'])])dnl
|
---|
43 | vi_all=`echo $VI_CURR:$VI_REL:$VI_AGE`
|
---|
44 | AC_SUBST([VI_ALL], [$vi_all])
|
---|
45 | ])
|
---|