summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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"/' \