public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/c++-modules] Alter revision setting
@ 2020-11-06 13:56 Nathan Sidwell
0 siblings, 0 replies; only message in thread
From: Nathan Sidwell @ 2020-11-06 13:56 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:130faab5850ba3e6460da83c86cc39034213ea4b
commit 130faab5850ba3e6460da83c86cc39034213ea4b
Author: Nathan Sidwell <nathan@acm.org>
Date: Fri Nov 6 05:55:21 2020 -0800
Alter revision setting
gcc/cp/
* Make-lang.in: Drop git hash collection.
gcc/
* REVISION: New.
Diff:
---
ChangeLog.modules | 5 +++++
gcc/REVISION | 1 +
gcc/cp/Make-lang.in | 30 ++++++------------------------
3 files changed, 12 insertions(+), 24 deletions(-)
diff --git a/ChangeLog.modules b/ChangeLog.modules
index 05ccdc4a969..e5ce5673d64 100644
--- a/ChangeLog.modules
+++ b/ChangeLog.modules
@@ -1,5 +1,10 @@
2020-11-06 Nathan Sidwell <nathan@acm.org>
+ gcc/cp/
+ * Make-lang.in: Drop git hash collection.
+ gcc/
+ * REVISION: New.
+
gcc/cp/
* parser.c (cp_parser_diagnose_invalid_type_name): Revert local
changes.
diff --git a/gcc/REVISION b/gcc/REVISION
new file mode 100644
index 00000000000..afc6e92482f
--- /dev/null
+++ b/gcc/REVISION
@@ -0,0 +1 @@
+[c++-modules]
diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in
index b9aa4025bd4..fef73ce4f8d 100644
--- a/gcc/cp/Make-lang.in
+++ b/gcc/cp/Make-lang.in
@@ -65,35 +65,17 @@ cp/module.o : $(srcdir)/cp
MODULE_VERSION := $(shell date -r $(srcdir)/cp '+%y%m%d-%H%M' 2>/dev/null\
|| date '+%y%m%d-0000' 2>/dev/null || echo 0)
-# Try git commit and dirty info
-MODULE_REVISION := $(shell git -C $(srcdir)/.. rev-parse --short HEAD \
- 2>/dev/null)
-ifneq ($(MODULE_REVISION),)
-# It is git, figure branch & dirty info
-# Subterfuge for gnumake's changing #-quote requirements
-GIT_INFO := \#
-GIT_INFO := -ne '1{s/$(GIT_INFO)$(GIT_INFO) \(.*\)*\.\.\..*/\1/;p;}'
-GIT_INFO := $(shell git -C $(srcdir)/.. status --porcelain --branch 2>/dev/null \
- | sed $(GIT_INFO) -e '2,$${s/[^?].*/M/p;q;}')
-MODULE_REVISION := $(word 1,$(GIT_INFO)) $(MODULE_REVISION)$(word 2,$(GIT_INFO))
-endif
-ifeq ($(MODULE_REVISION),)
-# Git does not have keyword expansion, use the date of the most recent entry.
-MODULE_REVISION := $(shell head -1 $(srcdir)/../ChangeLog.modules \
- 2>/dev/null | sed -ne 's/^\([0-9]\+\)-\([0-9]\+\)-\([0-9]\+\) .*/\1\2\3/p')
-endif
-ifeq ($(MODULE_REVISION),)
-MODULE_REVISION := unknown
-endif
version.o : $(srcdir)/cp
# Set REVISION string
ifeq ($(REVISION_c),)
REVISION_c := []
-endif
+REVISION_s := '"[modules revision 20$(MODULE_VERSION)]"'
+else
+ifeq ($(words $(REVISION_c)),1)
# Wedge inside [...], if that's what it already looks like
-REVISION_s := '" $(REVISION_c:]=)$(if \
- $(REVISION_c:[]=),:)$(MODULE_REVISION):20$(MODULE_VERSION)$(if \
- $(filter %],$(REVISION_c)),])"'
+REVISION_s := '" $(REVISION_c:]=) revision 20$(MODULE_VERSION)]"'
+endif
+endif
CFLAGS-cp/module.o += -DMODULE_VERSION='($(subst -,,$(MODULE_VERSION))U)'
endif
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-11-06 13:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-06 13:56 [gcc/devel/c++-modules] Alter revision setting Nathan Sidwell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).