summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac7
-rw-r--r--lib/Makefile.sources5
2 files changed, 12 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 4208f000..a69a3815 100644
--- a/configure.ac
+++ b/configure.ac
@@ -212,6 +212,13 @@ if test "x$enable_debug" = xyes; then
AC_SUBST([DEBUG_CFLAGS])
fi
+# prevent relinking the world on every commit for developers
+AC_ARG_ENABLE(git-hash,
+ AS_HELP_STRING([--disable-git-hash],
+ [Do not use git hash in version]),
+ [git_hash=$enableval], [git_hash=yes])
+AM_CONDITIONAL(SKIP_GIT_HASH, [test "x$git_hash" = xno])
+
# -----------------------------------------------------------------------------
# To build multithread code, gcc uses -pthread, Solaris Studio cc uses -mt
diff --git a/lib/Makefile.sources b/lib/Makefile.sources
index f8a1b928..a19ffd92 100644
--- a/lib/Makefile.sources
+++ b/lib/Makefile.sources
@@ -60,6 +60,10 @@ libintel_tools_la_SOURCES = \
.PHONY: version.h.tmp
+if SKIP_GIT_HASH
+$(IGT_LIB_PATH)/version.h.tmp:
+ @echo '#define IGT_GIT_SHA1 "git"' >> $@
+else
$(IGT_LIB_PATH)/version.h.tmp:
@touch $@
@if test -d $(GPU_TOOLS_PATH)/.git; then \
@@ -73,6 +77,7 @@ $(IGT_LIB_PATH)/version.h.tmp:
else \
echo '#define IGT_GIT_SHA1 "NOT-GIT"' ; \
fi >> $@
+endif # SKIP_GIT_HASH
$(IGT_LIB_PATH)/version.h: $(IGT_LIB_PATH)/version.h.tmp