monotone

monotone Mtn Source Tree

Root/mt_version.cc

1// Copyright (C) 2004 Nathaniel Smith <njs@pobox.com>
2//
3// This program is made available under the GNU GPL version 2.0 or
4// greater. See the accompanying file COPYING for details.
5//
6// This program is distributed WITHOUT ANY WARRANTY; without even the
7// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8// PURPOSE.
9
10// This is split off into its own file to minimize recompilation time; it is
11// the only .cc file that depends on the revision/full_revision header files,
12// which change constantly.
13
14#include "config.h"
15
16#include <iostream>
17#include <sstream>
18
19#include <boost/version.hpp>
20#include <boost/config.hpp>
21
22#include "platform.hh"
23#include "mt_version.hh"
24#include "package_revision.h"
25#include "package_full_revision.h"
26#include "sanity.hh"
27
28using std::cout;
29using std::endl;
30using std::ostringstream;
31using std::string;
32
33void
34get_version(string & out)
35{
36 out = (F("%s (base revision: %s)")
37 % PACKAGE_STRING % string(package_revision_constant)).str();
38}
39
40void
41print_version()
42{
43 string s;
44 get_version(s);
45 cout << s << endl;
46}
47
48void
49get_full_version(string & out)
50{
51 ostringstream oss;
52 string s;
53 get_version(s);
54 oss << s << "\n";
55 get_system_flavour(s);
56 oss << F("Running on : %s\n"
57 "C++ compiler : %s\n"
58 "C++ standard library: %s\n"
59 "Boost version : %s\n"
60 "Changes since base revision:\n"
61 "%s")
62 % s
63 % BOOST_COMPILER
64 % BOOST_STDLIB
65 % BOOST_LIB_VERSION
66 % string(package_full_revision_constant);
67 out = oss.str();
68}
69
70void
71print_full_version()
72{
73 string s;
74 get_full_version(s);
75 cout << s << endl;
76}
77
78// Local Variables:
79// mode: C++
80// fill-column: 76
81// c-file-style: "gnu"
82// indent-tabs-mode: nil
83// End:
84// vim: et:sw=2:sts=2:ts=2:cino=>2s,{s,\:s,+s,t0,g0,^-2,e-2,n-2,p2s,(0,=s:

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status