First suggestion to lift version handling

Christian Jönsson c.christian.joensson@telia.com
Thu Mar 7 05:46:00 GMT 2002


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"
      }
  }
  
  #



More information about the Binutils mailing list