From a7e1572d3657cb43c1c77b030f28a17a2d1f3919 Mon Sep 17 00:00:00 2001 From: Aaron Schrab Date: Wed, 10 Apr 2019 19:44:46 -0400 Subject: [PATCH] Generate version string during make not configure Switch to generating the version string during make process rather than at configure time. This makes it easier to keep the detailed version string accurate when doing development which doesn't require that the configure script be rerun. --- .gitignore | 1 + Makefile.am | 7 ++++++- commands.c | 1 + compose.c | 1 + configure.ac | 3 --- dotlock.c | 1 + init.c | 1 + muttlib.c | 1 + sendlib.c | 1 + status.c | 1 + 10 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index a9827492..f5825991 100644 --- a/.gitignore +++ b/.gitignore @@ -45,6 +45,7 @@ /smime_keys /txt2c /stamp-doc-rc +/version.h /doc/instdoc /doc/manual.txt /doc/manual.xml diff --git a/Makefile.am b/Makefile.am index c95c21a2..92edce22 100644 --- a/Makefile.am +++ b/Makefile.am @@ -22,7 +22,7 @@ if BUILD_HCACHE HCVERSION = hcversion.h endif -BUILT_SOURCES = keymap_defs.h patchlist.c reldate.h conststrings.c $(HCVERSION) +BUILT_SOURCES = keymap_defs.h patchlist.c reldate.h conststrings.c version.h $(HCVERSION) bin_PROGRAMS = mutt $(DOTLOCK_TARGET) $(PGPAUX_TARGET) mutt_SOURCES = \ @@ -140,6 +140,11 @@ keymap_alldefs.h: $(srcdir)/OPS $(srcdir)/OPS.SIDEBAR $(srcdir)/OPS.PGP $(srcdir $(srcdir)/OPS.MIX $(srcdir)/OPS.CRYPT $(srcdir)/OPS.SMIME \ > keymap_alldefs.h +version.h: FORCE + echo '#define MUTT_VERSION "'`sh "$(srcdir)/version.sh"`'"' > $@.tmp + cmp -s $@ $@.tmp && rm -f $@.tmp || mv $@.tmp $@ +FORCE: + reldate.h: $(srcdir)/mkreldate.sh $(srcdir)/ChangeLog echo 'const char *ReleaseDate = "'`(cd $(srcdir) && ./mkreldate.sh)`'";' > reldate.h diff --git a/commands.c b/commands.c index e95cfc9d..6db23055 100644 --- a/commands.c +++ b/commands.c @@ -21,6 +21,7 @@ # include "config.h" #endif +#include "version.h" #include "mutt.h" #include "mutt_curses.h" #include "mutt_menu.h" diff --git a/compose.c b/compose.c index 6574eca0..05ad4d47 100644 --- a/compose.c +++ b/compose.c @@ -21,6 +21,7 @@ # include "config.h" #endif +#include "version.h" #include "mutt.h" #include "mutt_curses.h" #include "mutt_idna.h" diff --git a/configure.ac b/configure.ac index b07fade0..bd8beb91 100644 --- a/configure.ac +++ b/configure.ac @@ -10,9 +10,6 @@ AC_CONFIG_HEADERS([config.h]) AC_SUBST([CONFIG_STATUS_DEPENDENCIES], ['$(top_srcdir)/VERSION']) -MUTT_VERSION=`env sh "$srcdir/version.sh"` -AC_DEFINE_UNQUOTED(MUTT_VERSION,"$MUTT_VERSION", [Full textual version string.]) - AC_USE_SYSTEM_EXTENSIONS ALL_LINGUAS="de eu ru it es uk fr pl nl cs id sk ko el zh_TW zh_CN pt_BR eo gl sv da lt tr ja hu et ca bg ga fi" diff --git a/dotlock.c b/dotlock.c index 5e3086f9..aa2c2b43 100644 --- a/dotlock.c +++ b/dotlock.c @@ -46,6 +46,7 @@ #include #endif +#include "version.h" #include "dotlock.h" #ifdef HAVE_GETOPT_H diff --git a/init.c b/init.c index 387fde15..a4d754c0 100644 --- a/init.c +++ b/init.c @@ -20,6 +20,7 @@ # include "config.h" #endif +#include "version.h" #include "mutt.h" #include "mapping.h" #include "mutt_curses.h" diff --git a/muttlib.c b/muttlib.c index ba17f771..bd4f7959 100644 --- a/muttlib.c +++ b/muttlib.c @@ -21,6 +21,7 @@ # include "config.h" #endif +#include "version.h" #include "mutt.h" #include "mutt_curses.h" #include "mime.h" diff --git a/sendlib.c b/sendlib.c index 984e0528..0bf0b194 100644 --- a/sendlib.c +++ b/sendlib.c @@ -22,6 +22,7 @@ # include "config.h" #endif +#include "version.h" #include "mutt.h" #include "mutt_curses.h" #include "rfc2047.h" diff --git a/status.c b/status.c index f7c8f1aa..cccf7eca 100644 --- a/status.c +++ b/status.c @@ -20,6 +20,7 @@ # include "config.h" #endif +#include "version.h" #include "mutt.h" #include "mutt_menu.h" #include "mutt_curses.h" -- 2.50.1