Skip to content

Commit 75b82e1

Browse files
authored
Merge pull request #992 from vineetgarc/gcc-v-report-git-ver
gcc: add source SHA1 which shows up in -v
2 parents f640044 + c730133 commit 75b82e1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Makefile.in

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,12 @@ else
243243
GLIBC_SRC_GIT :=
244244
endif
245245

246+
ifneq ("$(wildcard $(GCC_SRCDIR)/.git)","")
247+
GCCPKGVER := g$(shell git -C $(GCC_SRCDIR) describe --always --dirty --exclude '*')
248+
else
249+
GCCPKGVER :=
250+
endif
251+
246252
$(srcdir)/%/.git:
247253
cd $(srcdir) && \
248254
flock `git rev-parse --git-dir`/config git submodule init $(dir $@) && \
@@ -396,6 +402,7 @@ stamps/build-gcc-linux-stage2: $(GCC_SRCDIR) $(GCC_SRC_GIT) $(addprefix stamps/b
396402
$(CONFIGURE_HOST) \
397403
--prefix=$(INSTALL_DIR) \
398404
--with-sysroot=$(SYSROOT) \
405+
--with-pkgversion="$(GCCPKGVER)" \
399406
@with_system_zlib@ \
400407
--enable-shared \
401408
--enable-tls \
@@ -621,6 +628,7 @@ stamps/build-gcc-newlib-stage2: $(GCC_SRCDIR) $(GCC_SRC_GIT) stamps/build-newlib
621628
--disable-shared \
622629
--disable-threads \
623630
--enable-languages=c,c++ \
631+
--with-pkgversion="$(GCCPKGVER)" \
624632
@with_system_zlib@ \
625633
--enable-tls \
626634
--with-newlib \

0 commit comments

Comments
 (0)