aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHan Shen <shenhan@google.com>2016-01-07 09:57:28 -0800
committerHan Shen <shenhan@google.com>2016-01-07 10:07:34 -0800
commitf280657461aee54b6d2807881d8a77832f4e794c (patch)
treeb6916284ef2913e2c43a6fbe650576efc31f1ada
parentfad95906dc869be82834cf0678a5b99d2fe19095 (diff)
downloadbuild-f280657461aee54b6d2807881d8a77832f4e794c.tar.gz
So the output for 'ld -v' is something like - GNU ld (binutils-2.25-3febaa7) 2.25.51.20141117 Tested by: ./build.py --toolchain arm-linux-androideabi --host linux Change-Id: I4687fb5696bf3aa7a08a94149090055a76ec2294
-rw-r--r--Makefile.in7
1 files changed, 6 insertions, 1 deletions
diff --git a/Makefile.in b/Makefile.in
index ddce993..21f33d7 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -183,6 +183,10 @@ find-package-srcdir = $(shell \
echo 'error cannot find $(strip $1)' ; \
fi)
+# Find short git hash for a given git repo.
+find-git-hash = $(shell \
+ git -C $1 log -1 --pretty=format:%h 2>/dev/null || echo unknown-git-ver)
+
# Set effective <build>, <host> and <target>.
ifneq ($(build_alias),)
@@ -305,7 +309,8 @@ config-target-binutils: stmp-config-target-binutils
# We do not want to enable shared libraries in binutils
BINUTILS_CONFIG_ARGS=--prefix=$(prefix) \
--target=${cur_target} --host=${cur_host} --build=${cur_build} \
- $(baseargs) --disable-shared --disable-nls
+ $(baseargs) --disable-shared --disable-nls \
+ --with-pkgversion=$(BINUTILS_VERSION)-$(call find-git-hash, $(srcdir)/../binutils)
ifeq ($(ENABLE_GRAPHITE),yes)
BINUTILS_CONFIG_ARGS+= --with-cloog=${CLOOG_DIR} --with-isl=${ISL_DIR} --with-gmp=${GMP_DIR} \
--disable-ppl-version-check --disable-cloog-version-check --disable-isl-version-check $(CLOOG_BACKEND)