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