Home | History | Annotate | Download | only in m4
      1 dnl as-mix-version.m4 
      2 
      3 dnl AS_MIX_VERSION(PACKAGE, PREFIX, MAJOR, MINOR, RELEASE)
      4 
      5 dnl example
      6 dnl AS_MIX_VERSION(mixvideo,MIXVIDEO, 0, 3, 2,)
      7 dnl for a 0.3.2 release version
      8 
      9 dnl this macro
     10 dnl - defines [$PREFIX]_MAJOR, MINOR and REVISION, CURRENT, AGE
     11 dnl - defines [$PREFIX], VERSION
     12 dnl - AC_SUBST's all defined vars
     13 
     14 AC_DEFUN([AS_MIX_VERSION],
     15 [
     16   PACKAGE=[$1]
     17   [$2]_MAJOR=[$3]
     18   [$2]_MINOR=[$4]
     19   [$2]_REVISION=[$5]
     20   [$2]_CURRENT=m4_eval([$3] + [$4])
     21   [$2]_AGE=[$4]
     22   VERSION=[$3].[$4].[$5]
     23 
     24   AC_SUBST([$2]_MAJOR)
     25   AC_SUBST([$2]_MINOR)
     26   AC_SUBST([$2]_REVISION)
     27   AC_SUBST([$2]_CURRENT)
     28   AC_SUBST([$2]_AGE)
     29 
     30   AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Define the package name])
     31   AC_SUBST(PACKAGE)
     32   AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Define the version])
     33   AC_SUBST(VERSION)
     34   
     35 ])
     36