gst-plugins-nuvdemux/m4/as-version.m4
author rosfran
Tue Apr 17 15:37:20 2007 +0100 (2007-04-17)
branchtrunk
changeset 559 994917e6cadf
permissions -rwxr-xr-x
[svn r564] Put GStreamer based auto-documentation.
melunko@47
     1
dnl as-version.m4 0.1.0
melunko@47
     2
melunko@47
     3
dnl autostars m4 macro for versioning
melunko@47
     4
melunko@47
     5
dnl Thomas Vander Stichele <thomas at apestaart dot org>
melunko@47
     6
melunko@47
     7
dnl $Id: as-version.m4,v 1.1 2005/06/18 18:02:46 burgerman Exp $
melunko@47
     8
melunko@47
     9
dnl AS_VERSION(PACKAGE, PREFIX, MAJOR, MINOR, MICRO, NANO,
melunko@47
    10
dnl            ACTION-IF-NO-NANO, [ACTION-IF-NANO])
melunko@47
    11
melunko@47
    12
dnl example
melunko@47
    13
dnl AS_VERSION(gstreamer, GST_VERSION, 0, 3, 2,)
melunko@47
    14
dnl for a 0.3.2 release version
melunko@47
    15
melunko@47
    16
dnl this macro
melunko@47
    17
dnl - defines [$PREFIX]_MAJOR, MINOR and MICRO
melunko@47
    18
dnl - if NANO is empty, then we're in release mode, else in cvs/dev mode
melunko@47
    19
dnl - defines [$PREFIX], VERSION, and [$PREFIX]_RELEASE
melunko@47
    20
dnl - executes the relevant action
melunko@47
    21
dnl - AC_SUBST's PACKAGE, VERSION, [$PREFIX] and [$PREFIX]_RELEASE
melunko@47
    22
dnl   as well as the little ones
melunko@47
    23
dnl - doesn't call AM_INIT_AUTOMAKE anymore because it prevents
melunko@47
    24
dnl   maintainer mode from running ok
melunko@47
    25
dnl
melunko@47
    26
dnl don't forget to put #undef [$2] and [$2]_RELEASE in acconfig.h
melunko@47
    27
dnl if you use acconfig.h
melunko@47
    28
melunko@47
    29
AC_DEFUN([AS_VERSION],
melunko@47
    30
[
melunko@47
    31
  PACKAGE=[$1]
melunko@47
    32
  [$2]_MAJOR=[$3]
melunko@47
    33
  [$2]_MINOR=[$4]
melunko@47
    34
  [$2]_MICRO=[$5]
melunko@47
    35
  NANO=[$6]
melunko@47
    36
  [$2]_NANO=$NANO
melunko@47
    37
  if test "x$NANO" = "x" || test "x$NANO" = "x0";
melunko@47
    38
  then
melunko@47
    39
      AC_MSG_NOTICE(configuring [$1] for release)
melunko@47
    40
      VERSION=[$3].[$4].[$5]
melunko@47
    41
      [$2]_RELEASE=1
melunko@47
    42
      dnl execute action
melunko@47
    43
      ifelse([$7], , :, [$7])
melunko@47
    44
  else
melunko@47
    45
      AC_MSG_NOTICE(configuring [$1] for development with nano $NANO)
melunko@47
    46
      VERSION=[$3].[$4].[$5].$NANO
melunko@47
    47
      [$2]_RELEASE=0.`date +%Y%m%d.%H%M%S`
melunko@47
    48
      dnl execute action
melunko@47
    49
      ifelse([$8], , :, [$8])
melunko@47
    50
  fi
melunko@47
    51
melunko@47
    52
  [$2]=$VERSION
melunko@47
    53
  AC_DEFINE_UNQUOTED([$2], "$[$2]", [Define the version])
melunko@47
    54
  AC_SUBST([$2])
melunko@47
    55
  AC_DEFINE_UNQUOTED([$2]_RELEASE, "$[$2]_RELEASE", [Define the release version])
melunko@47
    56
  AC_SUBST([$2]_RELEASE)
melunko@47
    57
melunko@47
    58
  AC_SUBST([$2]_MAJOR)
melunko@47
    59
  AC_SUBST([$2]_MINOR)
melunko@47
    60
  AC_SUBST([$2]_MICRO)
melunko@47
    61
  AC_SUBST([$2]_NANO)
melunko@47
    62
  AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Define the package name])
melunko@47
    63
  AC_SUBST(PACKAGE)
melunko@47
    64
  AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Define the version])
melunko@47
    65
  AC_SUBST(VERSION)
melunko@47
    66
])
melunko@47
    67