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