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