aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Schink <swo-dev@marcschink.de>2016-12-06 15:18:42 +0100
committerMarc Schink <swo-dev@marcschink.de>2016-12-06 15:18:42 +0100
commitb8f5f5f4b1807c282d965f5b2545699570265b8c (patch)
tree23265668c079b1859dc118a52fdace273edda2cb
parent3dfd7e4976fccd1967ea06f82705a3dadf29a68e (diff)
Fix package version in out-of-tree builds
Do not determine the Git revision hash from the repository in the current working directory because, in some circumstances, the revision hash of a commit from a different repository is used. For example, this happens when 'configure' is called from within an other Git repository.
-rw-r--r--m4/libswo.m46
1 files changed, 4 insertions, 2 deletions
diff --git a/m4/libswo.m4 b/m4/libswo.m4
index a892843..12d5248 100644
--- a/m4/libswo.m4
+++ b/m4/libswo.m4
@@ -25,11 +25,13 @@ m4_define([_LIBSWO_SET_PACKAGE_VERSION], [
m4_assert([$# == 5])
# Get the short Git revision hash of the current commit.
- git_version=`git rev-parse --short HEAD 2> /dev/null`
+ git_version=`git --git-dir="$srcdir/.git" rev-parse \
+ --short HEAD 2> /dev/null`
# Try to get the release tag for the package version from the current
# commit.
- tag=`git describe --match "$2" --exact-match 2> /dev/null`
+ tag=`git --git-dir="$srcdir/.git" describe --match "$2" \
+ --exact-match 2> /dev/null`
version=$2