leo_sobral@2
|
1 |
dnl version.m4 0.0.5
|
leo_sobral@2
|
2 |
dnl autostars m4 macro for versioning
|
leo_sobral@2
|
3 |
dnl thomas@apestaart.org
|
leo_sobral@2
|
4 |
dnl
|
leo_sobral@2
|
5 |
dnl AS_VERSION(PACKAGE, PREFIX, MAJOR, MINOR, MICRO, NANO, ACTION_IF_NO_NANO, ACTION_IF_NANO)
|
leo_sobral@2
|
6 |
dnl example
|
leo_sobral@2
|
7 |
dnl AS_VERSION(gstreamer, GST_VERSION, 0, 3, 2,)
|
leo_sobral@2
|
8 |
dnl for a 0.3.2 release version
|
leo_sobral@2
|
9 |
dnl
|
leo_sobral@2
|
10 |
dnl this macro
|
leo_sobral@2
|
11 |
dnl - defines [$PREFIX]_MAJOR, MINOR and MICRO
|
leo_sobral@2
|
12 |
dnl - if NANO is empty, then we're in release mode, else in cvs/dev mode
|
leo_sobral@2
|
13 |
dnl - defines [$PREFIX], VERSION, and [$PREFIX]_RELEASE
|
leo_sobral@2
|
14 |
dnl - executes the relevant action
|
leo_sobral@2
|
15 |
dnl - AC_SUBST's PACKAGE, VERSION, [$PREFIX] and [$PREFIX]_RELEASE
|
leo_sobral@2
|
16 |
dnl as well as the little ones
|
leo_sobral@2
|
17 |
dnl - doesn't call AM_INIT_AUTOMAKE anymore because it prevents
|
leo_sobral@2
|
18 |
dnl maintainer mode from running ok
|
leo_sobral@2
|
19 |
dnl
|
leo_sobral@2
|
20 |
dnl don't forget to put #undef [$2] and [$2]_RELEASE in acconfig.h
|
leo_sobral@2
|
21 |
|
leo_sobral@2
|
22 |
AC_DEFUN([AS_VERSION],
|
leo_sobral@2
|
23 |
[
|
leo_sobral@2
|
24 |
PACKAGE=[$1]
|
leo_sobral@2
|
25 |
[$2]_MAJOR_VERSION=[$3]
|
leo_sobral@2
|
26 |
[$2]_MINOR_VERSION=[$4]
|
leo_sobral@2
|
27 |
[$2]_MICRO_VERSION=[$5]
|
leo_sobral@2
|
28 |
NANO=[$6]
|
leo_sobral@2
|
29 |
[$2]_NANO_VERSION=$NANO
|
leo_sobral@2
|
30 |
if test "x$NANO" = "x" || test "x$NANO" = "x0";
|
leo_sobral@2
|
31 |
then
|
leo_sobral@2
|
32 |
AC_MSG_NOTICE(configuring [$1] for release)
|
leo_sobral@2
|
33 |
VERSION=[$3].[$4].[$5]
|
leo_sobral@2
|
34 |
[$2]_RELEASE=1
|
leo_sobral@2
|
35 |
dnl execute action
|
leo_sobral@2
|
36 |
ifelse([$7], , :, [$7])
|
leo_sobral@2
|
37 |
else
|
leo_sobral@2
|
38 |
AC_MSG_NOTICE(configuring [$1] for development with nano $NANO)
|
leo_sobral@2
|
39 |
VERSION=[$3].[$4].[$5].$NANO
|
leo_sobral@2
|
40 |
[$2]_RELEASE=`date +%Y%m%d_%H%M%S`
|
leo_sobral@2
|
41 |
dnl execute action
|
leo_sobral@2
|
42 |
ifelse([$8], , :, [$8])
|
leo_sobral@2
|
43 |
fi
|
leo_sobral@2
|
44 |
|
leo_sobral@2
|
45 |
[$2]_VERSION=$VERSION
|
leo_sobral@2
|
46 |
AC_DEFINE_UNQUOTED([$2]_VERSION, "$[$2]_VERSION", [Define the version])
|
leo_sobral@2
|
47 |
AC_SUBST([$2]_VERSION)
|
leo_sobral@2
|
48 |
|
leo_sobral@2
|
49 |
AC_SUBST([$2]_RELEASE)
|
leo_sobral@2
|
50 |
|
leo_sobral@2
|
51 |
AC_SUBST([$2]_MAJOR_VERSION)
|
leo_sobral@2
|
52 |
AC_SUBST([$2]_MINOR_VERSION)
|
leo_sobral@2
|
53 |
AC_SUBST([$2]_MICRO_VERSION)
|
leo_sobral@2
|
54 |
AC_SUBST([$2]_NANO_VERSION)
|
leo_sobral@2
|
55 |
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Define the package name])
|
leo_sobral@2
|
56 |
AC_SUBST(PACKAGE)
|
leo_sobral@2
|
57 |
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Define the version])
|
leo_sobral@2
|
58 |
AC_SUBST(VERSION)
|
leo_sobral@2
|
59 |
])
|