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::ostringstream;
30using std::string;
31
32void
33get_version(string & out)
34{
35 out = (F("%s (base revision: %s)")
36 % PACKAGE_STRING % string(package_revision_constant)).str();
37}
38
39void
40print_version()
41{
42 string s;
43 get_version(s);
44 cout << s << '\n';
45}
46
47void
48get_full_version(string & out)
49{
50 ostringstream oss;
51 string s;
52 get_version(s);
53 oss << s << '\n';
54 get_system_flavour(s);
55 oss << F("Running on : %s\n"
56 "C++ compiler : %s\n"
57 "C++ standard library: %s\n"
58 "Boost version : %s\n"
59 "Changes since base revision:\n"
60 "%s")
61 % s
62 % BOOST_COMPILER
63 % BOOST_STDLIB
64 % BOOST_LIB_VERSION
65 % string(package_full_revision_constant);
66 out = oss.str();
67}
68
69void
70print_full_version()
71{
72 string s;
73 get_full_version(s);
74 cout << s << '\n';
75}
76
77// Local Variables:
78// mode: C++
79// fill-column: 76
80// c-file-style: "gnu"
81// indent-tabs-mode: nil
82// End:
83// 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