From: Sven Verdoolaege Date: Mon, 23 Dec 2013 09:12:10 +0000 (+0100) Subject: AX_DETECT_GIT_HEAD: detect git version with newer versions of git X-Git-Tag: isl-0.13~100 X-Git-Url: https://repo.or.cz/w/isl.git/commitdiff_plain/26658ec1992310b8ccf3290a9a474f42f3ee22d9 AX_DETECT_GIT_HEAD: detect git version with newer versions of git In particular, if isl is used as a submodule, then in newer versions of git, .git may be a file containing the path of the real directory that has the repository. Signed-off-by: Sven Verdoolaege --- diff --git a/m4/ax_detect_git_head.m4 b/m4/ax_detect_git_head.m4 index d5859835..c3326277 100644 --- a/m4/ax_detect_git_head.m4 +++ b/m4/ax_detect_git_head.m4 @@ -2,7 +2,12 @@ AC_DEFUN([AX_DETECT_GIT_HEAD], [ AC_SUBST(GIT_HEAD_ID) AC_SUBST(GIT_HEAD) AC_SUBST(GIT_HEAD_VERSION) - if test -f $srcdir/.git/HEAD; then + if test -f $srcdir/.git; then + gitdir=`GIT_DIR=$srcdir/.git git rev-parse --git-dir` + GIT_HEAD="$gitdir/index" + GIT_REPO="$gitdir" + GIT_HEAD_ID=`GIT_DIR=$GIT_REPO git describe` + elif test -f $srcdir/.git/HEAD; then GIT_HEAD="$srcdir/.git/index" GIT_REPO="$srcdir/.git" GIT_HEAD_ID=`GIT_DIR=$GIT_REPO git describe`