1 # This Jamfile requires boost-build v2 to build.
2 # The version shipped with boost 1.34.0
7 import feature : feature ;
9 BOOST_ROOT = [ modules.peek : BOOST_ROOT ] ;
10 CXXFLAGS = [ modules.peek : CXXFLAGS ] ;
11 LDFLAGS = [ modules.peek : LDFLAGS ] ;
13 ECHO "BOOST_ROOT =" $(BOOST_ROOT) ;
14 ECHO "OS =" [ os.name ] ;
18 use-project /boost : $(BOOST_ROOT) ;
21 # rule for linking the correct libraries depending
22 # on features and target-os
23 rule linking ( properties * )
27 # openssl libraries, if enabled
28 if <openssl>sha-1 in $(properties)
29 || <openssl>pe in $(properties)
31 # exclude gcc from a regular windows build to make mingw
32 # link against the regular unix library name
34 if <target-os>windows in $(properties)
36 result += <library>gdi32 ;
39 if <target-os>windows in $(properties) && ! <toolset>gcc in $(properties)
41 result += <library>ssleay32
50 result += <library>crypto <library>ssl ;
54 if <geoip>shared in $(properties)
56 result += <library>GeoIP ;
59 # socket functions on windows require winsock libraries
60 if <target-os>windows in $(properties)
61 || <target-os>cygwin in $(properties)
63 result += <library>ws2_32
65 <define>WIN32_LEAN_AND_MEAN
66 <define>_WIN32_WINNT=0x0500
67 <define>__USE_W32_SOCKETS
73 if <test-coverage>on in $(properties)
74 && ( <toolset>gcc in $(properties)
75 || <toolset>darwin in $(properties) )
77 result += <cxxflags>-fprofile-arcs <cxxflags>-ftest-coverage
78 <linkflags>-lgcov <define>NDEBUG ;
81 # clock_gettime on linux requires librt
82 if <need-librt>yes in $(properties)
84 result += <library>librt ;
87 if <tcmalloc>yes in $(properties)
89 result += <library>tcmalloc ;
92 if <boost>system in $(properties)
94 result += <library>boost_filesystem
96 <library>boost_iostreams
101 if <toolset>gcc in $(properties)
102 && <target-os>linux in $(properties)
103 && <variant>debug in $(properties)
105 # for backtraces in assertion failures
106 # which only works on ELF targets with gcc
107 result += <linkflags>-export-dynamic <cxxflags>-rdynamic ;
110 if <boost>source in $(properties)
112 if <boost-link>static in $(properties)
114 result += <library>/boost/thread//boost_thread/<link>static
115 <library>/boost/filesystem//boost_filesystem/<link>static
116 <library>/boost/iostreams//boost_iostreams/<link>static
117 <library>/boost/system//boost_system/<link>static
118 <include>$(BOOST_ROOT)
119 <define>BOOST_ALL_NO_LIB
124 result += <library>/boost/thread//boost_thread/<link>shared
125 <library>/boost/filesystem//boost_filesystem/<link>shared
126 <library>/boost/iostreams//boost_iostreams/<link>shared
127 <library>/boost/system//boost_system/<link>shared
128 <include>$(BOOST_ROOT)
129 <define>BOOST_ALL_NO_LIB
134 if <boost>system in $(properties)
136 # on mac the boost headers are installed in
137 # a directory that isn't automatically accessable
138 result += <include>/opt/local/include/boost-1_35
139 <include>/opt/local/include/boost
146 # rule for adding the right source files
147 # depending on target-os and features
148 rule building ( properties * )
152 if ( <target-os>linux in $(properties)
153 || <target-os>darwin in $(properties) )
154 && ( <toolset>gcc in $(properties)
155 || <toolset>darwin in $(properties) )
157 result += <source>src/assert.cpp ;
160 if <geoip>static in $(properties)
162 result += <source>src/GeoIP.c ;
165 if <openssl>off in $(properties)
167 result += <source>src/sha1.cpp ;
171 if <openssl>pe in $(properties)
173 result += <source>src/pe_crypto.cpp ;
177 if <memdebug>on in $(properties)
179 result += <source>src/memdebug.cpp ;
185 feature tcmalloc : no yes : composite propagated link-incompatible ;
187 feature need-librt : no yes : composite propagated link-incompatible ;
189 feature pool-allocators : on off : composite propagated link-incompatible ;
190 feature.compose <pool-allocators>off : <define>TORRENT_DISABLE_POOL_ALLOCATOR ;
192 feature geoip : off static shared : composite propagated link-incompatible ;
193 feature.compose <geoip>off : <define>TORRENT_DISABLE_GEO_IP ;
195 feature bandwidth-limit-logging : off on : composite propagated link-incompatible ;
196 feature.compose <bandwidth-limit-logging>on : <define>TORRENT_VERBOSE_BANDWIDTH_LIMIT ;
198 feature invariant-checks : on off full : composite propagated link-incompatible ;
199 feature.compose <invariant-checks>off : <define>TORRENT_DISABLE_INVARIANT_CHECKS ;
200 feature.compose <invariant-checks>full : <define>TORRENT_EXPENSIVE_INVARIANT_CHECKS ;
202 feature disk-stats : off on : composite propagated link-incompatible ;
203 feature.compose <disk-stats>on : <define>TORRENT_DISK_STATS ;
205 feature memdebug : off on : composite propagated ;
206 feature.compose <memdebug>on : <define>TORRENT_MEMDEBUG ;
208 feature logging : none default errors verbose : composite propagated link-incompatible ;
209 feature.compose <logging>default : <define>TORRENT_LOGGING ;
210 feature.compose <logging>errors : <define>TORRENT_ERROR_LOGGING ;
211 feature.compose <logging>verbose : <define>TORRENT_VERBOSE_LOGGING ;
213 feature dht-support : on off logging : composite propagated link-incompatible ;
214 feature.compose <dht-support>off : <define>TORRENT_DISABLE_DHT ;
215 feature.compose <dht-support>logging : <define>TORRENT_DHT_VERBOSE_LOGGING ;
217 feature openssl : pe sha-1 off : composite propagated link-incompatible ;
218 feature.compose <openssl>pe : <define>TORRENT_USE_OPENSSL ;
219 feature.compose <openssl>sha-1 : <define>TORRENT_USE_OPENSSL <define>TORRENT_DISABLE_ENCRYPTION ;
220 feature.compose <openssl>off : <define>TORRENT_DISABLE_ENCRYPTION ;
222 feature resolve-countries : on off : composite propagated link-incompatible ;
223 feature.compose <resolve-countries>off : <define>TORRENT_DISABLE_RESOLVE_COUNTRIES ;
225 feature character-set : unicode ansi : composite propagated link-incompatible ;
226 feature.compose <character-set>unicode : <define>_UNICODE <define>UNICODE ;
228 feature zlib : shipped system : composite propagated link-incompatible ;
230 feature deprecated-functions : on off : composite propagated link-incompatible ;
231 feature.compose <deprecated-functions>off : <define>TORRENT_NO_DEPRECATE ;
233 feature statistics : off on : composite propagated link-incompatible ;
234 feature.compose <statistics>on : <define>TORRENT_STATS ;
236 feature upnp-logging : off on : composite propagated link-incompatible ;
237 feature.compose <upnp-logging>on : <define>TORRENT_UPNP_LOGGING ;
239 feature boost : system source : link-incompatible propagated ;
240 feature boost-link : static shared : composite ;
242 feature debug-iterators : off on : composite propagated link-incompatible ;
243 feature.compose <debug-iterators>on : <define>_SCL_SECURE=1 <define>_GLIBCXX_DEBUG ;
245 feature test-coverage : off on : composite propagated ;
247 # required for openssl on windows
248 lib ssleay32 : : <name>ssleay32 ;
249 lib libeay32 : : <name>libeay32 ;
250 lib advapi32 : : <name>Advapi32 ;
251 lib user32 : : <name>User32 ;
252 lib shell32 : : <name>shell32 ;
253 lib gdi32 : : <name>gdi32 ;
255 local library-search-path = <search>/opt/local/lib <search>/usr/lib <search>/usr/local/lib <search>/sw/lib ;
257 lib boost_filesystem : : <name>boost_filesystem $(library-search-path) ;
258 lib boost_thread : : <name>boost_thread $(library-search-path) ;
259 lib boost_iostreams : : <name>boost_iostreams $(library-search-path) ;
260 lib boost_system : : <name>boost_system $(library-search-path) ;
262 # openssl on linux/bsd/macos etc.
263 lib crypto : : <name>crypto ;
264 lib ssl : : <name>ssl ;
266 # time functions used on linux require librt
267 lib librt : : <name>rt ;
269 lib tcmalloc : : <name>tcmalloc $(library-search-path) ;
272 lib zlib-target : : <name>z ;
274 # socket libraries on windows
275 lib wsock32 : : <name>wsock32 ;
276 lib ws2_32 : : <name>ws2_32 ;
299 instantiate_connection
314 http_tracker_connection
315 udp_tracker_connection
336 kademlia/closest_nodes
343 kademlia/routing_table
344 kademlia/traversal_algorithm
362 local usage-requirements =
364 <include>./include/libtorrent
365 <zlib>shipped:<include>./zlib
366 <variant>release:<define>NDEBUG
367 <define>_FILE_OFFSET_BITS=64
368 <define>BOOST_MULTI_INDEX_DISABLE_SERIALIZATION
369 <conditional>@linking
370 <zlib>system:<library>zlib-target
371 # these compiler settings just makes the compiler standard conforming
372 <toolset>msvc:<cxxflags>/Zc:wchar_t
373 <toolset>msvc:<cxxflags>/Zc:forScope
374 # disable bogus deprecation warnings on msvc8
375 <toolset>msvc:<define>_SCL_SECURE_NO_DEPRECATE
376 <toolset>msvc:<define>_CRT_SECURE_NO_DEPRECATE
378 <toolset>msvc,<variant>release:<linkflags>/OPT:ICF=5
379 <toolset>msvc,<variant>release:<linkflags>/OPT:REF
380 # disable warning C4503: decorated name length exceeded, name was truncated
381 <toolset>msvc:<cxxflags>/wd4503
382 # disable some warnings for gcc
383 <toolset>gcc:<cxxflags>-fno-strict-aliasing
384 <toolset>gcc:<cxxflags>-Wno-missing-braces
385 <boost>system:<cxxflags>$(CXXFLAGS)
386 <boost>system:<linkflags>$(LDFLAGS)
397 <define>BOOST_THREAD_USE_LIB
399 <link>shared:<define>TORRENT_BUILDING_SHARED
400 <dht-support>on:<source>src/$(KADEMLIA_SOURCES).cpp
401 <dht-support>logging:<source>src/$(KADEMLIA_SOURCES).cpp
402 <zlib>shipped:<source>zlib/$(ZLIB_SOURCES).c
403 <conditional>@building
404 <boost>system:<cxxflags>$(CXXFLAGS)
405 $(usage-requirements)
410 : # usage requirements
411 $(usage-requirements)