diff --git a/doc/using.qbk b/doc/using.qbk index 8b1786dd..267e540d 100644 --- a/doc/using.qbk +++ b/doc/using.qbk @@ -130,6 +130,15 @@ name of the `boost_system` library may vary depending on the compiler version): ] +[heading Optional separate compilation] + +By default, Boost.Asio is a header-only library. However, some developers may +prefer to build Boost.Asio using separately compiled source code. To do this, +add `#include ` to one (and only one) source file in a +program, then build the program with `BOOST_ASIO_SEPARATE_COMPILATION` defined +in the project\/compiler settings. Alternatively, `BOOST_ASIO_DYN_LINK` may be +defined to build a separately-compiled Boost.Asio as part of a shared library. + [heading Macros] The macros listed in the table below may be used to control the behaviour of diff --git a/include/boost/asio/impl/src.cpp b/include/boost/asio/impl/src.cpp index 59a10c95..fa418563 100644 --- a/include/boost/asio/impl/src.cpp +++ b/include/boost/asio/impl/src.cpp @@ -8,52 +8,18 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#define BOOST_ASIO_SOURCE - -#include - -#if defined(BOOST_ASIO_HEADER_ONLY) -# error Do not compile Asio library source with BOOST_ASIO_HEADER_ONLY defined +#if defined(_MSC_VER) \ + || defined(__BORLANDC__) \ + || defined(__DMC__) +# pragma message ( \ + "This file is deprecated. " \ + "Please #include instead.>) +#elif defined(__GNUC__) \ + || defined(__HP_aCC) \ + || defined(__SUNPRO_CC) \ + || defined(__IBMCPP__) +# warning "This file is deprecated." +# warning "Please #include instead.> #endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include diff --git a/include/boost/asio/impl/src.hpp b/include/boost/asio/impl/src.hpp new file mode 100644 index 00000000..60f92d5a --- /dev/null +++ b/include/boost/asio/impl/src.hpp @@ -0,0 +1,64 @@ +// +// impl/src.hpp +// ~~~~~~~~~~~~ +// +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// 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_ASIO_IMPL_SRC_HPP +#define BOOST_ASIO_IMPL_SRC_HPP + +#define BOOST_ASIO_SOURCE + +#include + +#if defined(BOOST_ASIO_HEADER_ONLY) +# error Do not compile Asio library source with BOOST_ASIO_HEADER_ONLY defined +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif // BOOST_ASIO_IMPL_SRC_HPP