1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/gst-gmyth/m4/as-version.m4 Wed Aug 29 14:42:10 2007 +0100
1.3 @@ -0,0 +1,67 @@
1.4 +dnl as-version.m4 0.1.0
1.5 +
1.6 +dnl autostars m4 macro for versioning
1.7 +
1.8 +dnl Thomas Vander Stichele <thomas at apestaart dot org>
1.9 +
1.10 +dnl $Id: as-version.m4,v 1.1 2005/06/18 18:02:46 burgerman Exp $
1.11 +
1.12 +dnl AS_VERSION(PACKAGE, PREFIX, MAJOR, MINOR, MICRO, NANO,
1.13 +dnl ACTION-IF-NO-NANO, [ACTION-IF-NANO])
1.14 +
1.15 +dnl example
1.16 +dnl AS_VERSION(gstreamer, GST_VERSION, 0, 3, 2,)
1.17 +dnl for a 0.3.2 release version
1.18 +
1.19 +dnl this macro
1.20 +dnl - defines [$PREFIX]_MAJOR, MINOR and MICRO
1.21 +dnl - if NANO is empty, then we're in release mode, else in cvs/dev mode
1.22 +dnl - defines [$PREFIX], VERSION, and [$PREFIX]_RELEASE
1.23 +dnl - executes the relevant action
1.24 +dnl - AC_SUBST's PACKAGE, VERSION, [$PREFIX] and [$PREFIX]_RELEASE
1.25 +dnl as well as the little ones
1.26 +dnl - doesn't call AM_INIT_AUTOMAKE anymore because it prevents
1.27 +dnl maintainer mode from running ok
1.28 +dnl
1.29 +dnl don't forget to put #undef [$2] and [$2]_RELEASE in acconfig.h
1.30 +dnl if you use acconfig.h
1.31 +
1.32 +AC_DEFUN([AS_VERSION],
1.33 +[
1.34 + PACKAGE=[$1]
1.35 + [$2]_MAJOR=[$3]
1.36 + [$2]_MINOR=[$4]
1.37 + [$2]_MICRO=[$5]
1.38 + NANO=[$6]
1.39 + [$2]_NANO=$NANO
1.40 + if test "x$NANO" = "x" || test "x$NANO" = "x0";
1.41 + then
1.42 + AC_MSG_NOTICE(configuring [$1] for release)
1.43 + VERSION=[$3].[$4].[$5]
1.44 + [$2]_RELEASE=1
1.45 + dnl execute action
1.46 + ifelse([$7], , :, [$7])
1.47 + else
1.48 + AC_MSG_NOTICE(configuring [$1] for development with nano $NANO)
1.49 + VERSION=[$3].[$4].[$5].$NANO
1.50 + [$2]_RELEASE=0.`date +%Y%m%d.%H%M%S`
1.51 + dnl execute action
1.52 + ifelse([$8], , :, [$8])
1.53 + fi
1.54 +
1.55 + [$2]=$VERSION
1.56 + AC_DEFINE_UNQUOTED([$2], "$[$2]", [Define the version])
1.57 + AC_SUBST([$2])
1.58 + AC_DEFINE_UNQUOTED([$2]_RELEASE, "$[$2]_RELEASE", [Define the release version])
1.59 + AC_SUBST([$2]_RELEASE)
1.60 +
1.61 + AC_SUBST([$2]_MAJOR)
1.62 + AC_SUBST([$2]_MINOR)
1.63 + AC_SUBST([$2]_MICRO)
1.64 + AC_SUBST([$2]_NANO)
1.65 + AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Define the package name])
1.66 + AC_SUBST(PACKAGE)
1.67 + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Define the version])
1.68 + AC_SUBST(VERSION)
1.69 +])
1.70 +