From b825874d2e76b97e832df84b0ae3c485637d01e5 Mon Sep 17 00:00:00 2001
From: Sami Kerola <kerolasa@iki.fi>
Date: Mon, 31 Dec 2012 16:36:21 +0000
Subject: do not try to reach $(top_srcdir)/.git directory contents when
 building a release tar ball

---
 src/Makefile.am | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index 382d41a..235193d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -77,7 +77,11 @@ defaults.cc: force
 		echo '}'; \
 		echo ''; \
 		echo 'const char* gitrevision() {'; \
-		echo '  return "'`cat $$GITDIR/$$(cat $$GITDIR/HEAD | cut -f 2 -d ' ')`'";';\
+		if test -r $$GITDIR/HEAD; then \
+			echo '  return "'`cat $$GITDIR/$$(cat $$GITDIR/HEAD | cut -f 2 -d ' ')`'";'; \
+		else \
+			echo '  return "this_is_tar_ball_build";'; \
+		fi; \
 		echo '}' ) > defaults_tmp.cc
 	@if ! cmp defaults_tmp.cc defaults.cc ; then cp defaults_tmp.cc defaults.cc; fi
 	@rm defaults_tmp.cc
-- 
cgit v0.11.2