public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Richard Biener <rguenther@suse.de>
Cc: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>,
	"H.J. Lu" <hjl.tools@gmail.com>,
	       gcc-patches@gcc.gnu.org
Subject: Re: [committed, gcc-5-branch] Set DEV-PHASE to prerelease
Date: Mon, 04 May 2015 10:05:00 -0000	[thread overview]
Message-ID: <20150504100546.GC1751@tucnak.redhat.com> (raw)
In-Reply-To: <alpine.LSU.2.11.1505041130590.20496@zhemvz.fhfr.qr>

On Mon, May 04, 2015 at 11:31:11AM +0200, Richard Biener wrote:
> On Mon, 4 May 2015, Jakub Jelinek wrote:
> 
> > On Mon, May 04, 2015 at 11:13:51AM +0200, Rainer Orth wrote:
> > > Jakub Jelinek <jakub@redhat.com> writes:
> > > 
> > > > On Thu, Apr 23, 2015 at 04:31:52PM -0700, H.J. Lu wrote:
> > > >> Hi,
> > > >> 
> > > >> I checked this patch into gcc-5-branch.
> > > >
> > > > That's wrong according to https://gcc.gnu.org/develop.html#num_scheme
> > > 
> > > HJ has a point, though: with DEV-PHASE remaining empty, all post-5.1.0
> > > versions of gcc identify as 5.1.1, with no way of telling them apart,
> > > like datestamp and revison.
> > 
> > That suggests we should change
> > DATESTAMP_s := "\"$(if $(DEVPHASE_c), $(DATESTAMP_c))\""
> > so that it would expand to DATESTAMP_c also if DEVPHASE_c is empty,
> > but BASEVER_c does not end with .0
> 
> Yes.

Here is a patch to do that, ok for trunk/5?

2015-05-04  Jakub Jelinek  <jakub@redhat.com>

	* Makefile.in (PATCHLEVEL_c): New variable.
	(DATESTAMP_s, REVISION_s): If PATCHLEVEL_c is not 0,
	expand the same way as if DEVPHASE_c was non-empty.

--- gcc/Makefile.in.jj	2015-04-12 21:50:12.000000000 +0200
+++ gcc/Makefile.in	2015-05-04 12:03:03.394797230 +0200
@@ -828,14 +828,20 @@ endif
 
 version     := $(BASEVER_c)
 
+PATCHLEVEL_c := \
+  $(shell echo $(BASEVER_c) | sed -e 's/^[0-9]*\.[0-9]*\.\([0-9]*\)$$/\1/')
+
+
 # For use in version.c - double quoted strings, with appropriate
 # surrounding punctuation and spaces, and with the datestamp and
 # development phase collapsed to the empty string in release mode
-# (i.e. if DEVPHASE_c is empty).  The space immediately after the
-# comma in the $(if ...) constructs is significant - do not remove it.
+# (i.e. if DEVPHASE_c is empty and PATCHLEVEL_c is 0).  The space
+# immediately after the comma in the $(if ...) constructs is
+# significant - do not remove it.
 BASEVER_s   := "\"$(BASEVER_c)\""
 DEVPHASE_s  := "\"$(if $(DEVPHASE_c), ($(DEVPHASE_c)))\""
-DATESTAMP_s := "\"$(if $(DEVPHASE_c), $(DATESTAMP_c))\""
+DATESTAMP_s := \
+  "\"$(if $(DEVPHASE_c)$(filter-out 0,$(PATCHLEVEL_c)), $(DATESTAMP_c))\""
 PKGVERSION_s:= "\"@PKGVERSION@\""
 BUGURL_s    := "\"@REPORT_BUGS_TO@\""
 
@@ -843,7 +849,8 @@ PKGVERSION  := @PKGVERSION@
 BUGURL_TEXI := @REPORT_BUGS_TEXI@
 
 ifdef REVISION_c
-REVISION_s  := "\"$(if $(DEVPHASE_c), $(REVISION_c))\""
+REVISION_s  := \
+  "\"$(if $(DEVPHASE_c)$(filter-out 0,$(PATCHLEVEL_c)), $(REVISION_c))\""
 else
 REVISION_s  := "\"\""
 endif


	Jakub

  reply	other threads:[~2015-05-04 10:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-23 23:31 H.J. Lu
2015-04-24  6:00 ` Jakub Jelinek
2015-04-24  7:52   ` Richard Biener
2015-05-04  9:13   ` Rainer Orth
2015-05-04  9:21     ` Jakub Jelinek
2015-05-04  9:31       ` Richard Biener
2015-05-04 10:05         ` Jakub Jelinek [this message]
2015-05-04 10:07           ` Richard Biener

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150504100546.GC1751@tucnak.redhat.com \
    --to=jakub@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hjl.tools@gmail.com \
    --cc=rguenther@suse.de \
    --cc=ro@CeBiTec.Uni-Bielefeld.DE \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).