maemo-ui-old/m4/as-version.m4
author melunko
Wed Aug 01 14:50:29 2007 +0100 (2007-08-01)
branchtrunk
changeset 790 7a914b3fafc1
parent 23 maemo-ui/m4/as-version.m4@915ef81992c0
permissions -rw-r--r--
[svn r796] Moved maemo-ui to maemo-ui-old
     1 dnl version.m4 0.0.5
     2 dnl autostars m4 macro for versioning
     3 dnl thomas@apestaart.org
     4 dnl
     5 dnl AS_VERSION(PACKAGE, PREFIX, MAJOR, MINOR, MICRO, NANO, ACTION_IF_NO_NANO, ACTION_IF_NANO)
     6 dnl example
     7 dnl AS_VERSION(gstreamer, GST_VERSION, 0, 3, 2,)
     8 dnl for a 0.3.2 release version
     9 dnl
    10 dnl this macro
    11 dnl - defines [$PREFIX]_MAJOR, MINOR and MICRO
    12 dnl - if NANO is empty, then we're in release mode, else in cvs/dev mode
    13 dnl - defines [$PREFIX], VERSION, and [$PREFIX]_RELEASE
    14 dnl - executes the relevant action
    15 dnl - AC_SUBST's PACKAGE, VERSION, [$PREFIX] and [$PREFIX]_RELEASE
    16 dnl   as well as the little ones
    17 dnl - doesn't call AM_INIT_AUTOMAKE anymore because it prevents
    18 dnl   maintainer mode from running ok
    19 dnl
    20 dnl don't forget to put #undef [$2] and [$2]_RELEASE in acconfig.h
    21 
    22 AC_DEFUN([AS_VERSION],
    23 [
    24   PACKAGE=[$1]
    25   [$2]_MAJOR_VERSION=[$3]
    26   [$2]_MINOR_VERSION=[$4]
    27   [$2]_MICRO_VERSION=[$5]
    28   NANO=[$6]
    29   [$2]_NANO_VERSION=$NANO
    30   if test "x$NANO" = "x" || test "x$NANO" = "x0";
    31   then
    32       AC_MSG_NOTICE(configuring [$1] for release)
    33       VERSION=[$3].[$4].[$5]
    34       [$2]_RELEASE=1
    35       dnl execute action
    36       ifelse([$7], , :, [$7])
    37   else
    38       AC_MSG_NOTICE(configuring [$1] for development with nano $NANO)
    39       VERSION=[$3].[$4].[$5].$NANO
    40       [$2]_RELEASE=`date +%Y%m%d_%H%M%S`
    41       dnl execute action
    42       ifelse([$8], , :, [$8])
    43   fi
    44 
    45   [$2]_VERSION=$VERSION
    46   AC_DEFINE_UNQUOTED([$2]_VERSION, "$[$2]_VERSION", [Define the version])
    47   AC_SUBST([$2]_VERSION)
    48   
    49   AC_SUBST([$2]_RELEASE)
    50 
    51   AC_SUBST([$2]_MAJOR_VERSION)
    52   AC_SUBST([$2]_MINOR_VERSION)
    53   AC_SUBST([$2]_MICRO_VERSION)
    54   AC_SUBST([$2]_NANO_VERSION)
    55   AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Define the package name])
    56   AC_SUBST(PACKAGE)
    57   AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Define the version])
    58   AC_SUBST(VERSION)
    59 ])