[gimp] app: Repair git-version.h generation



commit c272a3a03802713e1b72b6df164a9d33bd0fce14
Author: Martin Nordholts <martinn src gnome org>
Date:   Fri Aug 26 08:13:46 2011 +0200

    app: Repair git-version.h generation
    
    We must only generate a git-version.h if we have a .git dir or if we
    have no git-version.h at all. Otherwise building from a tarball will
    destroy the distributed git-version.h.
    
    Also remove #define GIMP_GIT_LAST_COMMIT_YEAR, we don't use it.

 app/Makefile.am |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/app/Makefile.am b/app/Makefile.am
index 6a6648d..2cbdef2 100644
--- a/app/Makefile.am
+++ b/app/Makefile.am
@@ -279,13 +279,13 @@ git-version.h: update-git-version-header
 	  git_last_commit_timestamp=-1; \
 	  git_last_commit_year="`date --utc '+%Y'`"; \
 	fi; \
-	echo "#ifndef __GIT_VERSION_H__" > "$  tmp"; \
-	echo "#define __GIT_VERSION_H__" >> "$  tmp"; \
-	echo "#include <time.h>" >> "$  tmp"; \
-	echo "#define GIMP_GIT_VERSION \"$$git_version\"" >> "$  tmp"; \
-	echo "#define GIMP_GIT_LAST_COMMIT_TIMESTAMP ((time_t)$$git_last_commit_timestamp)" >> "$  tmp"; \
-	echo "#define GIMP_GIT_LAST_COMMIT_YEAR \"$$git_last_commit_year\"" >> "$  tmp"; \
-	echo "#endif /* __GIT_VERSION_H__ */" >> "$  tmp"
+	if test -n "$$git_version"; then \
+	  echo "#ifndef __GIT_VERSION_H__" > "$  tmp"; \
+	  echo "#define __GIT_VERSION_H__" >> "$  tmp"; \
+	  echo "#define GIMP_GIT_VERSION \"$$git_version\"" >> "$  tmp"; \
+	  echo "#define GIMP_GIT_LAST_COMMIT_YEAR \"$$git_last_commit_year\"" >> "$  tmp"; \
+	  echo "#endif /* __GIT_VERSION_H__ */" >> "$  tmp"; \
+	fi
 	@if ( test -f "$  tmp" && test -f "$@" && cmp "$  tmp" "$@" > /dev/null ); then \
 	  rm -f "$  tmp"; \
 	elif test -f "$  tmp"; then \



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]