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