* version.cc (print_version): Adjust output for current value of
authorIan Lance Taylor <ian@airs.com>
Tue, 25 Mar 2008 23:30:48 +0000 (23:30 +0000)
committerIan Lance Taylor <ian@airs.com>
Tue, 25 Mar 2008 23:30:48 +0000 (23:30 +0000)
BFD_VERSION_STRING.

gold/ChangeLog
gold/version.cc

index 74d4eb2ae061db52a5b0353888595532f2347e8a..fc6032e316ad0ca79fc177c0ca88250716ffb9db 100644 (file)
@@ -1,5 +1,10 @@
 2008-03-25  Ian Lance Taylor  <iant@google.com>
 
+       * version.cc (print_version): Adjust output for current value of
+       BFD_VERSION_STRING.
+
+       * NEWS: New file.
+
        * options.cc (options::help): Print list of supported targets.
        * target-select.h: Include <vector>.
        (class Target_selector): Make machine_, size_, and is_big_endian_
index 489880dff9886950c599d75dde7e099aaa90e105..9e3ec2877a29a0547fce8df5c4a417f5b62cbf55 100644 (file)
@@ -40,9 +40,21 @@ static const char* version_string = "1.4";
 void
 print_version(bool print_short)
 {
-  /* xgettext:c-format */
-  printf("GNU gold (GNU binutils %s) version %s\n",
-        BFD_VERSION_STRING, version_string);
+  // The --version output is intended to follow the GNU coding
+  // standards.  We want to print something like:
+  //    GNU gold (GNU binutils 2.19) 1.4
+  // BFD_VERSION_STRING looks like "(GNU Binutils) 2.19".  We take off
+  // those parentheses.
+  std::string bfd_version(BFD_VERSION_STRING);
+  if (bfd_version[0] == '(')
+    {
+      bfd_version.erase(0, 1);
+      size_t pos = bfd_version.find(')');
+      if (pos != std::string::npos)
+       bfd_version.erase(pos, 1);
+    }
+
+  printf("GNU gold (%s) %s\n", bfd_version.c_str(), version_string);
 
   if (!print_short)
     {
This page took 0.028508 seconds and 4 git commands to generate.