diff mbox

[committed,gcc-5-branch] Set DEV-PHASE to prerelease

Message ID 20150504100546.GC1751@tucnak.redhat.com
State New
Headers show

Commit Message

Jakub Jelinek May 4, 2015, 10:05 a.m. UTC
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.



	Jakub

Comments

Richard Biener May 4, 2015, 10:07 a.m. UTC | #1
On Mon, 4 May 2015, Jakub Jelinek wrote:

> 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?

Looks good to me.

Thanks,
Richard.

> 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
> 
>
diff mbox

Patch

--- 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