From: Arun Persaud Date: Sun, 17 Feb 2013 22:13:30 +0000 (-0800) Subject: in debug mode also print the git-version if available during build X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=bc685fe8581cb1de0e78fce6d93ee9b2ae536b04;p=xboard.git in debug mode also print the git-version if available during build --- 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