added option to link against installed boost libraries instead of building from source (boost=system and boost=source, system is default). Removed dependency in boost serialization headers

This commit is contained in:
Arvid Norberg 2007-07-07 21:27:36 +00:00
parent a46ef3ece8
commit 9f24c6d79c
2 changed files with 39 additions and 11 deletions

33
Jamfile
View File

@ -11,14 +11,11 @@ BOOST_ROOT = [ modules.peek : BOOST_ROOT ] ;
ECHO "BOOST_ROOT =" $(BOOST_ROOT) ;
ECHO "OS =" [ os.name ] ;
if ! $(BOOST_ROOT)
if $(BOOST_ROOT)
{
errors.user-error
"BOOST_ROOT must be set to your boost installation path." ;
use-project /boost : $(BOOST_ROOT) ;
}
use-project /boost : $(BOOST_ROOT) ;
# rule for linking the correct libraries depending
# on features and target-os
rule linking ( properties * )
@ -64,6 +61,22 @@ rule linking ( properties * )
# result += <library>rt ;
}
if <boost>system in $(properties)
{
result += <library>filesystem
<library>thread
;
}
if <boost>source in $(properties)
{
result += <library>/boost/thread//boost_thread
<library>/boost/filesystem//boost_filesystem
<include>$(BOOST_ROOT)
<define>BOOST_ALL_NO_LIB
;
}
return $(result) ;
}
@ -126,6 +139,8 @@ feature.compose <statistics>on : <define>TORRENT_STATS ;
feature upnp-logging : off on : composite propagated link-incompatible ;
feature.compose <upnp-logging>on : <define>TORRENT_UPNP_LOGGING ;
feature boost : system source : link-incompatible propagated ;
# required for openssl on windows
lib ssleay32 : : <name>ssleay32 ;
lib libeay32 : : <name>libeay32 ;
@ -134,6 +149,9 @@ lib user32 : : <name>User32 ;
lib shell32 : : <name>shell32 ;
lib gdi32 : : <name>gdi32 ;
lib filesystem : : <name>boost_filesystem ;
lib thread : : <name>boost_thread ;
# openssl on linux/bsd/macos etc.
lib crypto : : <name>crypto ;
@ -217,12 +235,9 @@ local usage-requirements =
<include>./include
<include>./include/libtorrent
<zlib>shipped:<include>./zlib
<include>$(BOOST_ROOT)
<variant>release:<define>NDEBUG
<define>BOOST_ALL_NO_LIB
<define>_FILE_OFFSET_BITS=64
<library>/boost/thread//boost_thread #/<link>static
<library>/boost/filesystem//boost_filesystem #/<link>static
<define>BOOST_MULTI_INDEX_DISABLE_SERIALIZATION
<conditional>@linking
<zlib>system:<library>zlib-target
# these compiler settings just makes the compiler standard conforming

View File

@ -3,7 +3,14 @@ import modules ;
BOOST_ROOT = [ modules.peek : BOOST_ROOT ] ;
use-project /torrent : .. ;
use-project /boost : $(BOOST_ROOT) ;
if $(BOOST_ROOT)
{
use-project /boost : $(BOOST_ROOT) ;
}
lib program-options : : <name>boost_program_options ;
lib regex : : <name>boost_regex ;
project client_test
: requirements
@ -12,7 +19,13 @@ project client_test
<link>static
;
exe client_test : client_test.cpp /boost/program_options /boost/regex ;
exe client_test : client_test.cpp
: <boost>source:<library>/boost/program_options
<boost>source:<library>/boost/regex
<boost>system:<library>program-options
<boost>system:<library>regex
;
exe simple_client : simple_client.cpp ;
exe dump_torrent : dump_torrent.cpp ;
exe make_torrent : make_torrent.cpp ;