* eval.c (evaluate_subexp_standard): Fix thinko in handling
[deliverable/binutils-gdb.git] / gold / version.cc
CommitLineData
8486ee48
ILT
1// version.c -- print gold version information
2
4fb3aee2 3// Copyright 2006, 2007, 2008, 2009, 2010, 2011
36c50e63 4// Free Software Foundation, Inc.
8486ee48
ILT
5// Written by Ian Lance Taylor <iant@google.com>.
6
7// This file is part of gold.
8
9// This program is free software; you can redistribute it and/or modify
10// it under the terms of the GNU General Public License as published by
11// the Free Software Foundation; either version 3 of the License, or
12// (at your option) any later version.
13
14// This program is distributed in the hope that it will be useful,
15// but WITHOUT ANY WARRANTY; without even the implied warranty of
16// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17// GNU General Public License for more details.
18
19// You should have received a copy of the GNU General Public License
20// along with this program; if not, write to the Free Software
21// Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
22// MA 02110-1301, USA.
23
24#include "gold.h"
25
04bf7072 26#include <string>
e0ebcf42 27#include <cstdio>
04bf7072 28
8486ee48
ILT
29#include "../bfd/bfdver.h"
30
31namespace gold
32{
33
34// The version of gold.
35
36// FIXME: This should eventually be PACKAGE_VERSION, and get the
37// version number from configure.ac. But it's easier to just change
38// this file for now.
39
8e51a0b9 40static const char* version_string = "1.11";
8486ee48
ILT
41
42// Report version information.
43
44void
45print_version(bool print_short)
46{
f4b2c6f5
ILT
47 // The --version output is intended to follow the GNU coding
48 // standards. We want to print something like:
49 // GNU gold (GNU binutils 2.19) 1.4
50 // BFD_VERSION_STRING looks like "(GNU Binutils) 2.19". We take off
51 // those parentheses.
52 std::string bfd_version(BFD_VERSION_STRING);
53 if (bfd_version[0] == '(')
54 {
55 bfd_version.erase(0, 1);
56 size_t pos = bfd_version.find(')');
57 if (pos != std::string::npos)
58 bfd_version.erase(pos, 1);
59 }
60
61 printf("GNU gold (%s) %s\n", bfd_version.c_str(), version_string);
8486ee48
ILT
62
63 if (!print_short)
64 {
65 // This output is intended to follow the GNU standards.
0db46eb4 66 printf(_("Copyright 2011 Free Software Foundation, Inc.\n"));
ca09d69a 67 printf(_("\
8486ee48
ILT
68This program is free software; you may redistribute it under the terms of\n\
69the GNU General Public License version 3 or (at your option) a later version.\n\
70This program has absolutely no warranty.\n"));
71 }
72}
73
4f211c8b
ILT
74// Return the version string.
75
76const char*
77get_version_string()
78{
79 return version_string;
80}
81
8486ee48 82} // End namespace gold.
This page took 0.219799 seconds and 4 git commands to generate.