From bc685fe8581cb1de0e78fce6d93ee9b2ae536b04 Mon Sep 17 00:00:00 2001 From: Arun Persaud Date: Sun, 17 Feb 2013 14:13:30 -0800 Subject: [PATCH] in debug mode also print the git-version if available during build --- Makefile.am | 3 ++- backend.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index 6ed6446..61aa1d7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -67,8 +67,9 @@ EXTRA_DIST = pixmaps themes png sounds winboard \ DISTCLEANFILES = stamp-h +GITVERSION=$(shell sh -c 'git describe --dirty --always 2>/dev/null') AM_CPPFLAGS=-DINFODIR='"$(infodir)"' @X_CFLAGS@ @CAIRO_CFLAGS@ @FRONTEND_CFLAGS@ -DSYSCONFDIR='"$(sysconfdir)"' \ - -DLOCALEDIR='"$(localedir)"' -DSVGDIR='"$(svgdir)"' $(headers) + -DLOCALEDIR='"$(localedir)"' -DSVGDIR='"$(svgdir)"' -D__GIT_VERSION='"$(GITVERSION)"' $(headers) ACLOCAL_AMFLAGS = -I m4 diff --git a/backend.c b/backend.c index 42d9d19..8f974bf 100644 --- a/backend.c +++ b/backend.c @@ -1344,7 +1344,7 @@ void InitBackEnd2 () { if (appData.debugMode) { - fprintf(debugFP, "%s\n", programVersion); + fprintf(debugFP, "Version: %s (%s)\n", programVersion, __GIT_VERSION); } ASSIGN(currentDebugFile, appData.nameOfDebugFile); // [HGM] debug split: remember initial name in use -- 1.7.0.4