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