in debug mode also print the git-version if available during build
authorArun Persaud <arun@nubati.net>
Sun, 17 Feb 2013 22:13:30 +0000 (14:13 -0800)
committerArun Persaud <arun@nubati.net>
Mon, 18 Feb 2013 20:46:24 +0000 (12:46 -0800)
Makefile.am
backend.c

index 6ed6446..61aa1d7 100644 (file)
@@ -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
 
index 42d9d19..8f974bf 100644 (file)
--- 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