From 9f24c6d79c1d9692f8d02d416b1103193cdfabbf Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sat, 7 Jul 2007 21:27:36 +0000 Subject: [PATCH] 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 --- Jamfile | 33 ++++++++++++++++++++++++--------- examples/Jamfile | 17 +++++++++++++++-- 2 files changed, 39 insertions(+), 11 deletions(-) diff --git a/Jamfile b/Jamfile index d96e9e190..4dc25ae1b 100755 --- a/Jamfile +++ b/Jamfile @@ -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 += rt ; } + if system in $(properties) + { + result += filesystem + thread + ; + } + + if source in $(properties) + { + result += /boost/thread//boost_thread + /boost/filesystem//boost_filesystem + $(BOOST_ROOT) + BOOST_ALL_NO_LIB + ; + } + return $(result) ; } @@ -126,6 +139,8 @@ feature.compose on : TORRENT_STATS ; feature upnp-logging : off on : composite propagated link-incompatible ; feature.compose on : TORRENT_UPNP_LOGGING ; +feature boost : system source : link-incompatible propagated ; + # required for openssl on windows lib ssleay32 : : ssleay32 ; lib libeay32 : : libeay32 ; @@ -134,6 +149,9 @@ lib user32 : : User32 ; lib shell32 : : shell32 ; lib gdi32 : : gdi32 ; +lib filesystem : : boost_filesystem ; +lib thread : : boost_thread ; + # openssl on linux/bsd/macos etc. lib crypto : : crypto ; @@ -217,12 +235,9 @@ local usage-requirements = ./include ./include/libtorrent shipped:./zlib - $(BOOST_ROOT) release:NDEBUG - BOOST_ALL_NO_LIB _FILE_OFFSET_BITS=64 - /boost/thread//boost_thread #/static - /boost/filesystem//boost_filesystem #/static + BOOST_MULTI_INDEX_DISABLE_SERIALIZATION @linking system:zlib-target # these compiler settings just makes the compiler standard conforming diff --git a/examples/Jamfile b/examples/Jamfile index aaed10c18..8fa40712d 100644 --- a/examples/Jamfile +++ b/examples/Jamfile @@ -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 : : boost_program_options ; +lib regex : : boost_regex ; project client_test : requirements @@ -12,7 +19,13 @@ project client_test static ; -exe client_test : client_test.cpp /boost/program_options /boost/regex ; +exe client_test : client_test.cpp + : source:/boost/program_options + source:/boost/regex + system:program-options + system:regex + ; + exe simple_client : simple_client.cpp ; exe dump_torrent : dump_torrent.cpp ; exe make_torrent : make_torrent.cpp ;