premiere-libtorrent/Jamfile

445 lines
11 KiB
Plaintext
Raw Normal View History

# This Jamfile requires boost-build v2 to build.
# The version shipped with boost 1.34.0
2004-02-18 01:08:20 +01:00
2004-02-04 21:20:53 +01:00
import modules ;
2004-02-21 12:52:21 +01:00
import os ;
2005-01-11 03:13:07 +01:00
import errors ;
import feature : feature ;
2004-02-04 21:20:53 +01:00
BOOST_ROOT = [ modules.peek : BOOST_ROOT ] ;
CXXFLAGS = [ modules.peek : CXXFLAGS ] ;
LDFLAGS = [ modules.peek : LDFLAGS ] ;
2004-02-04 21:20:53 +01:00
2004-07-25 23:44:53 +02:00
ECHO "BOOST_ROOT =" $(BOOST_ROOT) ;
ECHO "OS =" [ os.name ] ;
if $(BOOST_ROOT)
2005-01-11 03:13:07 +01:00
{
use-project /boost : $(BOOST_ROOT) ;
2005-01-11 03:13:07 +01:00
}
# rule for linking the correct libraries depending
# on features and target-os
rule linking ( properties * )
{
local result ;
# openssl libraries, if enabled
if <openssl>sha-1 in $(properties)
|| <openssl>pe in $(properties)
{
2007-09-10 09:51:58 +02:00
# exclude gcc from a regular windows build to make mingw
# link against the regular unix library name
if <target-os>windows in $(properties)
{
result += <library>gdi32 ;
}
2007-09-10 09:51:58 +02:00
if <target-os>windows in $(properties) && ! <toolset>gcc in $(properties)
{
result += <library>ssleay32
<library>libeay32
<library>advapi32
<library>user32
<library>shell32
;
}
else
{
result += <library>crypto <library>ssl ;
}
}
if <geoip>shared in $(properties)
{
result += <library>GeoIP ;
}
# socket functions on windows require winsock libraries
if <target-os>windows in $(properties)
|| <target-os>cygwin in $(properties)
{
result += <library>ws2_32
<library>wsock32
<define>WIN32_LEAN_AND_MEAN
<define>_WIN32_WINNT=0x0500
<define>__USE_W32_SOCKETS
<define>WIN32
<define>_WIN32
;
}
if <test-coverage>on in $(properties)
&& ( <toolset>gcc in $(properties)
|| <toolset>darwin in $(properties) )
{
result += <cxxflags>-fprofile-arcs <cxxflags>-ftest-coverage
<linkflags>-lgcov <define>NDEBUG ;
}
# clock_gettime on linux requires librt
if <need-librt>yes in $(properties)
{
result += <library>librt ;
}
if <tcmalloc>yes in $(properties)
{
result += <library>tcmalloc ;
}
if <boost>system in $(properties)
{
2007-11-30 01:35:09 +01:00
result += <library>boost_filesystem
<library>boost_thread
2008-05-15 18:58:32 +02:00
<library>boost_system
;
}
if <toolset>gcc in $(properties)
&& <target-os>linux in $(properties)
&& <variant>debug in $(properties)
{
# for backtraces in assertion failures
# which only works on ELF targets with gcc
2007-09-01 06:08:39 +02:00
result += <linkflags>-export-dynamic <cxxflags>-rdynamic ;
}
if <boost>source in $(properties)
{
if <boost-link>static in $(properties)
{
2008-12-21 03:38:37 +01:00
if <toolset>gcc in $(properties) && <link>shared in $(properties)
{
result += <fpic>on ;
}
result += <library>/boost/filesystem//boost_filesystem/<link>static
<library>/boost/system//boost_system/<link>static
;
2008-12-21 03:38:37 +01:00
# if we're building a shared library
# we need to link dynamically against the
# pthread library
if <fpic>on in $(properties) && <target-os>linux in $(properties)
{
result += <library>/boost/thread//boost_thread/<link>shared ;
}
else
{
result += <library>/boost/thread//boost_thread/<link>static ;
}
}
else
{
result += <library>/boost/thread//boost_thread/<link>shared
<library>/boost/filesystem//boost_filesystem/<link>shared
<library>/boost/system//boost_system/<link>shared ;
}
result += <include>$(BOOST_ROOT) <define>BOOST_ALL_NO_LIB ;
}
2008-06-07 19:36:33 +02:00
if <boost>system in $(properties)
{
# on mac the boost headers are installed in
# a directory that isn't automatically accessable
result += <include>/opt/local/include/boost-1_35
<include>/opt/local/include/boost
;
}
return $(result) ;
}
# rule for adding the right source files
# depending on target-os and features
rule building ( properties * )
{
local result ;
if ( <target-os>linux in $(properties)
|| <target-os>darwin in $(properties) )
&& ( <toolset>gcc in $(properties)
|| <toolset>darwin in $(properties) )
2007-09-01 06:08:39 +02:00
{
result += <source>src/assert.cpp ;
}
if <geoip>static in $(properties)
{
result += <source>src/GeoIP.c ;
}
if <openssl>off in $(properties)
{
result += <source>src/sha1.cpp ;
}
else
{
if <openssl>pe in $(properties)
{
result += <source>src/pe_crypto.cpp ;
}
if <target-os>linux in $(properties)
{
# linker library on linux, required when using openssl
result += <source>/usr/lib/libdl.so ;
}
}
if <memdebug>on in $(properties)
{
result += <source>src/memdebug.cpp ;
}
return $(result) ;
}
2004-03-17 13:14:44 +01:00
feature tcmalloc : no yes : composite propagated link-incompatible ;
feature need-librt : no yes : composite propagated link-incompatible ;
2008-04-09 07:36:37 +02:00
feature pool-allocators : on off : composite propagated link-incompatible ;
feature.compose <pool-allocators>off : <define>TORRENT_DISABLE_POOL_ALLOCATOR ;
feature geoip : off static shared : composite propagated link-incompatible ;
feature.compose <geoip>off : <define>TORRENT_DISABLE_GEO_IP ;
feature bandwidth-limit-logging : off on : composite propagated link-incompatible ;
feature.compose <bandwidth-limit-logging>on : <define>TORRENT_VERBOSE_BANDWIDTH_LIMIT ;
feature invariant-checks : on off full : composite propagated link-incompatible ;
feature.compose <invariant-checks>off : <define>TORRENT_DISABLE_INVARIANT_CHECKS ;
feature.compose <invariant-checks>full : <define>TORRENT_EXPENSIVE_INVARIANT_CHECKS ;
feature disk-stats : off on : composite propagated link-incompatible ;
feature.compose <disk-stats>on : <define>TORRENT_DISK_STATS ;
feature memdebug : off on : composite propagated ;
feature.compose <memdebug>on : <define>TORRENT_MEMDEBUG ;
feature logging : none default errors verbose : composite propagated link-incompatible ;
feature.compose <logging>default : <define>TORRENT_LOGGING ;
2008-02-17 22:37:20 +01:00
feature.compose <logging>errors : <define>TORRENT_ERROR_LOGGING ;
feature.compose <logging>verbose : <define>TORRENT_VERBOSE_LOGGING ;
2004-11-01 00:16:08 +01:00
feature dht-support : on off logging : composite propagated link-incompatible ;
feature.compose <dht-support>off : <define>TORRENT_DISABLE_DHT ;
feature.compose <dht-support>logging : <define>TORRENT_DHT_VERBOSE_LOGGING ;
2004-02-04 12:00:29 +01:00
feature openssl : pe sha-1 off : composite propagated link-incompatible ;
feature.compose <openssl>pe : <define>TORRENT_USE_OPENSSL ;
feature.compose <openssl>sha-1 : <define>TORRENT_USE_OPENSSL <define>TORRENT_DISABLE_ENCRYPTION ;
feature.compose <openssl>off : <define>TORRENT_DISABLE_ENCRYPTION ;
feature resolve-countries : on off : composite propagated link-incompatible ;
feature.compose <resolve-countries>off : <define>TORRENT_DISABLE_RESOLVE_COUNTRIES ;
2008-07-20 13:53:21 +02:00
feature character-set : unicode ansi : composite propagated link-incompatible ;
feature.compose <character-set>unicode : <define>_UNICODE <define>UNICODE ;
feature zlib : shipped system : composite propagated link-incompatible ;
2007-06-06 02:41:20 +02:00
feature deprecated-functions : on off : composite propagated link-incompatible ;
feature.compose <deprecated-functions>off : <define>TORRENT_NO_DEPRECATE ;
feature statistics : off on : composite propagated link-incompatible ;
feature.compose <statistics>on : <define>TORRENT_STATS ;
2007-05-14 09:31:01 +02:00
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 ;
feature boost-link : static shared : composite ;
feature debug-iterators : off on : composite propagated link-incompatible ;
feature.compose <debug-iterators>on : <define>_SCL_SECURE=1 <define>_GLIBCXX_DEBUG ;
feature test-coverage : off on : composite propagated ;
feature fpic : off on : composite propagated link-incompatible ;
feature.compose <fpic>on : <cflags>-fPIC ;
2008-12-21 03:38:37 +01:00
feature.compose <fpic>off : <toolset>darwin:<cflags>-mdynamic-no-pic ;
feature visibility : default hidden : composite propagated link-incompatible ;
feature.compose <visibility>hidden : <cflags>-fvisibility=hidden ;
# required for openssl on windows
lib ssleay32 : : <name>ssleay32 ;
lib libeay32 : : <name>libeay32 ;
lib advapi32 : : <name>Advapi32 ;
lib user32 : : <name>User32 ;
lib shell32 : : <name>shell32 ;
lib gdi32 : : <name>gdi32 ;
local library-search-path = <search>/opt/local/lib <search>/usr/lib <search>/usr/local/lib <search>/sw/lib ;
lib boost_filesystem : : <name>boost_filesystem $(library-search-path) ;
lib boost_thread : : <name>boost_thread $(library-search-path) ;
2008-06-07 19:36:33 +02:00
lib boost_system : : <name>boost_system $(library-search-path) ;
# openssl on linux/bsd/macos etc.
lib crypto : : <name>crypto ;
lib ssl : : <name>ssl ;
# time functions used on linux require librt
lib librt : : <name>rt ;
lib tcmalloc : : <name>tcmalloc $(library-search-path) ;
# libz
lib zlib-target : : <name>z ;
2008-11-23 21:40:08 +01:00
# GeoIP shared library
lib GeoIP : : <name>GeoIP ;
# socket libraries on windows
lib wsock32 : : <name>wsock32 ;
lib ws2_32 : : <name>ws2_32 ;
SOURCES =
alert
assert
connection_queue
create_torrent
disk_buffer_holder
entry
error_code
file_storage
2008-04-11 05:41:09 +02:00
lazy_bdecode
escape_string
file
gzip
http_connection
http_stream
2008-01-12 10:36:03 +01:00
http_parser
identify_client
ip_filter
peer_connection
bt_peer_connection
web_peer_connection
2008-12-30 04:54:07 +01:00
http_seed_connection
instantiate_connection
natpmp
piece_picker
policy
session
session_impl
2007-05-31 01:35:14 +02:00
socks4_stream
socks5_stream
stat
storage
2008-07-18 02:21:51 +02:00
# mapped_storage
torrent
torrent_handle
torrent_info
tracker_manager
http_tracker_connection
udp_tracker_connection
sha1
2007-12-09 05:15:24 +01:00
udp_socket
upnp
logger
file_pool
lsd
2007-06-10 22:46:09 +02:00
disk_io_thread
enum_net
broadcast_socket
magnet_uri
parse_url
ConvertUTF
# -- extensions --
metadata_transfer
ut_pex
ut_metadata
2008-11-27 21:51:59 +01:00
lt_trackers
smart_ban
;
KADEMLIA_SOURCES =
kademlia/closest_nodes
kademlia/dht_tracker
kademlia/node
kademlia/refresh
kademlia/rpc_manager
kademlia/find_data
kademlia/node_id
kademlia/routing_table
kademlia/traversal_algorithm
2004-02-21 12:52:21 +01:00
;
2004-02-08 17:04:50 +01:00
2004-03-28 19:45:37 +02:00
ZLIB_SOURCES =
adler32
compress
crc32
deflate
gzio
infback
inffast
inflate
inftrees
trees
uncompr
zutil
2004-03-28 19:45:37 +02:00
;
local usage-requirements =
<include>./include
2008-05-20 11:45:55 +02:00
<include>./include/libtorrent
2007-06-06 02:41:20 +02:00
<zlib>shipped:<include>./zlib
<variant>release:<define>NDEBUG
<variant>debug:<define>TORRENT_DEBUG
<define>_FILE_OFFSET_BITS=64
<define>BOOST_MULTI_INDEX_DISABLE_SERIALIZATION
<define>BOOST_EXCEPTION_DISABLE
<conditional>@linking
<zlib>system:<library>zlib-target
# these compiler settings just makes the compiler standard conforming
<toolset>msvc:<cflags>/Zc:wchar_t
<toolset>msvc:<cflags>/Zc:forScope
# disable bogus deprecation warnings on msvc8
<toolset>msvc:<define>_SCL_SECURE_NO_DEPRECATE
<toolset>msvc:<define>_CRT_SECURE_NO_DEPRECATE
2007-09-01 06:08:39 +02:00
# msvc optimizations
<toolset>msvc,<variant>release:<linkflags>/OPT:ICF=5
<toolset>msvc,<variant>release:<linkflags>/OPT:REF
# disable warning C4503: decorated name length exceeded, name was truncated
<toolset>msvc:<cxxflags>/wd4503
2007-09-10 09:51:58 +02:00
# disable some warnings for gcc
<toolset>gcc:<cflags>-fno-strict-aliasing
<toolset>gcc:<cflags>-Wno-missing-braces
<boost>system:<cxxflags>$(CXXFLAGS)
<boost>system:<linkflags>$(LDFLAGS)
;
2008-06-23 15:17:15 +02:00
project torrent ;
2008-06-23 15:17:15 +02:00
lib torrent
: # sources
src/$(SOURCES).cpp
: # requirements
<define>BOOST_THREAD_USE_LIB
<threading>multi
<link>shared:<define>TORRENT_BUILDING_SHARED
<dht-support>on:<source>src/$(KADEMLIA_SOURCES).cpp
<dht-support>logging:<source>src/$(KADEMLIA_SOURCES).cpp
2007-06-06 02:41:20 +02:00
<zlib>shipped:<source>zlib/$(ZLIB_SOURCES).c
<conditional>@building
<boost>system:<cxxflags>$(CXXFLAGS)
$(usage-requirements)
: # default build
<link>static
<threading>multi
: # usage requirements
$(usage-requirements)
;