aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)