diff options
author | Anders Roxell <anders.roxell@linaro.org> | 2015-08-14 15:25:05 +0200 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2015-08-25 16:57:10 +0300 |
commit | 06537738ea438c3e339fc269dedb4ed6c5e48f07 (patch) | |
tree | 14edc506fbc96606622de40046d8efc8cf3e7049 | |
parent | ea7c466df481ff8071baffc58cb5dba0f7bb8ad2 (diff) |
scripts/git_hash: fix build from tar source
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Reviewed-and-tested-by: Mike Holmes <mike.holmes@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | platform/Makefile.inc | 2 | ||||
-rw-r--r-- | scripts/Makefile.am | 2 | ||||
-rwxr-xr-x | scripts/git_hash.sh | 18 |
4 files changed, 17 insertions, 6 deletions
@@ -12,6 +12,7 @@ .deps/ .dirstamp .libs/ +.scmversion CUnit-Memory-Dump.xml ID Makefile diff --git a/platform/Makefile.inc b/platform/Makefile.inc index f64e37c..8e8e97b 100644 --- a/platform/Makefile.inc +++ b/platform/Makefile.inc @@ -12,6 +12,6 @@ lib_LTLIBRARIES = $(LIB)/libodp.la AM_LDFLAGS += -version-number '$(ODP_LIBSO_VERSION)' -GIT_DESC = `$(top_srcdir)/scripts/git_hash.sh` +GIT_DESC = `$(top_srcdir)/scripts/git_hash.sh $(top_srcdir)` AM_CFLAGS += "-DGIT_HASH=$(GIT_DESC)" AM_CFLAGS += -DPLATFORM=${with_platform} diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 617eadc..431e537 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -1 +1 @@ -EXTRA_DIST = git_hash.sh odp_version.sh +EXTRA_DIST = git_hash.sh odp_version.sh ../.scmversion diff --git a/scripts/git_hash.sh b/scripts/git_hash.sh index c9f1faf..48ae24e 100755 --- a/scripts/git_hash.sh +++ b/scripts/git_hash.sh @@ -1,9 +1,19 @@ #!/bin/bash +if [ -z ${1} ]; then + echo "should be called with a path" + exit +fi +ROOTDIR=${1} + repo=https://git.linaro.org/lng/odp.git -hash=$(git describe | tr -d "\n") -if git diff-index --name-only HEAD &>/dev/null ; then - dirty=-dirty +if [ -d ${ROOTDIR}/.git ]; then + hash=$(git describe | tr -d "\n") + if git diff-index --name-only HEAD &>/dev/null ; then + dirty=-dirty + fi + + echo -n "'${repo}' (${hash}${dirty})">${ROOTDIR}/.scmversion fi -echo -n "'${repo}' (${hash}${dirty})" +cat ${ROOTDIR}/.scmversion |