@@ -12,6 +12,7 @@
.deps/
.dirstamp
.libs/
+.scmversion
CUnit-Memory-Dump.xml
ID
Makefile
@@ -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}
@@ -1 +1 @@
-EXTRA_DIST = git_hash.sh odp_version.sh
+EXTRA_DIST = git_hash.sh odp_version.sh ../.scmversion
@@ -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
Signed-off-by: Anders Roxell <anders.roxell@linaro.org> --- .gitignore | 1 + platform/Makefile.inc | 2 +- scripts/Makefile.am | 2 +- scripts/git_hash.sh | 18 ++++++++++++++---- 4 files changed, 17 insertions(+), 6 deletions(-)