summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Schink <jaylink-dev@marcschink.de>2016-11-16 15:03:07 +0100
committerMarc Schink <jaylink-dev@marcschink.de>2016-11-17 22:15:25 +0100
commit62fda5318f16c8e1c5514ddb7ae93238706fbf3c (patch)
treee513cae1495cbf053f8db72e89995023315c2783
parentc2ad600925292806c1bb3f4469d157ab5e6ccaee (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. Signed-off-by: Marc Schink <jaylink-dev@marcschink.de>
-rw-r--r--m4/jaylink.m46
1 files changed, 4 insertions, 2 deletions
diff --git a/m4/jaylink.m4 b/m4/jaylink.m4
index 7395421..749568d 100644
--- a/m4/jaylink.m4
+++ b/m4/jaylink.m4
@@ -25,11 +25,13 @@ m4_define([_JAYLINK_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