]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Set version once in configure.ac, use in valgrind.h andvg-entities.xml
authorMark Wielaard <mark@klomp.org>
Sun, 17 Oct 2021 20:13:25 +0000 (22:13 +0200)
committerMark Wielaard <mark@klomp.org>
Sun, 17 Oct 2021 21:14:50 +0000 (23:14 +0200)
Currently the version is updated in 3 places, configure.ac,
include/valgrind.h and docs/xml/vg-entities.xml. This goes wrong from
time to time. So only define the version (and release date) once in
configure.ac and update both other places at configure time.

.gitignore
configure.ac
docs/xml/vg-entities.xml.in [moved from docs/xml/vg-entities.xml with 97% similarity]
include/valgrind.h.in [moved from include/valgrind.h with 99% similarity]

index 077058207ed35bd1e008875138462795d920f924..6a94e6c82d20c699139bd3a654dd7c0c42c2c47f 100644 (file)
 # /auxprogs/auxchecks/
 /auxprogs/auxchecks/*
 
+# /docs/
+/docs/print/
+/docs/xml/vg-entities.xml
+
 # /cachegrind/
 /cachegrind/*.so
 /cachegrind/.deps
 /include/Makefile.in
 /include/Makefile
 /include/tool.h
+/include/valgrind.h
 /include/vgversion.h
 
 # /include/vki/
index b851798f5146ace2fc43863735f6e96519134f6b..d5683f2b5b33364fa6a4e0a5afd2ab2cb052ee7c 100755 (executable)
@@ -8,7 +8,30 @@
 ##------------------------------------------------------------##
 
 # Process this file with autoconf to produce a configure script.
-AC_INIT([Valgrind],[3.18.1],[valgrind-users@lists.sourceforge.net])
+#
+# Define major, minor, micro and suffix here once, then reuse them
+# for version number in valgrind.h and vg-entities (documentation).
+# suffix must be empty for a release, otherwise it is GIT or RC1, etc.
+# Also set the (expected/last) release date here.
+# Do not forget to rerun ./autogen.sh
+m4_define([v_major_ver], [3])
+m4_define([v_minor_ver], [18])
+m4_define([v_micro_ver], [1])
+m4_define([v_suffix_ver], [])
+m4_define([v_rel_date], ["15 Oct 2021"])
+m4_define([v_version],
+         m4_if(v_suffix_ver, [],
+               [v_major_ver.v_minor_ver.v_micro_ver],
+               [v_major_ver.v_minor_ver.v_micro_ver.v_suffix_ver]))
+AC_INIT([Valgrind],[v_version],[valgrind-users@lists.sourceforge.net])
+
+# For valgrind.h
+AC_SUBST(VG_VER_MAJOR, v_major_ver)
+AC_SUBST(VG_VER_MINOR, v_minor_ver)
+
+# For docs/xml/vg-entities.xml
+AC_SUBST(VG_DATE, v_rel_date)
+
 AC_CONFIG_SRCDIR(coregrind/m_main.c)
 AC_CONFIG_HEADERS([config.h])
 AM_INIT_AUTOMAKE([foreign dist-bzip2 subdir-objects])
@@ -5121,7 +5144,9 @@ AC_CONFIG_FILES([
    glibc-2.X.supp
    glibc-2.X-helgrind.supp
    glibc-2.X-drd.supp
+   include/valgrind.h
    docs/Makefile 
+   docs/xml/vg-entities.xml
    tests/Makefile 
    tests/vg_regtest 
    perf/Makefile 
@@ -5255,6 +5280,7 @@ AC_OUTPUT
 
 cat<<EOF
 
+                    Version: ${VERSION}
          Maximum build arch: ${ARCH_MAX}
          Primary build arch: ${VGCONF_ARCH_PRI}
        Secondary build arch: ${VGCONF_ARCH_SEC}
similarity index 97%
rename from docs/xml/vg-entities.xml
rename to docs/xml/vg-entities.xml.in
index d986a025733dd6a0f068091e467202e179746da9..681f6077114ba8a3b6ec64165ddea48d7cbfe11a 100644 (file)
@@ -6,8 +6,8 @@
 
 <!-- valgrind release + version stuff -->
 <!ENTITY rel-type    "Release">
-<!ENTITY rel-version "3.18.0">
-<!ENTITY rel-date    "15 Oct 2021">
+<!ENTITY rel-version "@VERSION@">
+<!ENTITY rel-date    "@VG_DATE@">
 
 <!-- where the docs are installed -->
 <!ENTITY vg-docs-path  "$INSTALL/share/doc/valgrind/html/index.html">
similarity index 99%
rename from include/valgrind.h
rename to include/valgrind.h.in
index 04254df8c77018a62308f70eb8e45bd1a8c1505f..aa0b431256e14da602064c1052c2c5fb5f7f88d4 100644 (file)
@@ -88,8 +88,8 @@
     && (__VALGRIND_MAJOR__ > 3                                   \
         || (__VALGRIND_MAJOR__ == 3 && __VALGRIND_MINOR__ >= 6))
 */
-#define __VALGRIND_MAJOR__    3
-#define __VALGRIND_MINOR__    18
+#define __VALGRIND_MAJOR__    @VG_VER_MAJOR@
+#define __VALGRIND_MINOR__    @VG_VER_MINOR@
 
 
 #include <stdarg.h>