From 3c235224dbdcb5e62c3bb9a46c82e9ed3bccadba Mon Sep 17 00:00:00 2001 From: "Ben \"root\" Anderson" Date: Tue, 27 Jan 2015 20:34:31 -0600 Subject: [PATCH 1/3] Update version in configure.ac. It's been forever. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index e3d9f78c06..2d9ab6e47d 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_PREREQ(2.59) -AC_INIT(StepMania 5, beta 0, [https://github.com/stepmania/stepmania], StepMania, [http://stepmania.com]) +AC_INIT(StepMania, 5.0, [https://github.com/stepmania/stepmania], StepMania, [http://stepmania.com]) AC_CONFIG_SRCDIR([src/StepMania.cpp]) AC_CONFIG_AUX_DIR(autoconf) AC_CANONICAL_TARGET From 05e620a854faf58c64d5c5753a550df3eb13c8cf Mon Sep 17 00:00:00 2001 From: "Ben \"root\" Anderson" Date: Tue, 27 Jan 2015 21:17:39 -0600 Subject: [PATCH 2/3] Really actually regenerate ver.cpp every build --- src/Makefile.am | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 303fa283e6..8ba6f8105c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -30,10 +30,8 @@ AM_CXXFLAGS += $(GL_CFLAGS) .PHONY: increment_version -all: increment_version - increment_version: - if test -e ver.cpp; then \ + if test -e ver.h; then \ build=`sed -rs 's/.*version_num = ([[:digit:]]+);/\1/;q' ver.cpp`; \ build=`expr $$build + 1`; \ else \ @@ -43,8 +41,7 @@ increment_version: echo "extern const char *const version_time = \"`date +"%X %Z (UTC%:z)"`\";" >> ver.cpp; echo "extern const char *const version_date = \"`date +"%Y%m%d"`\";" >> ver.cpp; -ver.cpp: - $(MAKE) increment_version +ver.cpp: increment_version PNG = \ ../extern/libpng/include/png.c ../extern/libpng/include/.png.h \ From fb6e75d3088a8ad68fc663421cbe4f99a904cdb3 Mon Sep 17 00:00:00 2001 From: "Ben \"root\" Anderson" Date: Tue, 27 Jan 2015 21:53:31 -0600 Subject: [PATCH 3/3] Automatically generate PRODUCT_VER_BARE based on the current git revision --- .gitignore | 1 + configure.ac | 1 + src/Makefile.am | 14 ++++++++++++-- src/ProductInfo.h | 10 ++++++++-- 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 1dee79e207..8dd550c2a1 100644 --- a/.gitignore +++ b/.gitignore @@ -77,6 +77,7 @@ GtkModule.so # StepMania Specific *.smzip ver.cpp +gitversion.h Cache/ Save/ Logs/ diff --git a/configure.ac b/configure.ac index 2d9ab6e47d..e875775951 100644 --- a/configure.ac +++ b/configure.ac @@ -349,6 +349,7 @@ AM_CONDITIONAL(HAVE_PTHREAD, test "$have_pthread" = "yes") # Always: AC_DEFINE(_GNU_SOURCE, 1, [Use GNU extensions]) AC_DEFINE(__STDC_FORMAT_MACROS, 1, [Use PRId64 and similar]) +AC_DEFINE(USE_GITVERSION, 1, [We are generating gitversion.h]) AM_CONDITIONAL(HAVE_ALSA, test x$alsa != xfalse ) AM_CONDITIONAL(HAVE_GTK, test "$enable_gtk2" != "no" ) diff --git a/src/Makefile.am b/src/Makefile.am index 8ba6f8105c..891351179a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -28,7 +28,7 @@ AM_CXXFLAGS += -finline-limit=300 AM_CXXFLAGS += $(GL_CFLAGS) -.PHONY: increment_version +.PHONY: increment_version gitversion increment_version: if test -e ver.h; then \ @@ -43,6 +43,16 @@ increment_version: ver.cpp: increment_version +gitversion: + rm -f gitversion.h + touch gitversion.h + if git rev-parse --short HEAD; then \ + echo "#define PRODUCT_VER_BARE 5.0-git-`git rev-parse --short HEAD`" > gitversion.h; \ + fi + +gitversion.h: gitversion +ProductInfo.h: gitversion.h + PNG = \ ../extern/libpng/include/png.c ../extern/libpng/include/.png.h \ ../extern/libpng/include/pngconf.h ../extern/libpng/include/pngdebug.h \ @@ -734,7 +744,7 @@ main_LDADD = \ $(GL_LIBS) \ libtomcrypt.a libtommath.a -nodist_stepmania_SOURCES = ver.cpp +nodist_stepmania_SOURCES = ver.cpp gitversion.h stepmania_CPPFLAGS = $(main_CPPFLAGS) stepmania_SOURCES = $(main_SOURCES) diff --git a/src/ProductInfo.h b/src/ProductInfo.h index 38ae2fec65..a09e70ccfc 100644 --- a/src/ProductInfo.h +++ b/src/ProductInfo.h @@ -3,6 +3,12 @@ #ifndef PRODUCT_INFO_H #define PRODUCT_INFO_H +// XXX: VC doesn't generate this yet. Hack around it for now +#include "config.h" +#ifdef USE_GITVERSION +#include "gitversion.h" +#endif + /** * @brief A friendly string to refer to the product in crash dialogs, etc. * @@ -16,7 +22,7 @@ * As an example, use "StepMania4" here, not "StepMania". * It would cause a conflict with older versions such as StepMania 3.X. */ -#define PRODUCT_ID_BARE StepMania 5 +#define PRODUCT_ID_BARE StepMania 5.0 /** * @brief Version info displayed to the user. @@ -30,7 +36,7 @@ * */ #ifndef PRODUCT_VER_BARE -#define PRODUCT_VER_BARE v5.0 beta 4a +#define PRODUCT_VER_BARE 5.0-UNKNOWN #endif /**