aboutsummaryrefslogtreecommitdiff
path: root/build-aux
diff options
context:
space:
mode:
Diffstat (limited to 'build-aux')
-rwxr-xr-xbuild-aux/git-version-gen15
1 files changed, 15 insertions, 0 deletions
diff --git a/build-aux/git-version-gen b/build-aux/git-version-gen
new file mode 100755
index 0000000..0f3978d
--- /dev/null
+++ b/build-aux/git-version-gen
@@ -0,0 +1,15 @@
+#!/bin/sh
+# Display the SHA1 of the commit in which configure.ac was last modified.
+# If it's not checked in yet, use the SHA1 of HEAD plus -dirty.
+
+if [ ! -d .git ] ; then
+ # if no .git directory, assume they're not using Git
+ cat "$(dirname $0)/../.tarball-version"
+elif git diff --quiet HEAD -- configure.ac ; then
+ # configure.ac is not modified
+ printf '%s-git' `git describe --always HEAD`
+else # configure.ac is modified
+ printf '%s-dirty' `git describe --always HEAD`
+fi
+
+exit 0