Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Make it possible to build cpp-netlib using Boost.Build.
- Include '*~' pattern into .gitignore
- Build libraries in accordance with CMake script
- Build tests in accordance with CMake script
  • Loading branch information
tysonite committed Oct 7, 2012
commit 9a52e173943fa5d003031a9761ecb1edadb49c1a
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ libs/mime/test/mime-roundtrip
bin/
tests/
_build
*~
2 changes: 1 addition & 1 deletion Jamroot
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import os ;

local BOOST_ROOT = [ os.environ BOOST_ROOT ] ;
path-constant BOOST_ROOT : [ os.environ BOOST_ROOT ] ;

use-project /boost : $(BOOST_ROOT) ;
use-project /cpp-netlib : libs/network/build ;
Expand Down
68 changes: 58 additions & 10 deletions libs/network/build/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,75 @@
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)

import os ;

local BOOST_ROOT = [ os.environ BOOST_ROOT ] ;
import pch ;

project cpp-netlib :
requirements
<include>../../../
<variant>debug:<define>NETWORK_DEBUG
<toolset>gcc:<define>NETWORK_ENABLE_HTTPS
<toolset>gcc:<cxxflags>-std=c++0x
<include>../../../include
<include>$(BOOST_ROOT)
<c++-template-depth>256
<link>static
: source-location ../../../
;

cpp-pch client : boost/network/include/http/client.hpp ;
cpp-pch server : boost/network/include/http/server.hpp ;
lib cppnetlib-uri : libs/network/src/uri/parse.cpp ;
lib cppnetlib-server-parsers : libs/network/src/server_request_parsers_impl.cpp ;
lib cppnetlib-client-connections : libs/network/src/client.cpp ;
cpp-pch client : include/network/include/http/client.hpp ;
cpp-pch server : include/network/include/http/server.hpp ;
lib cppnetlib-uri : libs/network/src/uri/normalize.cpp
libs/network/src/uri/schemes.cpp
libs/network/src/uri/uri.cpp ;

lib cppnetlib-message : libs/network/src/message/message.cpp cppnetlib-uri ;
lib cppnetlib-message-directives : libs/network/src/message/directives.cpp ;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a few libraries that need to be built/installed as the header-only option is no longer supported. You may want to keep the others in here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I miss this. I will check CMake scripts in order to understand what is needed to be installed. However, could you please provide a real example of list of libraries which are needed to be provided for the end-user? For example, is it interesting to have cppnetlib-utils-thread_pool library to be installed?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A look at the CMake libraries would be good. If you can keep this in sync with the CMake stuff that would be better IMO.

Also, yes, cppnetlib-utils-thread_pool is required for the HTTP Server implementation (for the async server).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess, all needed libraries should install now. Please, take a look at commit below

lib cppnetlib-message-wrappers : libs/network/src/message/wrappers.cpp ;
lib cppnetlib-http-message : libs/network/src/http/request.cpp
libs/network/src/http/response.cpp
cppnetlib-message ;

lib cppnetlib-http-message-wrappers : libs/network/src/http/message/wrappers.cpp ;
lib cppnetlib-http-server-parsers : libs/network/src/server_request_parsers_impl.cpp ;
lib cppnetlib-http-server : libs/network/src/http/server_async_impl.cpp
libs/network/src/http/server_options.cpp
libs/network/src/http/server_socket_options_setter.cpp
libs/network/src/http/server_sync_impl.cpp
cppnetlib-constants
cppnetlib-uri
cppnetlib-message
cppnetlib-message-wrappers
cppnetlib-message-directives
cppnetlib-http-message
cppnetlib-http-message-wrappers
cppnetlib-http-server-parsers ;

lib cppnetlib-http-client-connections : libs/network/src/http/client_connections.cpp
libs/network/src/http/simple_connection_manager.cpp
libs/network/src/http/simple_connection_factory.cpp
libs/network/src/http/connection_delegate_factory.cpp
libs/network/src/http/client_resolver_delegate.cpp
libs/network/src/http/client_resolver_delegate_factory.cpp
libs/network/src/http/client_connection_delegates.cpp
libs/network/src/http/client_connection_factory.cpp
libs/network/src/http/client_async_resolver.cpp
libs/network/src/http/client_connection_normal.cpp ;

lib cppnetlib-http-client : libs/network/src/http/client.cpp
cppnetlib-constants
cppnetlib-uri
cppnetlib-message
cppnetlib-message-wrappers
cppnetlib-message-directives
cppnetlib-http-message
cppnetlib-http-message-wrappers
cppnetlib-http-client-connections ;

lib cppnetlib-utils-thread_pool : libs/network/src/utils/thread_pool.cpp ;
lib cppnetlib-constants : libs/network/src/constants.cpp ;

install headers : client server
: <location>../../../boost/network/include/http ;

install libraries : cppnetlib-uri cppnetlib-server-parsers cppnetlib-client-connections ;
install libraries : cppnetlib-uri ;

alias all : headers ;
25 changes: 15 additions & 10 deletions libs/network/test/Jamfile.v2
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

# Copyright Dean Michael Berris 2007.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
Expand All @@ -15,24 +15,23 @@ if [ os.name ] = CYGWIN

project network_test :
requirements
<include>../../../
<include>.
<include>../../../include
<source>/boost//unit_test_framework
<source>/boost//system
<source>/boost//date_time
<source>/boost//regex
<source>/boost//thread
<source>/boost//filesystem
<variant>debug:<define>BOOST_NETWORK_DEBUG
<toolset>gcc:<define>BOOST_NETWORK_ENABLE_HTTPS
<variant>debug:<define>NETWORK_DEBUG
<toolset>gcc:<define>NETWORK_ENABLE_HTTPS
<toolset>gcc:<linkflags>-lpthread
<toolset>gcc:<linkflags>-lssl
<toolset>gcc:<linkflags>-lcrypto
<toolset>darwin:<define>BOOST_NETWORK_ENABLE_HTTPS
<toolset>darwin:<define>NETWORK_ENABLE_HTTPS
<toolset>darwin:<linkflags>-lpthread
<toolset>darwin:<linkflags>-lssl
<toolset>darwin:<linkflags>-lcrypto
<toolset>clang:<define>BOOST_NETWORK_ENABLE_HTTPS
<toolset>clang:<define>NETWORK_ENABLE_HTTPS
<toolset>clang:<linkflags>-lpthread
<toolset>clang:<linkflags>-lssl
<toolset>clang:<linkflags>-lcrypto
Expand All @@ -43,13 +42,19 @@ project network_test :
<toolset>msvc:<define>BOOST_ASIO_NO_WIN32_LEAN_AND_MEAN
<toolset>msvc:<define>WIN32_LEAN_AND_MEAN
<toolset>msvc:<define>_SCL_SECURE_NO_WARNINGS
<toolset>msvc:<define>_WIN32_WINNT=0x0501
<toolset>msvc:<define>_WIN32_WINNT=0x0501
<c++-template-depth>256
<link>static
;

build-project http ;
build-project uri ;

run message_test.cpp ;
run message_transform_test.cpp ;
run message_test.cpp /cpp-netlib//cppnetlib-message
/cpp-netlib//cppnetlib-message-directives
/cpp-netlib//cppnetlib-message-wrappers ;

run message_transform_test.cpp /cpp-netlib//cppnetlib-message
/cpp-netlib//cppnetlib-message-directives
/cpp-netlib//cppnetlib-message-wrappers ;

139 changes: 114 additions & 25 deletions libs/network/test/http/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -10,40 +10,129 @@ import feature ;

project network_test/http :
requirements
<include>../../../../
<include>../
<variant>debug:<define>BOOST_NETWORK_DEBUG
<variant>debug:<define>NETWORK_DEBUG
<toolset>gcc:<cxxflags>-std=c++0x
;

run client_constructor_test.cpp /cpp-netlib//cppnetlib-uri /cpp-netlib//cppnetlib-client-connections ;
run client_get_test.cpp /cpp-netlib//cppnetlib-uri /cpp-netlib//cppnetlib-client-connections ;
run client_get_different_port_test.cpp /cpp-netlib//cppnetlib-uri /cpp-netlib//cppnetlib-client-connections ;
run client_get_timeout_test.cpp /cpp-netlib//cppnetlib-uri /cpp-netlib//cppnetlib-client-connections ;
#run client_include_inlined.cpp : <define>BOOST_NETWORK_NO_LIB ;
run client_localhost_normal_test.cpp /cpp-netlib//cppnetlib-uri /cpp-netlib//cppnetlib-client-connections ;
run client_localhost_ssl_test.cpp /cpp-netlib//cppnetlib-uri /cpp-netlib//cppnetlib-client-connections ;
run message_async_ready_test.cpp ;
run message_test.cpp /cpp-netlib//cppnetlib-uri ;
run request_incremental_parser_test.cpp ;
run request_linearize_test.cpp /cpp-netlib//cppnetlib-uri ;
run response_incremental_parser_test.cpp /cpp-netlib//cppnetlib-server-parsers ;
run server_constructor_test.cpp /cpp-netlib//cppnetlib-server-parsers ;
run request_base_test.cpp /cpp-netlib//cppnetlib-message
/cpp-netlib//cppnetlib-message-wrappers
/cpp-netlib//cppnetlib-http-message
/cpp-netlib//cppnetlib-http-message-wrappers
/cpp-netlib//cppnetlib-uri
/cpp-netlib//cppnetlib-constants ;

run request_test.cpp /cpp-netlib//cppnetlib-message
/cpp-netlib//cppnetlib-message-wrappers
/cpp-netlib//cppnetlib-http-message
/cpp-netlib//cppnetlib-http-message-wrappers
/cpp-netlib//cppnetlib-uri
/cpp-netlib//cppnetlib-constants ;

run request_linearize_test.cpp /cpp-netlib//cppnetlib-message
/cpp-netlib//cppnetlib-message-wrappers
/cpp-netlib//cppnetlib-http-message
/cpp-netlib//cppnetlib-http-message-wrappers
/cpp-netlib//cppnetlib-uri
/cpp-netlib//cppnetlib-constants ;

run response_test.cpp /cpp-netlib//cppnetlib-message
/cpp-netlib//cppnetlib-message-wrappers
/cpp-netlib//cppnetlib-http-message
/cpp-netlib//cppnetlib-http-message-wrappers
/cpp-netlib//cppnetlib-uri
/cpp-netlib//cppnetlib-constants ;

run client_constructor_test.cpp /cpp-netlib//cppnetlib-constants
/cpp-netlib//cppnetlib-uri
/cpp-netlib//cppnetlib-message
/cpp-netlib//cppnetlib-message-wrappers
/cpp-netlib//cppnetlib-message-directives
/cpp-netlib//cppnetlib-http-message
/cpp-netlib//cppnetlib-http-message-wrappers
/cpp-netlib//cppnetlib-http-client
/cpp-netlib//cppnetlib-http-client-connections ;

run client_get_test.cpp /cpp-netlib//cppnetlib-constants
/cpp-netlib//cppnetlib-uri
/cpp-netlib//cppnetlib-message
/cpp-netlib//cppnetlib-message-wrappers
/cpp-netlib//cppnetlib-message-directives
/cpp-netlib//cppnetlib-http-message
/cpp-netlib//cppnetlib-http-message-wrappers
/cpp-netlib//cppnetlib-http-client
/cpp-netlib//cppnetlib-http-client-connections ;

run client_get_different_port_test.cpp /cpp-netlib//cppnetlib-constants
/cpp-netlib//cppnetlib-uri
/cpp-netlib//cppnetlib-message
/cpp-netlib//cppnetlib-message-wrappers
/cpp-netlib//cppnetlib-message-directives
/cpp-netlib//cppnetlib-http-message
/cpp-netlib//cppnetlib-http-message-wrappers
/cpp-netlib//cppnetlib-http-client
/cpp-netlib//cppnetlib-http-client-connections ;

run client_get_timeout_test.cpp /cpp-netlib//cppnetlib-constants
/cpp-netlib//cppnetlib-uri
/cpp-netlib//cppnetlib-message
/cpp-netlib//cppnetlib-message-wrappers
/cpp-netlib//cppnetlib-message-directives
/cpp-netlib//cppnetlib-http-message
/cpp-netlib//cppnetlib-http-message-wrappers
/cpp-netlib//cppnetlib-http-client
/cpp-netlib//cppnetlib-http-client-connections ;

run client_get_streaming_test.cpp /cpp-netlib//cppnetlib-constants
/cpp-netlib//cppnetlib-uri
/cpp-netlib//cppnetlib-message
/cpp-netlib//cppnetlib-message-wrappers
/cpp-netlib//cppnetlib-message-directives
/cpp-netlib//cppnetlib-http-message
/cpp-netlib//cppnetlib-http-message-wrappers
/cpp-netlib//cppnetlib-http-client
/cpp-netlib//cppnetlib-http-client-connections ;

run server_constructor_test.cpp /cpp-netlib//cppnetlib-constants
/cpp-netlib//cppnetlib-uri
/cpp-netlib//cppnetlib-message
/cpp-netlib//cppnetlib-message-wrappers
/cpp-netlib//cppnetlib-http-message
/cpp-netlib//cppnetlib-http-server
/cpp-netlib//cppnetlib-http-server-parsers
/cpp-netlib//cppnetlib-utils-thread_pool ;

run server_async_run_stop_concurrency.cpp /cpp-netlib//cppnetlib-constants
/cpp-netlib//cppnetlib-uri
/cpp-netlib//cppnetlib-message
/cpp-netlib//cppnetlib-message-wrappers
/cpp-netlib//cppnetlib-http-message
/cpp-netlib//cppnetlib-http-server
/cpp-netlib//cppnetlib-http-server-parsers
/cpp-netlib//cppnetlib-utils-thread_pool ;

#run client_localhost_normal_test.cpp /cpp-netlib//cppnetlib-uri /cpp-netlib//cppnetlib-http-client-connections ;
#run client_localhost_ssl_test.cpp /cpp-netlib//cppnetlib-uri /cpp-netlib//cppnetlib-http-client-connections ;
#run message_async_ready_test.cpp ;
#run message_test.cpp /cpp-netlib//cppnetlib-uri ;
#run request_incremental_parser_test.cpp ;
#run request_linearize_test.cpp /cpp-netlib//cppnetlib-uri ;
#run response_incremental_parser_test.cpp /cpp-netlib//cppnetlib-http-server-parsers ;
#run server_constructor_test.cpp /cpp-netlib//cppnetlib-http-server-parsers ;
#run server_include_inlined.cpp : <define>BOOST_NETWORK_NO_LIB ;

exe http_async_server : server_async.cpp /cpp-netlib//cppnetlib-server-parsers ;
exe hello_world : server_hello_world.cpp /cpp-netlib//cppnetlib-server-parsers ;
exe http_async_less_copy_server : server_async_less_copy.cpp /cpp-netlib//cppnetlib-server-parsers ;
exe http_async_run_stop_concurrency_server : server_async_run_stop_concurrency.cpp /cpp-netlib//cppnetlib-server-parsers ;
#exe http_async_server : server_async.cpp /cpp-netlib//cppnetlib-http-server-parsers ;
#exe hello_world : server_hello_world.cpp /cpp-netlib//cppnetlib-http-server-parsers ;
#exe http_async_less_copy_server : server_async_less_copy.cpp /cpp-netlib//cppnetlib-http-server-parsers ;
#exe http_async_run_stop_concurrency_server : server_async_run_stop_concurrency.cpp /cpp-netlib//cppnetlib-http-server-parsers ;

make httplib_acceptance.passed : ../httplib_acceptance.py hello_world : @httplib_acceptance ;
make httplib_async_acceptance.passed : ../httplib_acceptance.py http_async_server : @httplib_acceptance ;
make httplib_async_less_copy_acceptance.passed : ../httplib_acceptance.py http_async_less_copy_server : @httplib_acceptance ;
make httplib_async_run_stop_concurrency_acceptance.passed : ../httplib_acceptance.py http_async_run_stop_concurrency_server : @httplib_acceptance ;
#make httplib_acceptance.passed : ../httplib_acceptance.py hello_world : @httplib_acceptance ;
#make httplib_async_acceptance.passed : ../httplib_acceptance.py http_async_server : @httplib_acceptance ;
#make httplib_async_less_copy_acceptance.passed : ../httplib_acceptance.py http_async_less_copy_server : @httplib_acceptance ;
#make httplib_async_run_stop_concurrency_acceptance.passed : ../httplib_acceptance.py http_async_run_stop_concurrency_server : @httplib_acceptance ;

actions httplib_acceptance {
export TEST_SCRIPT=`echo "$(>)" | awk '{print $1}'`
export EXECUTABLE=`echo "$(>)" | awk '{print $2}'`
export PORT=`echo "import random; print random.randint(8000, 8010)" | python`
python $TEST_SCRIPT $EXECUTABLE $PORT $(<)
}

10 changes: 7 additions & 3 deletions libs/network/test/uri/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ project network_test/uri :
requirements
<include>../../../../
<include>../
<toolset>gcc:<cxxflags>-std=c++0x
;

run url_test.cpp /cpp-netlib//cppnetlib-uri ;
run url_builder_test.cpp /cpp-netlib//cppnetlib-uri ;
run url_encoding_test.cpp /cpp-netlib//cppnetlib-uri ;
run uri_test.cpp /cpp-netlib//cppnetlib-uri ;
run uri_builder_test.cpp /cpp-netlib//cppnetlib-uri ;
run uri_builder_stream_test.cpp /cpp-netlib//cppnetlib-uri ;
run uri_encoding_test.cpp /cpp-netlib//cppnetlib-uri ;
run relative_uri_test.cpp /cpp-netlib//cppnetlib-uri ;
run scheme_tests.cpp /cpp-netlib//cppnetlib-uri ;