public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* First suggestion to lift version handling
@ 2002-03-05  3:14 Christian Jönsson
  2002-03-05  4:46 ` Christian Jönsson
  0 siblings, 1 reply; 7+ messages in thread
From: Christian Jönsson @ 2002-03-05  3:14 UTC (permalink / raw)
  To: Binutils

Here's my first suggestion to lift version handling in the binutils
sources, to differ the main branch (experimental) from (any)
prerelease branch. A regeneration of bfd/configure is thus needed.

Now, let's figure out how the bfd_version_string can be used in the
test suite so that test results from different branches, and releases,
can be seen from log files.

Cheers,

/ChJ

For the 2.12 prerelease branch:

2002-03-05  Christian Jönsson  <c.christian.joensson@telia.com>

	* configure.in (bfd_version_string): Add (prerelease) to prerelase
	branches.


*** bfd/configure.in.orig	Tue Mar  5 07:44:24 2002
--- bfd/configure.in	Tue Mar  5 11:33:42 2002
***************
*** 20,26 ****
  if test x${is_release} = x; then
  dnl Sad, but we can't use XSTRING here to pick up the date from version.h
  dnl because traditional C doesn't allow it.
!   bfd_version_string="\"${VERSION} ${bfd_version_date}\""
  fi
  dnl Since we need to edit bfd-in3.h to get the date for bfd_version_string,
  dnl we may as well substitute for bfd_version_date too.  That way we don't
--- 20,26 ----
  if test x${is_release} = x; then
  dnl Sad, but we can't use XSTRING here to pick up the date from version.h
  dnl because traditional C doesn't allow it.
!   bfd_version_string="\"${VERSION} ${bfd_version_date} (prerelease)\""
  fi
  dnl Since we need to edit bfd-in3.h to get the date for bfd_version_string,
  dnl we may as well substitute for bfd_version_date too.  That way we don't

and for the main branch:

2002-03-05  Christian Jönsson  <c.christian.joensson@telia.com>

	* configure.in (bfd_version_string): Add (experimental) to main
	branch.

*** bfd/configure.in.orig	Mon Mar  4 07:36:30 2002
--- bfd/configure.in	Tue Mar  5 11:45:14 2002
***************
*** 20,26 ****
  if test x${is_release} = x; then
  dnl Sad, but we can't use XSTRING here to pick up the date from version.h
  dnl because traditional C doesn't allow it.
!   bfd_version_string="\"${VERSION} ${bfd_version_date}\""
  fi
  dnl Since we need to edit bfd-in3.h to get the date for bfd_version_string,
  dnl we may as well substitute for bfd_version_date too.  That way we don't
--- 20,26 ----
  if test x${is_release} = x; then
  dnl Sad, but we can't use XSTRING here to pick up the date from version.h
  dnl because traditional C doesn't allow it.
!   bfd_version_string="\"${VERSION} ${bfd_version_date} (experimental)\""
  fi
  dnl Since we need to edit bfd-in3.h to get the date for bfd_version_string,
  dnl we may as well substitute for bfd_version_date too.  That way we don't


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: First suggestion to lift version handling
  2002-03-05  3:14 First suggestion to lift version handling Christian Jönsson
@ 2002-03-05  4:46 ` Christian Jönsson
  2002-03-05  5:56   ` Christian Jönsson
  0 siblings, 1 reply; 7+ messages in thread
From: Christian Jönsson @ 2002-03-05  4:46 UTC (permalink / raw)
  To: Binutils

On Tue, Mar 05, 2002 at 12:13:50PM +0100, Christian Jönsson wrote:
> Here's my first suggestion to lift version handling in the binutils
> sources, to differ the main branch (experimental) from (any)
> prerelease branch. A regeneration of bfd/configure is thus needed.
> 
> Now, let's figure out how the bfd_version_string can be used in the
> test suite so that test results from different branches, and releases,
> can be seen from log files.

Well, the as-new --version output looks fine to me, here's main branch:

GNU assembler 2.12.90 20020304 (experimental)
Copyright 2002 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License.  This program has absolutely no warranty.
This assembler was configured for a target of `sparc-linux'.

but the test suite gets it wrong:

                === gas Summary ===

# of expected passes            153
../as-new Inc.


and I would really like that to be something like

                === gas Summary ===

# of expected passes            153
/share1/gcc-dev/src/objdir/gas/as-new 2.12.90 20020304 (experimental)

(but actually I'd like version to be 2.13 as you all who follow this
know, but that's yet an other issue)

Cheers,

/ChJ

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: First suggestion to lift version handling
  2002-03-05  4:46 ` Christian Jönsson
@ 2002-03-05  5:56   ` Christian Jönsson
  2002-03-05  7:41     ` Daniel Jacobowitz
  2002-03-07  5:25     ` Christian Jönsson
  0 siblings, 2 replies; 7+ messages in thread
From: Christian Jönsson @ 2002-03-05  5:56 UTC (permalink / raw)
  To: Binutils

On Tue, Mar 05, 2002 at 01:46:16PM +0100, Christian Jönsson wrote:
> On Tue, Mar 05, 2002 at 12:13:50PM +0100, Christian Jönsson wrote:
> > Here's my first suggestion to lift version handling in the binutils
> > sources, to differ the main branch (experimental) from (any)
> > prerelease branch. A regeneration of bfd/configure is thus needed.
> > 
> > Now, let's figure out how the bfd_version_string can be used in the
> > test suite so that test results from different branches, and releases,
> > can be seen from log files.
> 
> Well, the as-new --version output looks fine to me, here's main branch:
> 
> GNU assembler 2.12.90 20020304 (experimental)
> Copyright 2002 Free Software Foundation, Inc.
> This program is free software; you may redistribute it under the terms of
> the GNU General Public License.  This program has absolutely no warranty.
> This assembler was configured for a target of `sparc-linux'.
> 
> but the test suite gets it wrong:
> 
>                 === gas Summary ===
> 
> # of expected passes            153
> ../as-new Inc.
> 
> 
> and I would really like that to be something like
> 
>                 === gas Summary ===
> 
> # of expected passes            153
> /share1/gcc-dev/src/objdir/gas/as-new 2.12.90 20020304 (experimental)
> 


I'm no good at this but if anyone could help me out with this first
one, I'm sure I could get the most of the rest myself...

This is from gas/testsuite/lib/gas-defs.exp 

proc gas_version {} {
    global AS
    catch "exec $AS -version < /dev/null" tmp
    # Should find a way to discard constant parts, keep whatever's
    # left, so the version string could be almost anything at all...
    regexp "\[^\n\]* (cygnus-|)(\[-0-9.a-zA-Z-\]+)\[\r\n\].*" $tmp version cyg number
    if ![info exists number] then {
        return "[which $AS] (no version number)\n"
    }
    clone_output "[which $AS] $number\n"
    unset version
}

I guess it's the regexp line in this dejagnu/expect/tcl script that
needs some tweaking, right? 

Any help is greatly appreciated, TIA.

Cheers,

/ChJ

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: First suggestion to lift version handling
  2002-03-05  5:56   ` Christian Jönsson
@ 2002-03-05  7:41     ` Daniel Jacobowitz
  2002-03-07  5:25     ` Christian Jönsson
  1 sibling, 0 replies; 7+ messages in thread
From: Daniel Jacobowitz @ 2002-03-05  7:41 UTC (permalink / raw)
  To: Binutils

On Tue, Mar 05, 2002 at 02:56:28PM +0100, Christian J?nsson wrote:
> I'm no good at this but if anyone could help me out with this first
> one, I'm sure I could get the most of the rest myself...
> 
> This is from gas/testsuite/lib/gas-defs.exp 
> 
> proc gas_version {} {
>     global AS
>     catch "exec $AS -version < /dev/null" tmp
>     # Should find a way to discard constant parts, keep whatever's
>     # left, so the version string could be almost anything at all...
>     regexp "\[^\n\]* (cygnus-|)(\[-0-9.a-zA-Z-\]+)\[\r\n\].*" $tmp version cyg number
>     if ![info exists number] then {
>         return "[which $AS] (no version number)\n"
>     }
>     clone_output "[which $AS] $number\n"
>     unset version
> }
> 
> I guess it's the regexp line in this dejagnu/expect/tcl script that
> needs some tweaking, right? 
> 
> Any help is greatly appreciated, TIA.

You may want to check that various versions of GCC still correctly
detect assembler version after a patch like this.  There was a problem
with it not long ago...



-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: First suggestion to lift version handling
  2002-03-05  5:56   ` Christian Jönsson
  2002-03-05  7:41     ` Daniel Jacobowitz
@ 2002-03-07  5:25     ` Christian Jönsson
  2002-03-07  5:46       ` Christian Jönsson
  1 sibling, 1 reply; 7+ messages in thread
From: Christian Jönsson @ 2002-03-07  5:25 UTC (permalink / raw)
  To: Binutils

On Tue, Mar 05, 2002 at 02:56:28PM +0100, Christian Jönsson wrote:
> On Tue, Mar 05, 2002 at 01:46:16PM +0100, Christian Jönsson wrote:
> > On Tue, Mar 05, 2002 at 12:13:50PM +0100, Christian Jönsson wrote:
> > > Here's my first suggestion to lift version handling in the binutils
> > > sources, to differ the main branch (experimental) from (any)
> > > prerelease branch. A regeneration of bfd/configure is thus needed.

I've been doing some thinking here. I've considered having 'GNU
assembler version 2.11.93 (prerelease)' instead of 'GNU assembler
2.11.93 (prerelease)' etc., as the 'GNU ld version 2.11.93
(prerelease)'. This would make things a lot easier for me to
implement. However, reading
http://www.gnu.org/prep/standards_18.html#SEC18 I have come to the
conclusion that the inclusion of the word 'version' is less standrad
conforming as it is without it. I thus suggest removal from ldvers.c.


So here's the next suggestions.

For both the main and the 2.12 branch:



2002-03-07  Christian Jönsson  <c.christian.joensson@telia.com>

	* version.c (print_version): Let version output be 'progname'
        (GNU binutils) to be more standard conforming.



*** binutils/version.c.orig	Fri Jan 18 12:28:42 2002
--- binutils/version.c	Thu Mar  7 13:48:49 2002
***************
*** 31,37 ****
  {
    /* This output is intended to follow the GNU standards document.  */
    /* xgettext:c-format */
!   printf ("GNU %s %s\n", name, BFD_VERSION_STRING);
    printf (_("Copyright 2002 Free Software Foundation, Inc.\n"));
    printf (_("\
  This program is free software; you may redistribute it under the terms of\n\
--- 31,37 ----
  {
    /* This output is intended to follow the GNU standards document.  */
    /* xgettext:c-format */
!   printf ("%s (GNU binutils) %s\n", name, BFD_VERSION_STRING);
    printf (_("Copyright 2002 Free Software Foundation, Inc.\n"));
    printf (_("\
  This program is free software; you may redistribute it under the terms of\n\



2002-03-07  Christian Jönsson  <c.christian.joensson@telia.com>

	* ldver.c (ldversion): Let version output be ld
        (GNU binutils) to be more standard conforming.



*** ld/ldver.c.orig	Thu Mar  7 12:19:05 2002
--- ld/ldver.c	Thu Mar  7 13:49:11 2002
***************
*** 35,41 ****
       int noisy;
  {
    /* Output for noisy == 2 is intended to follow the GNU standards.  */
!   fprintf (stdout, _("GNU ld version %s\n"), BFD_VERSION_STRING);
  
    if (noisy & 2)
      {
--- 35,41 ----
       int noisy;
  {
    /* Output for noisy == 2 is intended to follow the GNU standards.  */
!   fprintf (stdout, _("ld (GNU binutils) %s\n"), BFD_VERSION_STRING);
  
    if (noisy & 2)
      {



2002-03-07  Christian Jönsson  <c.christian.joensson@telia.com>

	* as.c (print_version_id): Let version output be as
        (GNU binutils) to be more standard conforming.
        (OPTION_VERSION): Likewise.



*** gas/as.c.orig	Thu Mar  7 12:16:28 2002
--- gas/as.c	Thu Mar  7 13:49:53 2002
***************
*** 207,216 ****
    printed = 1;
  
  #ifdef BFD_ASSEMBLER
!   fprintf (stderr, _("GNU assembler version %s (%s) using BFD version %s"),
  	   VERSION, TARGET_ALIAS, BFD_VERSION_STRING);
  #else
!   fprintf (stderr, _("GNU assembler version %s (%s)"), VERSION, TARGET_ALIAS);
  #endif
    fprintf (stderr, "\n");
  }
--- 207,216 ----
    printed = 1;
  
  #ifdef BFD_ASSEMBLER
!   fprintf (stderr, _("as (GNU binutils) %s (%s) using BFD version %s"),
  	   VERSION, TARGET_ALIAS, BFD_VERSION_STRING);
  #else
!   fprintf (stderr, _("as (GNU binutils) %s (%s)"), VERSION, TARGET_ALIAS);
  #endif
    fprintf (stderr, "\n");
  }
***************
*** 524,530 ****
  
  	case OPTION_VERSION:
  	  /* This output is intended to follow the GNU standards document.  */
! 	  printf (_("GNU assembler %s\n"), BFD_VERSION_STRING);
  	  printf (_("Copyright 2002 Free Software Foundation, Inc.\n"));
  	  printf (_("\
  This program is free software; you may redistribute it under the terms of\n\
--- 524,530 ----
  
  	case OPTION_VERSION:
  	  /* This output is intended to follow the GNU standards document.  */
! 	  printf (_("as (GNU binutils) %s\n"), BFD_VERSION_STRING);
  	  printf (_("Copyright 2002 Free Software Foundation, Inc.\n"));
  	  printf (_("\
  This program is free software; you may redistribute it under the terms of\n\



And I'll post the darn fixes for utils-lib.exp, gas-defs.exp. and
ld-lib.exp once I get the hand on regexps.

Cheers,

/ChJ

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: First suggestion to lift version handling
  2002-03-07  5:25     ` Christian Jönsson
@ 2002-03-07  5:46       ` Christian Jönsson
  2002-03-07  7:34         ` Christian Jönsson
  0 siblings, 1 reply; 7+ messages in thread
From: Christian Jönsson @ 2002-03-07  5:46 UTC (permalink / raw)
  To: Binutils

On Thu, Mar 07, 2002 at 02:25:24PM +0100, Christian Jönsson wrote:
> On Tue, Mar 05, 2002 at 02:56:28PM +0100, Christian Jönsson wrote:
> > On Tue, Mar 05, 2002 at 01:46:16PM +0100, Christian Jönsson wrote:
> > > On Tue, Mar 05, 2002 at 12:13:50PM +0100, Christian Jönsson wrote:
> > > > Here's my first suggestion to lift version handling in the binutils
> > > > sources, to differ the main branch (experimental) from (any)
> > > > prerelease branch. A regeneration of bfd/configure is thus needed.
> 
> I've been doing some thinking here. I've considered having 'GNU
> assembler version 2.11.93 (prerelease)' instead of 'GNU assembler
> 2.11.93 (prerelease)' etc., as the 'GNU ld version 2.11.93
> (prerelease)'. This would make things a lot easier for me to
> implement. However, reading
> http://www.gnu.org/prep/standards_18.html#SEC18 I have come to the
> conclusion that the inclusion of the word 'version' is less standrad
> conforming as it is without it. I thus suggest removal from ldvers.c.
>

Now we're ready to finish this off. Here's the last remaining patches. Could go into both main and 2.12 branch.

Cheers,

/ChJ


2002-03-07  Christian Jönsson  <c.christian.joensson@telia.com>

	* testsuite/lib/ld-lib.exp (default_ld_version): Change version
	parsing according to new version handling.



*** ld/testsuite/lib/ld-lib.exp.orig	Thu Mar  7 12:20:13 2002
--- ld/testsuite/lib/ld-lib.exp	Thu Mar  7 14:38:36 2002
***************
*** 28,38 ****
  	exit 1
      }
      
!     catch "exec $ld --version" tmp
!     set tmp [prune_warnings $tmp]
!     regexp "\[^\n\]* (cygnus-|)(\[-0-9.a-zA-Z-\]+)\[\r\n\].*" $tmp version cyg number
!     if [info exists number] then {
! 	clone_output "$ld $number\n"
      }
  }
  
--- 28,39 ----
  	exit 1
      }
      
!     set tmp [exec $ld --version]
!     regexp -line {\w. \(GNU binutils\) (.+)$} $tmp match version
!     if { [info exists version] } then {
! 	clone_output "$ld $version\n"
!     } else {
! 	clone_output "Couldn't determine version of $ld: $tmp\n"
      }
  }
  


2002-03-07  Christian Jönsson  <c.christian.joensson@telia.com>

	* testsuite/lib/gas-defs.exp (gas_version): Change version parsing
	according to new version handling.



*** gas/testsuite/lib/gas-defs.exp.orig	Thu Mar  7 12:18:23 2002
--- gas/testsuite/lib/gas-defs.exp	Thu Mar  7 14:34:15 2002
***************
*** 22,36 ****
  
  proc gas_version {} {
      global AS
!     catch "exec $AS -version < /dev/null" tmp
!     # Should find a way to discard constant parts, keep whatever's
!     # left, so the version string could be almost anything at all...
!     regexp "\[^\n\]* (cygnus-|)(\[-0-9.a-zA-Z-\]+)\[\r\n\].*" $tmp version cyg number
!     if ![info exists number] then {
!         return "[which $AS] (no version number)\n"
      }
-     clone_output "[which $AS] $number\n"
-     unset version
  }
  
  proc gas_run { prog as_opts redir } {
--- 22,35 ----
  
  proc gas_version {} {
      global AS
! 
!     set tmp [exec $AS --version < /dev/null]
!     regexp -line {\w. \(GNU binutils\) (.+)$} $tmp match version
!     if { [info exists version] } then {
! 	clone_output "$AS $version\n"
!     } else {
! 	clone_output "Couldn't determine version of $AS: $tmp\n"
      }
  }
  
  proc gas_run { prog as_opts redir } {




2002-03-07  Christian Jönsson  <c.christian.joensson@telia.com>

	* testsuite/lib/utils-lib.exp (binutil_version): Change version
	parsing according to new version handling.



*** binutils/testsuite/lib/utils-lib.exp.orig	Thu Mar  7 12:16:23 2002
--- binutils/testsuite/lib/utils-lib.exp	Thu Mar  7 14:32:55 2002
***************
*** 31,45 ****
      } else {
  	set path $prog
      }
!     set state [remote_exec host $prog --version];
!     set tmp "[lindex $state 1]\n";
!     # Should find a way to discard constant parts, keep whatever's
!     # left, so the version string could be almost anything at all...
!     regexp "\[^\n\]* (cygnus-|)(\[-0-9.a-zA-Z-\]+)\[\r\n\].*" "$tmp" version cyg number
!     if ![info exists number] then {
!         return "$path (no version number)\n"
      }
-     return "$path $number\n"
  }
  
  #
--- 31,43 ----
      } else {
  	set path $prog
      }
!     set tmp [remote_exec host $prog --version];
!     regexp -line {\w. \(GNU binutils\) (.+)$} $tmp match version
!     if { [info exists version] } then {
! 	clone_output "$prog $version\n"
!     } else {
! 	clone_output "Couldn't determine version of $prog: $tmp\n"
      }
  }
  
  #

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: First suggestion to lift version handling
  2002-03-07  5:46       ` Christian Jönsson
@ 2002-03-07  7:34         ` Christian Jönsson
  0 siblings, 0 replies; 7+ messages in thread
From: Christian Jönsson @ 2002-03-07  7:34 UTC (permalink / raw)
  To: Binutils

On Thu, Mar 07, 2002 at 02:46:43PM +0100, Christian Jönsson wrote:
> On Thu, Mar 07, 2002 at 02:25:24PM +0100, Christian Jönsson wrote:
> > On Tue, Mar 05, 2002 at 02:56:28PM +0100, Christian Jönsson wrote:
> > > On Tue, Mar 05, 2002 at 01:46:16PM +0100, Christian Jönsson wrote:
> > > > On Tue, Mar 05, 2002 at 12:13:50PM +0100, Christian Jönsson wrote:
> > > > > Here's my first suggestion to lift version handling in the binutils
> > > > > sources, to differ the main branch (experimental) from (any)
> > > > > prerelease branch. A regeneration of bfd/configure is thus needed.
> > 
> > I've been doing some thinking here. I've considered having 'GNU
> > assembler version 2.11.93 (prerelease)' instead of 'GNU assembler
> > 2.11.93 (prerelease)' etc., as the 'GNU ld version 2.11.93
> > (prerelease)'. This would make things a lot easier for me to
> > implement. However, reading
> > http://www.gnu.org/prep/standards_18.html#SEC18 I have come to the
> > conclusion that the inclusion of the word 'version' is less standrad
> > conforming as it is without it. I thus suggest removal from ldvers.c.
> >
> 
> Now we're ready to finish this off. Here's the last remaining patches. Could go into both main and 2.12 branch.
> 
> Cheers,
> 
> /ChJ
> 

[snip]

> 
> 2002-03-07  Christian Jönsson  <c.christian.joensson@telia.com>
> 
> 	* testsuite/lib/utils-lib.exp (binutil_version): Change version
> 	parsing according to new version handling.
> 
> 

Got this one wrong, to much copy and paste.

*** binutils/testsuite/lib/utils-lib.exp.orig	Thu Mar  7 12:16:23 2002
--- binutils/testsuite/lib/utils-lib.exp	Thu Mar  7 16:31:14 2002
***************
*** 31,45 ****
      } else {
  	set path $prog
      }
!     set state [remote_exec host $prog --version];
!     set tmp "[lindex $state 1]\n";
!     # Should find a way to discard constant parts, keep whatever's
!     # left, so the version string could be almost anything at all...
!     regexp "\[^\n\]* (cygnus-|)(\[-0-9.a-zA-Z-\]+)\[\r\n\].*" "$tmp" version cyg number
!     if ![info exists number] then {
!         return "$path (no version number)\n"
      }
-     return "$path $number\n"
  }
  
  #
--- 31,43 ----
      } else {
  	set path $prog
      }
!     set tmp [remote_exec host $prog --version];
!     regexp -line {\w. \(GNU binutils\) (.+)$} $tmp match version
!     if { [info exists version] } then {
! 	return "$path $version\n"
!     } else {
! 	return "Couldn't determine version of $ath: $tmp\n"
      }
  }
  
  #

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2002-03-07 15:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-05  3:14 First suggestion to lift version handling Christian Jönsson
2002-03-05  4:46 ` Christian Jönsson
2002-03-05  5:56   ` Christian Jönsson
2002-03-05  7:41     ` Daniel Jacobowitz
2002-03-07  5:25     ` Christian Jönsson
2002-03-07  5:46       ` Christian Jönsson
2002-03-07  7:34         ` Christian Jönsson

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