From 91686a86876553774452d97f3f74d5f147b19164 Mon Sep 17 00:00:00 2001 From: Kevin Smith Date: Wed, 21 Apr 2010 11:45:51 +0000 Subject: Make latency stats optional. Includes boost program_options so we can use commandline parameters. Netbook mode is now activated with --netbook-mode. Latency debug is activated with --latency-debug. diff --git a/3rdParty/Boost/SConscript b/3rdParty/Boost/SConscript index 3e6897f..43f0180 100644 --- a/3rdParty/Boost/SConscript +++ b/3rdParty/Boost/SConscript @@ -61,7 +61,18 @@ if env["SCONS_STAGE"] == "build" : "src/libs/regex/src/wc_regex_traits.cpp", "src/libs/regex/src/wide_posix_api.cpp", "src/libs/regex/src/winstances.cpp", - "src/libs/regex/src/usinstances.cpp"] + "src/libs/regex/src/usinstances.cpp", + "src/libs/program_options/src/cmdline.cpp", + "src/libs/program_options/src/config_file.cpp", + "src/libs/program_options/src/convert.cpp", + "src/libs/program_options/src/options_description.cpp", + "src/libs/program_options/src/parsers.cpp", + "src/libs/program_options/src/positional_options.cpp", + "src/libs/program_options/src/split.cpp", + "src/libs/program_options/src/utf8_codecvt_facet.cpp", + "src/libs/program_options/src/value_semantic.cpp", + "src/libs/program_options/src/variables_map.cpp", + "src/libs/program_options/src/winmain.cpp"] if env["PLATFORM"] != "win32" : sources += [ @@ -82,6 +93,7 @@ if env["SCONS_STAGE"] == "build" : bcp_env.Append(CPPPATH = ["src/tools/bcp"]) bcp_env.Program("bcp", [ "src/tools/bcp/add_path.cpp", + "src/tools/bcp/add_dependent_lib.cpp", "src/tools/bcp/bcp_imp.cpp", "src/tools/bcp/copy_path.cpp", "src/tools/bcp/file_types.cpp", diff --git a/3rdParty/Boost/src/boost/program_options.hpp b/3rdParty/Boost/src/boost/program_options.hpp new file mode 100644 index 0000000..9d12b08 --- /dev/null +++ b/3rdParty/Boost/src/boost/program_options.hpp @@ -0,0 +1,25 @@ +// Copyright Vladimir Prus 2002. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// See www.boost.org/libs/program_options for documentation. + +#ifndef PROGRAM_OPTIONS_VP_2003_05_19 +#define PROGRAM_OPTIONS_VP_2003_05_19 + +#if _MSC_VER >= 1020 +#pragma once +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif diff --git a/3rdParty/Boost/src/boost/program_options/cmdline.hpp b/3rdParty/Boost/src/boost/program_options/cmdline.hpp new file mode 100644 index 0000000..8705e60 --- /dev/null +++ b/3rdParty/Boost/src/boost/program_options/cmdline.hpp @@ -0,0 +1,90 @@ +// Copyright Vladimir Prus 2004. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_CMDLINE_HPP_VP_2004_03_13 +#define BOOST_CMDLINE_HPP_VP_2004_03_13 + +namespace boost { namespace program_options { namespace command_line_style { + /** Various possible styles of options. + + There are "long" options, which start with "--" and "short", + which start with either "-" or "/". Both kinds can be allowed or + disallowed, see allow_long and allow_short. The allowed character + for short options is also configurable. + + Option's value can be specified in the same token as name + ("--foo=bar"), or in the next token. + + It's possible to introduce long options by the same character as + short options, see allow_long_disguise. + + Finally, guessing (specifying only prefix of option) and case + insensitive processing are supported. + */ + enum style_t { + /// Allow "--long_name" style + allow_long = 1, + /// Allow "--foo=10 + */ + allow_long_disguise = short_case_insensitive << 1, + /** The more-or-less traditional unix style. */ + unix_style = (allow_short | short_allow_adjacent | short_allow_next + | allow_long | long_allow_adjacent | long_allow_next + | allow_sticky | allow_guessing + | allow_dash_for_short), + /** The default style. */ + default_style = unix_style + }; +}}} + + +#endif + diff --git a/3rdParty/Boost/src/boost/program_options/config.hpp b/3rdParty/Boost/src/boost/program_options/config.hpp new file mode 100644 index 0000000..0c69c14 --- /dev/null +++ b/3rdParty/Boost/src/boost/program_options/config.hpp @@ -0,0 +1,55 @@ +// Copyright (c) 2004 Hartmut Kaiser +// +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_PROGRAM_OPTIONS_CONFIG_HK_2004_01_11 +#define BOOST_PROGRAM_OPTIONS_CONFIG_HK_2004_01_11 + +#include +#include + +// Support for autolinking. +#if BOOST_VERSION >= 103100 // works beginning from Boost V1.31.0 + +/////////////////////////////////////////////////////////////////////////////// +// enable automatic library variant selection +#if !defined(BOOST_PROGRAM_OPTIONS_SOURCE) && !defined(BOOST_ALL_NO_LIB) && \ + !defined(BOOST_PROGRAM_OPTIONS_NO_LIB) + +// Set the name of our library, this will get undef'ed by auto_link.hpp +// once it's done with it: +#define BOOST_LIB_NAME boost_program_options +// tell the auto-link code to select a dll when required: +#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_PROGRAM_OPTIONS_DYN_LINK) +# define BOOST_DYN_LINK +#endif + +// And include the header that does the work: +#include + +#endif // auto-linking disabled + +#endif // BOOST_VERSION + +/////////////////////////////////////////////////////////////////////////////// +// Windows DLL suport +#ifdef BOOST_HAS_DECLSPEC +#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_PROGRAM_OPTIONS_DYN_LINK) +// export if this is our own source, otherwise import: +#ifdef BOOST_PROGRAM_OPTIONS_SOURCE +# define BOOST_PROGRAM_OPTIONS_DECL __declspec(dllexport) +#else +# define BOOST_PROGRAM_OPTIONS_DECL __declspec(dllimport) +#endif // BOOST_PROGRAM_OPTIONS_SOURCE +#endif // DYN_LINK +#endif // BOOST_HAS_DECLSPEC + +#ifndef BOOST_PROGRAM_OPTIONS_DECL +#define BOOST_PROGRAM_OPTIONS_DECL +#endif + + +#endif // PROGRAM_OPTIONS_CONFIG_HK_2004_01_11 + diff --git a/3rdParty/Boost/src/boost/program_options/detail/cmdline.hpp b/3rdParty/Boost/src/boost/program_options/detail/cmdline.hpp new file mode 100644 index 0000000..8d60ead --- /dev/null +++ b/3rdParty/Boost/src/boost/program_options/detail/cmdline.hpp @@ -0,0 +1,138 @@ +// Copyright Vladimir Prus 2002-2004. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + + +#ifndef BOOST_CMDLINE_VP_2003_05_19 +#define BOOST_CMDLINE_VP_2003_05_19 + +#include +#include +#include +#include +#include +#include + + +#include + +#include + +#include +#include + +namespace boost { namespace program_options { namespace detail { + + /** Command line parser class. Main requirements were: + - Powerful enough to support all common uses. + - Simple and easy to learn/use. + - Minimal code size and external dependencies. + - Extensible for custom syntaxes. + + First all options are registered. After that, elements of command line + are extracted using operator++. + + For each element, user can find + - if it's an option or an argument + - name of the option + - index of the option + - option value(s), if any + + Sometimes the registered option name is not equal to the encountered + one, for example, because name abbreviation is supported. Therefore + two option names can be obtained: + - the registered one + - the one found at the command line + + There are lot of style options, which can be used to tune the command + line parsing. In addition, it's possible to install additional parser + which will process custom option styles. + + @todo mininal match length for guessing? + */ + class BOOST_PROGRAM_OPTIONS_DECL cmdline { + public: + + typedef ::boost::program_options::command_line_style::style_t style_t; + + typedef function1, + const std::string&> + additional_parser; + + typedef function1, std::vector&> + style_parser; + + /** Constructs a command line parser for (argc, argv) pair. Uses + style options passed in 'style', which should be binary or'ed values + of style_t enum. It can also be zero, in which case a "default" + style will be used. If 'allow_unregistered' is true, then allows + unregistered options. They will be assigned index 1 and are + assumed to have optional parameter. + */ + cmdline(const std::vector& args); + + /** @overload */ + cmdline(int argc, const char*const * argv); + + void style(int style); + void allow_unregistered(); + + void set_options_description(const options_description& desc); + void set_positional_options( + const positional_options_description& m_positional); + + std::vector