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.
This commit is contained in:
Martin Nordholts 2011-08-26 08:13:46 +02:00
parent b3622ad93c
commit c272a3a038
1 changed files with 7 additions and 7 deletions

View File

@ -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 \