renatofilho@320: dnl version.m4 0.0.5 renatofilho@320: dnl autostars m4 macro for versioning renatofilho@320: dnl thomas@apestaart.org renatofilho@320: dnl renatofilho@320: dnl AS_VERSION(PACKAGE, PREFIX, MAJOR, MINOR, MICRO, NANO, ACTION_IF_NO_NANO, ACTION_IF_NANO) renatofilho@320: dnl example renatofilho@320: dnl AS_VERSION(gstreamer, GST_VERSION, 0, 3, 2,) renatofilho@320: dnl for a 0.3.2 release version renatofilho@320: dnl renatofilho@320: dnl this macro renatofilho@320: dnl - defines [$PREFIX]_MAJOR, MINOR and MICRO renatofilho@320: dnl - if NANO is empty, then we're in release mode, else in cvs/dev mode renatofilho@320: dnl - defines [$PREFIX], VERSION, and [$PREFIX]_RELEASE renatofilho@320: dnl - executes the relevant action renatofilho@320: dnl - AC_SUBST's PACKAGE, VERSION, [$PREFIX] and [$PREFIX]_RELEASE renatofilho@320: dnl as well as the little ones renatofilho@320: dnl - doesn't call AM_INIT_AUTOMAKE anymore because it prevents renatofilho@320: dnl maintainer mode from running ok renatofilho@320: dnl renatofilho@320: dnl don't forget to put #undef [$2] and [$2]_RELEASE in acconfig.h renatofilho@320: renatofilho@320: AC_DEFUN([AS_VERSION], renatofilho@320: [ renatofilho@320: PACKAGE=[$1] renatofilho@320: [$2]_MAJOR_VERSION=[$3] renatofilho@320: [$2]_MINOR_VERSION=[$4] renatofilho@320: [$2]_MICRO_VERSION=[$5] renatofilho@320: NANO=[$6] renatofilho@320: [$2]_NANO_VERSION=$NANO renatofilho@320: if test "x$NANO" = "x" || test "x$NANO" = "x0"; renatofilho@320: then renatofilho@320: AC_MSG_NOTICE(configuring [$1] for release) renatofilho@320: VERSION=[$3].[$4].[$5] renatofilho@320: [$2]_RELEASE=1 renatofilho@320: dnl execute action renatofilho@320: ifelse([$7], , :, [$7]) renatofilho@320: else renatofilho@320: AC_MSG_NOTICE(configuring [$1] for development with nano $NANO) renatofilho@320: VERSION=[$3].[$4].[$5].$NANO renatofilho@320: [$2]_RELEASE=`date +%Y%m%d_%H%M%S` renatofilho@320: dnl execute action renatofilho@320: ifelse([$8], , :, [$8]) renatofilho@320: fi renatofilho@320: renatofilho@320: [$2]_VERSION=$VERSION renatofilho@320: AC_DEFINE_UNQUOTED([$2]_VERSION, "$[$2]_VERSION", [Define the version]) renatofilho@320: AC_SUBST([$2]_VERSION) renatofilho@320: renatofilho@320: AC_SUBST([$2]_RELEASE) renatofilho@320: renatofilho@320: AC_SUBST([$2]_MAJOR_VERSION) renatofilho@320: AC_SUBST([$2]_MINOR_VERSION) renatofilho@320: AC_SUBST([$2]_MICRO_VERSION) renatofilho@320: AC_SUBST([$2]_NANO_VERSION) renatofilho@320: AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Define the package name]) renatofilho@320: AC_SUBST(PACKAGE) renatofilho@320: AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Define the version]) renatofilho@320: AC_SUBST(VERSION) renatofilho@320: ])