renatofilho@584: dnl as-version.m4 0.1.0 renatofilho@584: renatofilho@584: dnl autostars m4 macro for versioning renatofilho@584: renatofilho@584: dnl Thomas Vander Stichele renatofilho@584: renatofilho@584: dnl $Id: as-version.m4,v 1.1 2005/06/18 18:02:46 burgerman Exp $ renatofilho@584: renatofilho@584: dnl AS_VERSION(PACKAGE, PREFIX, MAJOR, MINOR, MICRO, NANO, renatofilho@584: dnl ACTION-IF-NO-NANO, [ACTION-IF-NANO]) renatofilho@584: renatofilho@584: dnl example renatofilho@584: dnl AS_VERSION(gstreamer, GST_VERSION, 0, 3, 2,) renatofilho@584: dnl for a 0.3.2 release version renatofilho@584: renatofilho@584: dnl this macro renatofilho@584: dnl - defines [$PREFIX]_MAJOR, MINOR and MICRO renatofilho@584: dnl - if NANO is empty, then we're in release mode, else in cvs/dev mode renatofilho@584: dnl - defines [$PREFIX], VERSION, and [$PREFIX]_RELEASE renatofilho@584: dnl - executes the relevant action renatofilho@584: dnl - AC_SUBST's PACKAGE, VERSION, [$PREFIX] and [$PREFIX]_RELEASE renatofilho@584: dnl as well as the little ones renatofilho@584: dnl - doesn't call AM_INIT_AUTOMAKE anymore because it prevents renatofilho@584: dnl maintainer mode from running ok renatofilho@584: dnl renatofilho@584: dnl don't forget to put #undef [$2] and [$2]_RELEASE in acconfig.h renatofilho@584: dnl if you use acconfig.h renatofilho@584: renatofilho@584: AC_DEFUN([AS_VERSION], renatofilho@584: [ renatofilho@584: PACKAGE=[$1] renatofilho@584: [$2]_MAJOR=[$3] renatofilho@584: [$2]_MINOR=[$4] renatofilho@584: [$2]_MICRO=[$5] renatofilho@584: NANO=[$6] renatofilho@584: [$2]_NANO=$NANO renatofilho@584: if test "x$NANO" = "x" || test "x$NANO" = "x0"; renatofilho@584: then renatofilho@584: AC_MSG_NOTICE(configuring [$1] for release) renatofilho@584: VERSION=[$3].[$4].[$5] renatofilho@584: [$2]_RELEASE=1 renatofilho@584: dnl execute action renatofilho@584: ifelse([$7], , :, [$7]) renatofilho@584: else renatofilho@584: AC_MSG_NOTICE(configuring [$1] for development with nano $NANO) renatofilho@584: VERSION=[$3].[$4].[$5].$NANO renatofilho@584: [$2]_RELEASE=0.`date +%Y%m%d.%H%M%S` renatofilho@584: dnl execute action renatofilho@584: ifelse([$8], , :, [$8]) renatofilho@584: fi renatofilho@584: renatofilho@584: [$2]=$VERSION renatofilho@584: AC_DEFINE_UNQUOTED([$2], "$[$2]", [Define the version]) renatofilho@584: AC_SUBST([$2]) renatofilho@584: AC_DEFINE_UNQUOTED([$2]_RELEASE, "$[$2]_RELEASE", [Define the release version]) renatofilho@584: AC_SUBST([$2]_RELEASE) renatofilho@584: renatofilho@584: AC_SUBST([$2]_MAJOR) renatofilho@584: AC_SUBST([$2]_MINOR) renatofilho@584: AC_SUBST([$2]_MICRO) renatofilho@584: AC_SUBST([$2]_NANO) renatofilho@584: AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Define the package name]) renatofilho@584: AC_SUBST(PACKAGE) renatofilho@584: AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Define the version]) renatofilho@584: AC_SUBST(VERSION) renatofilho@584: ]) renatofilho@584: