From 5aca524f5a2980aee2596b9425f52060370e4279 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Sun, 17 Oct 2021 22:13:25 +0200 Subject: [PATCH] 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. --- .gitignore | 5 ++++ configure.ac | 28 ++++++++++++++++++- .../{vg-entities.xml => vg-entities.xml.in} | 4 +-- include/{valgrind.h => valgrind.h.in} | 4 +-- 4 files changed, 36 insertions(+), 5 deletions(-) rename docs/xml/{vg-entities.xml => vg-entities.xml.in} (97%) rename include/{valgrind.h => valgrind.h.in} (99%) diff --git a/.gitignore b/.gitignore index 077058207..6a94e6c82 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 b851798f5..d5683f2b5 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],[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< - - + + 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 04254df8c..aa0b43125 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