From 8951a8ebe0435afee850093f9f69e6a2aa63bb6f Mon Sep 17 00:00:00 2001 From: Guillaume BIENKOWSKI Date: Wed, 23 Jul 2014 12:53:46 +0200 Subject: [PATCH] Fix (hopefully) the git check --- coreapi/Makefile.am | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/coreapi/Makefile.am b/coreapi/Makefile.am index ce7dc56a0..03d42f08d 100644 --- a/coreapi/Makefile.am +++ b/coreapi/Makefile.am @@ -5,6 +5,13 @@ GITDESCRIBE=`cd $(top_srcdir) && git describe --always` GIT_TAG=`cd $(top_srcdir) && git describe --abbrev=0` GITREVISION=`cd $(top_srcdir) && git rev-parse HEAD` +## This command is used to check if the sources are cloned in a git repo. +## We can't only depend on the presence of the .git/ directory anymore, +## because of gits submodule handling. +## We now simply issue a git status and if there's an error, the $(GITSTATUS) +## variable won't contain "GITOK" +GITSTATUS=`cd $(top_srcdir) && git status > /dev/null && echo GITOK` + ECHO=/bin/echo SUBDIRS=. help @@ -161,7 +168,7 @@ AM_CXXFLAGS=$(AM_CFLAGS) #the PACKAGE_VERSION given in configure.ac make_gitversion_h: - if test -d $(top_srcdir)/.git ; then \ + if test "$(GITSTATUS)" == "GITOK" ; then \ if test "$(GITDESCRIBE)" != "" ; then \ if test "$(GIT_TAG)" != "$(PACKAGE_VERSION)" ; then \ echo "*** PACKAGE_VERSION and git tag differ. Please put them identical."; \