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