summaryrefslogtreecommitdiffstats
path: root/src/mesa/Makefile.am
diff options
context:
space:
mode:
authorChad Versace <[email protected]>2015-07-09 18:46:21 -0700
committerChad Versace <[email protected]>2015-07-10 11:22:47 -0700
commit75784243df1f5bb0652fb243b37d69f36d493a86 (patch)
tree494b6352ca18b3d15a4b6dfdf9973c4a247b8ba1 /src/mesa/Makefile.am
parent15d3524ad24a698095cc542cf9a527c8a8615f78 (diff)
mesa: Fix generation of git_sha1.h.tmp for gitlinks
Don't assume that $(top_srcdir)/.git is a directory. It may be a gitlink file [1] if $(top_srcdir) is a submodule checkout or a linked worktree [2]. [1] A "gitlink" is a text file that specifies the real location of the gitdir. [2] Linked worktrees are a new feature in Git 2.5. Cc: "10.6, 10.5" <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]>
Diffstat (limited to 'src/mesa/Makefile.am')
-rw-r--r--src/mesa/Makefile.am5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mesa/Makefile.am b/src/mesa/Makefile.am
index c86ded979b9..eb4a3da3c84 100644
--- a/src/mesa/Makefile.am
+++ b/src/mesa/Makefile.am
@@ -38,8 +38,11 @@ gl_HEADERS = $(top_srcdir)/include/GL/*.h
.PHONY: main/git_sha1.h.tmp
main/git_sha1.h.tmp:
+ @# Don't assume that $(top_srcdir)/.git is a directory. It may be
+ @# a gitlink file if $(top_srcdir) is a submodule checkout or a linked
+ @# worktree.
@touch main/git_sha1.h.tmp
- @if test -d $(top_srcdir)/.git; then \
+ @if test -e $(top_srcdir)/.git; then \
if which git > /dev/null; then \
git --git-dir=$(top_srcdir)/.git log -n 1 --oneline | \
sed 's/^\([^ ]*\) .*/#define MESA_GIT_SHA1 "git-\1"/' \