Skip to content

Commit 8ad1bbf

Browse files
jodaviestueda
authored andcommitted
feat: add pre-processor variable for subsubversion / patchversion
Set this in form3.h, used if git-version-gen.sh fails to set the version information. Also added to the manual. Also remove the "beta" tag, in preparation for v5.0.0 release.
1 parent 25f4ded commit 8ad1bbf

4 files changed

Lines changed: 19 additions & 14 deletions

File tree

configure.ac

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,16 @@ m4_define([FORM_VERSION], m4_esyscmd_s([
1717
# As a fallback, try for form3.h.
1818
major_version=`grep MAJORVERSION sources/form3.h | sed -e 's/ *#define *MAJORVERSION *//'`
1919
minor_version=`grep MINORVERSION sources/form3.h | sed -e 's/ *#define *MINORVERSION *//'`
20-
if test "x$major_version" != x && test "x$minor_version" != x; then
20+
patch_version=`grep PATCHVERSION sources/form3.h | sed -e 's/ *#define *PATCHVERSION *//'`
21+
if test "x$major_version" != x && test "x$minor_version" != x && test "x$patch_version" != x; then
2122
# Make the version files.
22-
echo "$major_version.$minor_version" >.version
23+
echo "$major_version.$minor_version.$patch_version" >.version
2324
echo "#define REPO_MAJOR_VERSION $major_version" >sources/version.h.in
2425
echo "#define REPO_MINOR_VERSION $minor_version" >>sources/version.h.in
26+
echo "#define REPO_PATCH_VERSION $patch_version" >>sources/version.h.in
2527
echo '\\def\\repomajorversion'"{$major_version}" >doc/manual/version.tex.in
2628
echo '\\def\\repominorversion'"{$minor_version}" >>doc/manual/version.tex.in
29+
echo '\\def\\repopatchversion'"{$patch_version}" >>doc/manual/version.tex.in
2730
cp doc/manual/version.tex.in doc/devref/version.tex.in
2831
touch doc/doxygen/version.sh.in
2932
fi

doc/manual/prepro.tex

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,9 @@ \section{The preprocessor variables}
6060
\noindent \FORM\ has a number of built in preprocessor variables. They are:
6161

6262
\begin{description}
63-
\item[VERSION\_] The current version\index{VERSION\_} as the \formmajorversion{} in
64-
\formmajorversion.\formminorversion.
65-
\item[SUBVERSION\_] The sub-version\index{SUBVERSION\_} as the \formminorversion{} in
66-
\formmajorversion.\formminorversion.
63+
\item[VERSION\_] The current version\index{VERSION\_} (or ``major version''), as the ``1'' in 1.2.3.
64+
\item[SUBVERSION\_] The current sub-version\index{SUBVERSION\_} (or ``minor version''), as the ``2'' in 1.2.3.
65+
\item[SUBSUBVERSION\_] The current sub-sub-version\index{SUBSUBVERSION\_} (or ``patch version''), as the ``3'' in 1.2.3.
6766
\item[NAME\_] The name\index{NAME\_} of the program file.
6867
\item[DATE\_] The date\index{DATE\_} of the current run.
6968
\item[CMODULE\_] The number\index{CMODULE\_} of the current module.

sources/form3.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,16 @@
4646

4747
#define MAJORVERSION 5
4848
#define MINORVERSION 0
49+
#define PATCHVERSION 0
4950

5051
#ifdef __DATE__
5152
#define PRODUCTIONDATE __DATE__
5253
#else
53-
#define PRODUCTIONDATE "8-nov-2022"
54+
#define PRODUCTIONDATE "27-jan-2026"
5455
#endif
5556

56-
/*#undef BETAVERSION */
57-
#define BETAVERSION
57+
#undef BETAVERSION
58+
/*#define BETAVERSION*/
5859

5960
#ifdef LINUX32
6061
#define UNIX

sources/startup.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
/* We have also version.h. */
7676
#include "version.h"
7777
#ifndef REPO_VERSION
78-
#define REPO_VERSION STRINGIFY(REPO_MAJOR_VERSION) "." STRINGIFY(REPO_MINOR_VERSION)
78+
#define REPO_VERSION STRINGIFY(REPO_MAJOR_VERSION) "." STRINGIFY(REPO_MINOR_VERSION) "." STRINGIFY(REPO_PATCH_VERSION)
7979
#endif
8080
#ifndef REPO_DATE
8181
/* The build date, instead of the repo date. */
@@ -88,15 +88,16 @@
8888
#endif
8989
#define MAJORVERSION REPO_MAJOR_VERSION
9090
#define MINORVERSION REPO_MINOR_VERSION
91+
#define PATCHVERSION REPO_PATCH_VERSION
9192
#else
9293
/*
93-
* Otherwise, form3.h defines MAJORVERSION, MINORVERSION and PRODUCTIONDATE,
94-
* possibly BETAVERSION.
94+
* Otherwise, form3.h defines MAJORVERSION, MINORVERSION, PATCHVERSION
95+
* and PRODUCTIONDATE, possibly BETAVERSION.
9596
*/
9697
#ifdef BETAVERSION
97-
#define VERSIONSTR__ STRINGIFY(MAJORVERSION) "." STRINGIFY(MINORVERSION) "Beta"
98+
#define VERSIONSTR__ STRINGIFY(MAJORVERSION) "." STRINGIFY(MINORVERSION) "." STRINGIFY(PATCHVERSION) "Beta"
9899
#else
99-
#define VERSIONSTR__ STRINGIFY(MAJORVERSION) "." STRINGIFY(MINORVERSION)
100+
#define VERSIONSTR__ STRINGIFY(MAJORVERSION) "." STRINGIFY(MINORVERSION) "." STRINGIFY(PATCHVERSION)
100101
#endif
101102
#define VERSIONSTR FORMNAME " " VERSIONSTR__ " (" PRODUCTIONDATE ")"
102103
#endif
@@ -1236,6 +1237,7 @@ void StartVariables(void)
12361237
AM.oldnumextrasymbols = strDup1((UBYTE *)"OLDNUMEXTRASYMBOLS_","oldnumextrasymbols");
12371238
PutPreVar((UBYTE *)"VERSION_",(UBYTE *)STRINGIFY(MAJORVERSION),0,0);
12381239
PutPreVar((UBYTE *)"SUBVERSION_",(UBYTE *)STRINGIFY(MINORVERSION),0,0);
1240+
PutPreVar((UBYTE *)"SUBSUBVERSION_",(UBYTE *)STRINGIFY(PATCHVERSION),0,0);
12391241
PutPreVar((UBYTE *)"DATE_",(UBYTE *)MakeDate(),0,0);
12401242
PutPreVar((UBYTE *)"random_",(UBYTE *)"________",0,0);
12411243
PutPreVar((UBYTE *)"optimminvar_",(UBYTE *)("0"),0,0);

0 commit comments

Comments
 (0)