1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/maemo-ui/m4/as-version.m4 Thu Apr 19 21:22:26 2007 +0100
1.3 @@ -0,0 +1,59 @@
1.4 +dnl version.m4 0.0.5
1.5 +dnl autostars m4 macro for versioning
1.6 +dnl thomas@apestaart.org
1.7 +dnl
1.8 +dnl AS_VERSION(PACKAGE, PREFIX, MAJOR, MINOR, MICRO, NANO, ACTION_IF_NO_NANO, ACTION_IF_NANO)
1.9 +dnl example
1.10 +dnl AS_VERSION(gstreamer, GST_VERSION, 0, 3, 2,)
1.11 +dnl for a 0.3.2 release version
1.12 +dnl
1.13 +dnl this macro
1.14 +dnl - defines [$PREFIX]_MAJOR, MINOR and MICRO
1.15 +dnl - if NANO is empty, then we're in release mode, else in cvs/dev mode
1.16 +dnl - defines [$PREFIX], VERSION, and [$PREFIX]_RELEASE
1.17 +dnl - executes the relevant action
1.18 +dnl - AC_SUBST's PACKAGE, VERSION, [$PREFIX] and [$PREFIX]_RELEASE
1.19 +dnl as well as the little ones
1.20 +dnl - doesn't call AM_INIT_AUTOMAKE anymore because it prevents
1.21 +dnl maintainer mode from running ok
1.22 +dnl
1.23 +dnl don't forget to put #undef [$2] and [$2]_RELEASE in acconfig.h
1.24 +
1.25 +AC_DEFUN([AS_VERSION],
1.26 +[
1.27 + PACKAGE=[$1]
1.28 + [$2]_MAJOR_VERSION=[$3]
1.29 + [$2]_MINOR_VERSION=[$4]
1.30 + [$2]_MICRO_VERSION=[$5]
1.31 + NANO=[$6]
1.32 + [$2]_NANO_VERSION=$NANO
1.33 + if test "x$NANO" = "x" || test "x$NANO" = "x0";
1.34 + then
1.35 + AC_MSG_NOTICE(configuring [$1] for release)
1.36 + VERSION=[$3].[$4].[$5]
1.37 + [$2]_RELEASE=1
1.38 + dnl execute action
1.39 + ifelse([$7], , :, [$7])
1.40 + else
1.41 + AC_MSG_NOTICE(configuring [$1] for development with nano $NANO)
1.42 + VERSION=[$3].[$4].[$5].$NANO
1.43 + [$2]_RELEASE=`date +%Y%m%d_%H%M%S`
1.44 + dnl execute action
1.45 + ifelse([$8], , :, [$8])
1.46 + fi
1.47 +
1.48 + [$2]_VERSION=$VERSION
1.49 + AC_DEFINE_UNQUOTED([$2]_VERSION, "$[$2]_VERSION", [Define the version])
1.50 + AC_SUBST([$2]_VERSION)
1.51 +
1.52 + AC_SUBST([$2]_RELEASE)
1.53 +
1.54 + AC_SUBST([$2]_MAJOR_VERSION)
1.55 + AC_SUBST([$2]_MINOR_VERSION)
1.56 + AC_SUBST([$2]_MICRO_VERSION)
1.57 + AC_SUBST([$2]_NANO_VERSION)
1.58 + AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Define the package name])
1.59 + AC_SUBST(PACKAGE)
1.60 + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Define the version])
1.61 + AC_SUBST(VERSION)
1.62 +])