# HG changeset patch # User John W. Eaton # Date 1389112581 18000 # Node ID b6b6e0dc700e62d2ddfebc470f8d4ab8105f4cbc # Parent 64f178d8e1e0aebf31a28033c2ad7ce9f311bf85 provide version number macros (bug #41045) * configure.ac (OCTAVE_MAJOR_VERSION, OCTAVE_MINOR_VERSION, OCTAVE_PATCH_VERSION): New variables. * common.mk: Substitute them. * version.in.h: Substitute them. * libinterp/Makefile.am (version.h): Don't substitute OCTAVE_API_VERSION_NUMBER. diff -r 64f178d8e1e0 -r b6b6e0dc700e build-aux/common.mk --- a/build-aux/common.mk Sun Jan 05 15:37:51 2014 -0200 +++ b/build-aux/common.mk Tue Jan 07 11:36:21 2014 -0500 @@ -22,7 +22,9 @@ DESKTOP_FILE_INSTALL = @DESKTOP_FILE_INSTALL@ OCTAVE_VERSION = @OCTAVE_VERSION@ -OCTAVE_API_VERSION_NUMBER = @OCTAVE_API_VERSION_NUMBER@ +OCTAVE_MAJOR_VERSION = @OCTAVE_MAJOR_VERSION@ +OCTAVE_MINOR_VERSION = @OCTAVE_MINOR_VERSION@ +OCTAVE_PATCH_VERSION = @OCTAVE_PATCH_VERSION@ OCTAVE_API_VERSION = @OCTAVE_API_VERSION@ OCTAVE_RELEASE_DATE = @OCTAVE_RELEASE_DATE@ OCTAVE_COPYRIGHT = @OCTAVE_COPYRIGHT@ diff -r 64f178d8e1e0 -r b6b6e0dc700e configure.ac --- a/configure.ac Sun Jan 05 15:37:51 2014 -0200 +++ b/configure.ac Tue Jan 07 11:36:21 2014 -0500 @@ -21,17 +21,41 @@ AC_PREREQ([2.62]) AC_INIT([GNU Octave], [3.8.0], [http://octave.org/bugs.html], [octave]) +dnl Note that the version number is duplicated here and in AC_INIT +dnl because AC_INIT requires it to be static, not computed from +dnl shell variables. +OCTAVE_MAJOR_VERSION=3 +OCTAVE_MINOR_VERSION=8 +OCTAVE_PATCH_VERSION=0 + dnl PACKAGE_VERSION is set by the AC_INIT VERSION arg OCTAVE_VERSION="$PACKAGE_VERSION" -OCTAVE_API_VERSION_NUMBER="49" -OCTAVE_API_VERSION="api-v$OCTAVE_API_VERSION_NUMBER+" + +OCTAVE_COPYRIGHT="Copyright (C) 2013 John W. Eaton and others." + OCTAVE_RELEASE_DATE="2013-12-27" -OCTAVE_COPYRIGHT="Copyright (C) 2013 John W. Eaton and others." + +## The "API version" is used as a way of checking that interfaces in the +## liboctave and libinterp libraries haven't changed in a backwardly +## incompatible way when loading .oct files. A better way to do that is +## with library versioning, but not all systems support that. +## NOTE: This macro will be removed in a future version of Octave. If +## you insist on checking for features using a version number, use the +## OCTAVE_MAJOR_VERSION, OCTAVE_MINOR_VERSION, and +## OCTAVE_PATCH_VERSION macros instead. +## FIXME: Since we also set libtool versions for liboctave and +## libinterp, perhaps we should be computing the "api version" from +## those versions numbers in some way instead of setting it +## independently here. +OCTAVE_API_VERSION="api-v49+" + +AC_SUBST(OCTAVE_MAJOR_VERSION) +AC_SUBST(OCTAVE_MINOR_VERSION) +AC_SUBST(OCTAVE_PATCH_VERSION) AC_SUBST(OCTAVE_VERSION) -AC_SUBST(OCTAVE_API_VERSION_NUMBER) +AC_SUBST(OCTAVE_COPYRIGHT) +AC_SUBST(OCTAVE_RELEASE_DATE) AC_SUBST(OCTAVE_API_VERSION) -AC_SUBST(OCTAVE_RELEASE_DATE) -AC_SUBST(OCTAVE_COPYRIGHT) dnl FIXME: We should auto-insert the Mercurial changeset ID into the dnl AC_REVISION field whenever configure.ac is modified. diff -r 64f178d8e1e0 -r b6b6e0dc700e libinterp/Makefile.am --- a/libinterp/Makefile.am Sun Jan 05 15:37:51 2014 -0200 +++ b/libinterp/Makefile.am Tue Jan 07 11:36:21 2014 -0500 @@ -271,9 +271,11 @@ version.h: version.in.h Makefile $(SED) < $< \ -e "s|%NO_EDIT_WARNING%|DO NOT EDIT! Generated automatically from $( $@-t mv $@-t $@ diff -r 64f178d8e1e0 -r b6b6e0dc700e libinterp/version.in.h --- a/libinterp/version.in.h Sun Jan 05 15:37:51 2014 -0200 +++ b/libinterp/version.in.h Tue Jan 07 11:36:21 2014 -0500 @@ -26,6 +26,20 @@ #define OCTAVE_VERSION %OCTAVE_VERSION% +#define OCTAVE_MAJOR_VERSION %OCTAVE_MAJOR_VERSION% + +#define OCTAVE_MINOR_VERSION %OCTAVE_MINOR_VERSION% + +#define OCTAVE_PATCH_VERSION %OCTAVE_PATCH_VERSION% + +// The "API version" is used as a way of checking that interfaces in the +// liboctave and libinterp libraries haven't changed in a backwardly +// incompatible way when loading .oct files. A better way to do that is +// with library versioning, but not all systems support that. +// NOTE: This macro will be removed in a future version of Octave. If +// you insist on checking for features using a version number, use the +// OCTAVE_MAJOR_VERSION, OCTAVE_MINOR_VERSION, and +// OCTAVE_PATCH_VERSION macros instead. #define OCTAVE_API_VERSION %OCTAVE_API_VERSION% #define OCTAVE_RELEASE_DATE %OCTAVE_RELEASE_DATE%