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