|
From: Mark W. <ma...@so...> - 2021-10-17 21:49:04
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=5aca524f5a2980aee2596b9425f52060370e4279 commit 5aca524f5a2980aee2596b9425f52060370e4279 Author: Mark Wielaard <ma...@kl...> Date: Sun Oct 17 22:13:25 2021 +0200 Set version once in configure.ac, use in valgrind.h andvg-entities.xml 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. Diff: --- .gitignore | 5 +++++ configure.ac | 28 +++++++++++++++++++++++- docs/xml/{vg-entities.xml => vg-entities.xml.in} | 4 ++-- include/{valgrind.h => valgrind.h.in} | 4 ++-- 4 files changed, 36 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 077058207e..6a94e6c82d 100644 --- a/.gitignore +++ b/.gitignore @@ -68,6 +68,10 @@ # /auxprogs/auxchecks/ /auxprogs/auxchecks/* +# /docs/ +/docs/print/ +/docs/xml/vg-entities.xml + # /cachegrind/ /cachegrind/*.so /cachegrind/.deps @@ -693,6 +697,7 @@ /include/Makefile.in /include/Makefile /include/tool.h +/include/valgrind.h /include/vgversion.h # /include/vki/ diff --git a/configure.ac b/configure.ac index b851798f51..d5683f2b5b 100755 --- a/configure.ac +++ b/configure.ac @@ -8,7 +8,30 @@ ##------------------------------------------------------------## # Process this file with autoconf to produce a configure script. -AC_INIT([Valgrind],[3.18.1],[val...@li...]) +# +# 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],[val...@li...]) + +# 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} diff --git a/docs/xml/vg-entities.xml b/docs/xml/vg-entities.xml.in similarity index 97% rename from docs/xml/vg-entities.xml rename to docs/xml/vg-entities.xml.in index d986a02573..681f607711 100644 --- a/docs/xml/vg-entities.xml +++ b/docs/xml/vg-entities.xml.in @@ -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"> diff --git a/include/valgrind.h b/include/valgrind.h.in similarity index 99% rename from include/valgrind.h rename to include/valgrind.h.in index 04254df8c7..aa0b431256 100644 --- a/include/valgrind.h +++ b/include/valgrind.h.in @@ -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> |