Files
OpenVPNAdapter/asio/release.pl
Sergey Abramchuk 6f1fcb972a Squashed 'OpenVPN Adapter/Vendors/asio/' changes from 524288cb4..82be891ba
b3d2ab725 asio version 1.12.0 released
d9161a36e Update release script to match new boost doc build.
54c7b85de Update revision history.
9eaa2a2e5 Update tutorial text to use 'io_context'.
41eb9dc20 Ignore tsified directory.
9229964dc Don't use inline namespace 'v1' in example code snippets.
10098abd6 Include inline namespace 'v1' in tsified code.
9bdbef19f Regenerate documentation.
8fa11a15d Exclude use_future_t implementation detail from documentation.
577b69806 Workaround broken doxygen typedef linking when primary template is undefined.
ea1b39f04 Fix tsify.pl to work with latest code.
694ed5284 Document the new concurrency hints.
3834d7363 Some updates to 'Using' notes.
00873ce91 Document Networking TS changes.
8f25ea4b5 Remove spurious value_type from buffer sequence requirements.
b33eb0219 gcc 4.7 is the minimum version required for std::allocator_traits.
036faf66a Use new move-enabled form of async_accept.
f72304319 Ensure that use_future<std::allocator<void>> is always constexpr default-constructible.
4ad7a397c Add missing variadic template emulation in use_future.
5c591a466 Disable buffer debugging for older MSVC, as it triggers compiler misbehaviour.
f8bd903af Add assign() and clear() functions to error_code.
db4c0e83f Disable boost.chrono error handling.
cca13eefa Document the new handler tracking features.
ff9d69e2f Add check for _DEFAULT_SOURCE in addition to _BSD_SOURCE.
52498bbc6 Suppress recv truncation errors on Windows, to match POSIX behaviour.
e87c37ec9 Add documentation examples of using asio::post to submit work.
ad52c82d2 Create C++11 versions of the fork, local, multicast and nonblocking examples.
f16e39e78 Don't directly include <chrono>, to keep header C++03-compatible.
c016e1aec Boostify the TS headers.
559013298 Suppress MSVC dynamic initialisation warning.
efa18153d Add tests to ensure the ts/* headers compile and are self-contained.
41fccd565 asio/use_future.hpp is already in the convenience header.
2e743f737 Add waitable timer headers to convenience header.
fe5470f4f Use new post() in serialization example.
45dcb33c2 Use asio::coroutine in latency tests.
e556aed8d Update invocation examples to use executors.
5a9d0721d Fix up reference to post().
24050d5ea Show how to associate an executor using nested type and member function.
b02c6c758 Update allocation overview and examples to use new form.
3218be74e Fix typo in strands overview.
3152e77f8 Increase number of buffers per operation for consuming_buffers.
5acae1971 Increase threshold for small memory block recycling to 1KB.
986ef7361 Make sure asio/system_context.hpp is self-contained.
c80c1cbd5 Don't call memcpy with length 0, to avoid passing null pointers.
ede4e7597 Fix description of std::getline's behaviour.
60170d625 Fix copy/paste error in comment.
cff2b4998 Fix clang narrowing warning.
a40570919 Fix incorrect hyperlink target.
fcaf75700 Remove last remaining instance of auto_ptr.
fddf89126 Restore binder support for 3, 4 and 5 arguments.
096660c47 Fix double delete issue introduced by 47b9319acbc45d3c1bcb805a4a03cd47df177c11.
b44805ff0 Add backward compatibility for the old ConnectCondition form.
09c69982e Ensure make_network_vX error_code overload doesn't throw on invalid prefix length.
f4fecdfe4 Fix the rights for event objects on UWP.
2943ee65f Suppress implicit fallthrough warning on newer gcc.
b441bf70b Fix clang version detection for suppression of unused typedef warning.
565c6e8fa Fix compile errors in some asio::connect overloads.
d52b81646 Bump minimum MSVC version required for C++11 allocators.
5618fadb1 Fix compile warning under Emscripten
b2367dab2 Use proper SSL_version() function so that asio can build with BoringSSL.
cfe47e71d Regenerate documentation.
6377b0466 Patch up some template links.
2bda4b85c Add new macros to doxygen configuration.
4a4d28b0d Qualify use of error_code.
e39a95a73 Fix boostify.pl to work with latest code.
2ccb648f4 Only obtain associated allocator when handler is known to be valid.
230c0d2ae Asynchronous accept should not check user-set non-blocking flag.
862aed305 Require gcc >= 4.7 to use standard atomics.
a0d28e5a7 Don't use auto_ptr.
15e136fa8 Use deregister_internal_descriptor in signal_set_service.
59330e825 Put detail/config.hpp include first in detail/string_view.hpp.
d6144828b Only enable string_view with /std:c++17 on MSVC.
c2cb5395e Use hook allocation strategy whenever associated allocator is std::allocator.
5b4aa5ef9 Make epoll_reactor resistant to events with duplicate user data.
47b9319ac Don't free the reactor's per-descriptor state until after close.
cbf687653 Fix compile errors in dev_poll_reactor.
870124ab5 Add missing 'else' in epoll_reactor's handler tracking support.
b37b9449e Clean up socket release() implementation for reactor-based platforms.
f5c570826 Add out_of_band_inline socket option.
7f849376c Expose the system_executor's execution context as system_context.
9f62b6791 Update io_context run* documentation.
ac89cf0ba Enable newer language features for recent MSVC versions.
64ae9bcae Add alias templates for associators.
e502a6b36 Use shorter enum name resolver_errc::try_again.
b3ebdd8f6 Use ADL for calls to buffer_size.
c516cd591 Fix non-dereferencing pointer overflow in basic_streambuf::commit.
b8a34a1dc Fix work counting issue in asynchronous resolver implementation.
48e7ef864 is_continuation misplaced in reactive socket service
5adce6e26 Use poll.h rather than sys/poll.h if possible.
ddef4994f Avoid exception throwing from `make_network_v{4,6}(str, ec)`
0442bc922 Disable Boost.Chrono's dependency on Boost.System.
6c5b04eff Conditionally enable iostream move constructor and assignment.
a3bba3394 Fix version check for string_view.
246f387e7 Fix compile error on gcc 4.8.
fd024792c Add -lrt when linking on linux.
0921ab3db Simplify automatic detection of boost source distributions.
6b34f88a5 Make SSL/TLS version handling more consistent across OpenSSL versions.
1517bd1a1 Add travis and appveyor configuration.
70249b796 Use GetModuleHandleA rather than GetModuleHandle.
582ed12f7 Update copyright notices.
b6ac42dde Remove unused error code variable.
d52f28a09 Add missing rvalue cast in use_future implementation.
b33b3ae01 Unlocked reactor I/O implies a concurrency hint of 1.
cf351c44a Don't use non-portable sockaddr_storage member ss_len.
bbe092b3d Simplify and improve performance of executor operations.
e5acea17d Add shallow-constness to strands.
00a85845e Eliminate redundant copy as executors are now shallow-const.

git-subtree-dir: OpenVPN Adapter/Vendors/asio
git-subtree-split: 82be891ba69c65be4c684d709d78a225da69c3c5
2018-05-03 12:28:44 +03:00

441 lines
12 KiB
Perl
Executable File

#!/usr/bin/perl -w
use strict;
use Cwd qw(abs_path getcwd);
use Date::Format;
use File::Path;
use File::Copy;
use File::Basename;
our $version_major;
our $version_minor;
our $version_sub_minor;
our $asio_name;
our $boost_asio_name;
sub print_usage_and_exit
{
print("usage: ./release.pl <version>\n");
print(" or: ./release.pl --package-asio\n");
print("\n");
print("examples:\n");
print(" create new version and build packages for asio and boost.asio:\n");
print(" ./release.pl 1.2.0\n");
print(" create packages for asio only:\n");
print(" ./release.pl --package-asio\n");
exit(1);
}
sub determine_version($)
{
my $version_string = shift;
if ($version_string =~ /^([0-9]+)\.([0-9]+)\.([0-9]+)$/)
{
our $version_major = $1;
our $version_minor = $2;
our $version_sub_minor = $3;
our $asio_name = "asio";
$asio_name .= "-$version_major";
$asio_name .= ".$version_minor";
$asio_name .= ".$version_sub_minor";
our $boost_asio_name = "boost_asio";
$boost_asio_name .= "_$version_major";
$boost_asio_name .= "_$version_minor";
$boost_asio_name .= "_$version_sub_minor";
}
else
{
print_usage_and_exit();
}
}
sub determine_version_from_configure()
{
my $from = "configure.ac";
open(my $input, "<$from") or die("Can't open $from for reading");
while (my $line = <$input>)
{
chomp($line);
if ($line =~ /^AC_INIT\(asio.*\[(.*)\]\)$/)
{
our $asio_name = "asio-$1";
our $boost_asio_name = "boost_asio_$1";
last;
}
}
}
sub update_configure_ac
{
# Open the files.
my $from = "configure.ac";
my $to = $from . ".tmp";
open(my $input, "<$from") or die("Can't open $from for reading");
open(my $output, ">$to") or die("Can't open $to for writing");
# Copy the content.
while (my $line = <$input>)
{
chomp($line);
if ($line =~ /^AC_INIT\(asio.*\)$/)
{
$line = "AC_INIT(asio, [";
$line .= "$version_major.$version_minor.$version_sub_minor";
$line .= "])";
}
print($output "$line\n");
}
# Close the files and move the temporary output into position.
close($input);
close($output);
move($to, $from);
unlink($to);
}
sub update_readme
{
# Open the files.
my $from = "README";
my $to = $from . ".tmp";
open(my $input, "<$from") or die("Can't open $from for reading");
open(my $output, ">$to") or die("Can't open $to for writing");
# Copy the content.
while (my $line = <$input>)
{
chomp($line);
if ($line =~ /^asio version/)
{
$line = "asio version ";
$line .= "$version_major.$version_minor.$version_sub_minor";
}
elsif ($line =~ /^Released/)
{
my @time = localtime;
$line = "Released " . strftime("%A, %d %B %Y", @time) . ".";
}
print($output "$line\n");
}
# Close the files and move the temporary output into position.
close($input);
close($output);
move($to, $from);
unlink($to);
}
sub update_asio_version_hpp
{
# Open the files.
my $from = "include/asio/version.hpp";
my $to = $from . ".tmp";
open(my $input, "<$from") or die("Can't open $from for reading");
open(my $output, ">$to") or die("Can't open $to for writing");
# Copy the content.
while (my $line = <$input>)
{
chomp($line);
if ($line =~ /^#define ASIO_VERSION /)
{
my $version = $version_major * 100000;
$version += $version_minor * 100;
$version += $version_sub_minor + 0;
$line = "#define ASIO_VERSION " . $version;
$line .= " // $version_major.$version_minor.$version_sub_minor";
}
print($output "$line\n");
}
# Close the files and move the temporary output into position.
close($input);
close($output);
move($to, $from);
unlink($to);
}
sub update_boost_asio_version_hpp
{
# Open the files.
my $from = "../boost/boost/asio/version.hpp";
my $to = $from . ".tmp";
open(my $input, "<$from") or die("Can't open $from for reading");
open(my $output, ">$to") or die("Can't open $to for writing");
# Copy the content.
while (my $line = <$input>)
{
chomp($line);
if ($line =~ /^#define BOOST_ASIO_VERSION /)
{
my $version = $version_major * 100000;
$version += $version_minor * 100;
$version += $version_sub_minor + 0;
$line = "#define BOOST_ASIO_VERSION " . $version;
$line .= " // $version_major.$version_minor.$version_sub_minor";
}
print($output "$line\n");
}
# Close the files and move the temporary output into position.
close($input);
close($output);
move($to, $from);
unlink($to);
}
sub build_asio_doc
{
$ENV{BOOST_ROOT} = abs_path("../boost");
system("rm -rf doc");
my $bjam = abs_path(glob("../boost/bjam"));
chdir("src/doc");
system("$bjam clean");
system("rm -rf html");
system("$bjam");
chdir("../..");
mkdir("doc");
system("cp -vR src/doc/html/* doc");
}
sub build_example_diffs
{
my @cpp11_files = `find src/examples/cpp11 -type f -name "*.*pp"`;
foreach my $cpp11_file (@cpp11_files)
{
chomp($cpp11_file);
my $cpp03_file = $cpp11_file;
$cpp03_file =~ s/\/cpp11\//\/cpp03\//;
my $output_diff = $cpp11_file;
$output_diff =~ s/src\/examples\/cpp11\///g;
my ($output_diff_name, $output_dir) = fileparse($output_diff);
my $output_html = $output_diff . ".html";
mkpath("doc/examples/diffs/$output_dir");
system("diff -U1000000 $cpp03_file $cpp11_file > doc/examples/diffs/$output_diff");
system("cd doc/examples/diffs && diff2html.py -i $output_diff -o $output_html");
unlink("doc/examples/diffs/$output_diff");
}
}
sub make_asio_packages
{
our $asio_name;
system("./autogen.sh");
system("./configure");
system("make dist");
system("tar tfz $asio_name.tar.gz | sed -e 's/^[^\\/]*//' | sort -df > asio.manifest");
}
sub build_boost_asio_doc
{
my $cwd = getcwd();
my $bjam = abs_path(glob("../boost/bjam"));
chdir("../boost/doc");
system("rm -rf html/boost_asio");
chdir("../libs/asio/doc");
system("$bjam clean");
system("$bjam asio");
chdir($cwd);
}
our $boost_asio_readme = <<"EOF";
Copy the `boost', `doc' and `libs' directories into an existing boost 1.33.0,
1.33.1, 1.34, 1.34.1, 1.35 or 1.36 distribution.
Before using Boost.Asio, the Boost.System library needs to be built. This can
be done by running bjam in the libs/system/build directory. Consult the Boost
Getting Started page (http://www.boost.org/more/getting_started.html) for more
information on how to build the Boost libraries.
EOF
our $boost_system_jamfile = <<"EOF";
# Boost System Library Build Jamfile
# (C) Copyright Beman Dawes 2002, 2006
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or www.boost.org/LICENSE_1_0.txt)
# See library home page at http://www.boost.org/libs/system
subproject libs/system/build ;
SOURCES = error_code ;
lib boost_system
: ../src/$(SOURCES).cpp
: # build requirements
<define>BOOST_SYSTEM_STATIC_LINK
<sysinclude>$(BOOST_AUX_ROOT) <sysinclude>$(BOOST_ROOT)
# common-variant-tag ensures that the library will
# be named according to the rules used by the install
# and auto-link features:
common-variant-tag
: debug release # build variants
;
dll boost_system
: ../src/$(SOURCES).cpp
: # build requirements
<define>BOOST_SYSTEM_DYN_LINK=1 # tell source we're building dll's
<runtime-link>dynamic # build only for dynamic runtimes
<sysinclude>$(BOOST_AUX_ROOT) <sysinclude>$(BOOST_ROOT)
# common-variant-tag ensures that the library will
# be named according to the rules used by the install
# and auto-link features:
common-variant-tag
: debug release # build variants
;
install system lib
: <lib>boost_system <dll>boost_system
;
stage stage/lib : <lib>boost_system <dll>boost_system
:
# copy to a path rooted at BOOST_ROOT:
<locate>$(BOOST_ROOT)
# make sure the names of the libraries are correctly named:
common-variant-tag
# add this target to the "stage" and "all" psuedo-targets:
<target>stage
<target>all
:
debug release
;
# end
EOF
sub create_boost_asio_content
{
# Create directory structure.
system("rm -rf $boost_asio_name");
mkdir("$boost_asio_name");
mkdir("$boost_asio_name/doc");
mkdir("$boost_asio_name/doc/html");
mkdir("$boost_asio_name/boost");
mkdir("$boost_asio_name/boost/config");
mkdir("$boost_asio_name/libs");
# Copy files.
system("cp -vLR ../boost/doc/html/boost_asio.html $boost_asio_name/doc/html");
system("cp -vLR ../boost/doc/html/boost_asio $boost_asio_name/doc/html");
system("cp -vLR ../boost/boost/asio.hpp $boost_asio_name/boost");
system("cp -vLR ../boost/boost/asio $boost_asio_name/boost");
system("cp -vLR ../boost/boost/cerrno.hpp $boost_asio_name/boost");
system("cp -vLR ../boost/boost/config/warning_disable.hpp $boost_asio_name/boost/config");
system("cp -vLR ../boost/boost/system $boost_asio_name/boost");
system("cp -vLR ../boost/libs/asio $boost_asio_name/libs");
system("cp -vLR ../boost/libs/system $boost_asio_name/libs");
# Remove modular boost include directories.
system("rm -rf $boost_asio_name/libs/asio/include");
system("rm -rf $boost_asio_name/libs/system/include");
# Add dummy definitions of BOOST_SYMBOL* to boost/system/config.hpp.
my $from = "$boost_asio_name/boost/system/config.hpp";
my $to = "$boost_asio_name/boost/system/config.hpp.new";
open(my $input, "<$from") or die("Can't open $from for reading");
open(my $output, ">$to") or die("Can't open $to for writing");
while (my $line = <$input>)
{
print($output $line);
if ($line =~ /<boost\/config\.hpp>/)
{
print($output "\n// These #defines added by the separate Boost.Asio package.\n");
print($output "#if !defined(BOOST_SYMBOL_IMPORT)\n");
print($output "# if defined(BOOST_HAS_DECLSPEC)\n");
print($output "# define BOOST_SYMBOL_IMPORT __declspec(dllimport)\n");
print($output "# else // defined(BOOST_HAS_DECLSPEC)\n");
print($output "# define BOOST_SYMBOL_IMPORT\n");
print($output "# endif // defined(BOOST_HAS_DECLSPEC)\n");
print($output "#endif // !defined(BOOST_SYMBOL_IMPORT)\n");
print($output "#if !defined(BOOST_SYMBOL_EXPORT)\n");
print($output "# if defined(BOOST_HAS_DECLSPEC)\n");
print($output "# define BOOST_SYMBOL_EXPORT __declspec(dllexport)\n");
print($output "# else // defined(BOOST_HAS_DECLSPEC)\n");
print($output "# define BOOST_SYMBOL_EXPORT\n");
print($output "# endif // defined(BOOST_HAS_DECLSPEC)\n");
print($output "#endif // !defined(BOOST_SYMBOL_EXPORT)\n");
print($output "#if !defined(BOOST_SYMBOL_VISIBLE)\n");
print($output "# define BOOST_SYMBOL_VISIBLE\n");
print($output "#endif // !defined(BOOST_SYMBOL_VISIBLE)\n\n");
}
}
close($input);
close($output);
system("mv $to $from");
# Create readme.
$to = "$boost_asio_name/README.txt";
open($output, ">$to") or die("Can't open $to for writing");
print($output $boost_asio_readme);
close($output);
# Create Boost.System Jamfile.
$to = "$boost_asio_name/libs/system/build/Jamfile";
open($output, ">$to") or die("Can't open $to for writing");
print($output $boost_system_jamfile);
close($output);
# Remove SVN and git files.
system("find $boost_asio_name -name .svn -exec rm -rf {} \\;");
system("find $boost_asio_name -name .git -exec rm -rf {} \\;");
system("find $boost_asio_name -name .gitignore -exec rm -rf {} \\;");
system("find $boost_asio_name -name .gitattributes -exec rm -rf {} \\;");
}
sub make_boost_asio_packages
{
our $boost_asio_name;
system("tar --format=ustar -chf - $boost_asio_name | gzip -c >$boost_asio_name.tar.gz");
system("tar --format=ustar -chf - $boost_asio_name | bzip2 -9 -c >$boost_asio_name.tar.bz2");
system("rm -f $boost_asio_name.zip");
system("zip -rq $boost_asio_name.zip $boost_asio_name");
system("rm -rf $boost_asio_name");
system("tar tfz $boost_asio_name.tar.gz | sed -e 's/^[^\\/]*//' | sort -df > boost_asio.manifest");
}
(scalar(@ARGV) == 1) or print_usage_and_exit();
my $new_version = 1;
my $package_asio = 1;
my $package_boost = 1;
if ($ARGV[0] eq "--package-asio")
{
$new_version = 0;
$package_boost = 0;
}
if ($new_version)
{
determine_version($ARGV[0]);
update_configure_ac();
update_readme();
update_asio_version_hpp();
update_boost_asio_version_hpp();
}
else
{
determine_version_from_configure();
}
if ($package_asio)
{
build_asio_doc();
build_example_diffs();
make_asio_packages();
}
if ($package_boost)
{
build_boost_asio_doc();
create_boost_asio_content();
make_boost_asio_packages();
}