# This Jamfile requires boost-build v2 to build.
# The version shipped with boost 1.34.0
import modules ;
import path ;
import os ;
import errors ;
import feature : feature ;
import package ;
import virtual-target ;
BOOST_ROOT = [ modules.peek : BOOST_ROOT ] ;
CXXFLAGS = [ modules.peek : CXXFLAGS ] ;
LDFLAGS = [ modules.peek : LDFLAGS ] ;
ECHO "BOOST_ROOT =" $(BOOST_ROOT) ;
ECHO "CXXFLAGS =" $(CXXFLAGS) ;
ECHO "LDFLAGS =" $(LDFLAGS) ;
ECHO "OS =" [ os.name ] ;
if $(BOOST_ROOT)
{
use-project /boost : $(BOOST_ROOT) ;
}
VERSION = 0.16.0 ;
# rule for linking the correct libraries depending
# on features and target-os
rule linking ( properties * )
{
local result ;
if shared in $(properties)
{
# make sure asio symbols are properly exported
# and imported
result += BOOST_ASIO_DYN_LINK ;
}
else
{
result += BOOST_ASIO_SEPARATE_COMPILATION ;
}
# openssl libraries, if enabled
if openssl in $(properties)
{
# exclude gcc from a regular windows build to make mingw
# link against the regular unix library name
if windows in $(properties)
{
result += gdi32 ;
}
if windows in $(properties)
{
result += ssleay32
libeay32
advapi32
user32
shell32
;
}
else
{
result += crypto ssl z ;
}
if linux in $(properties)
{
# linker library on linux, required when using openssl
result += dl ;
}
}
if windows in $(properties)
&& ( on in $(properties)
|| debug in $(properties)
|| on in $(properties) )
{
result += dbghelp ;
}
# gcrypt libraries, if enabled
if gcrypt in $(properties)
{
# on mac os x, adding the /opt/local/include path
# would include openssl headers incompatible with
# the system library. Only add this include path
# if we're not using openssl (which we're most
# likely not if we're using libgcrypt)
result += gcrypt /opt/local/include ;
}
if shared in $(properties)
{
result += GeoIP ;
}
# socket functions on windows require winsock libraries
if windows in $(properties)
|| cygwin in $(properties)
{
result += ws2_32
wsock32
iphlpapi
WIN32_LEAN_AND_MEAN
__USE_W32_SOCKETS
WIN32
_WIN32
;
}
if beos in $(properties)
{
result += netkit gcc ;
}
if solaris in $(properties)
{
result += libsocket libnsl ;
}
if on in $(properties)
&& ( gcc in $(properties)
|| darwin in $(properties) )
{
result += -fprofile-arcs -ftest-coverage
-lgcov NDEBUG ;
}
# clock_gettime on linux requires librt
if yes in $(properties)
{
result += librt ;
}
if on in $(properties)
{
result += libiconv ;
}
if yes in $(properties)
{
result += tcmalloc ;
}
if gcc in $(properties)
&& linux in $(properties)
&& (debug in $(properties)
|| release in $(properties)
|| production in $(properties))
{
# for backtraces in assertion failures
# which only works on ELF targets with gcc
result += -export-dynamic -rdynamic ;
}
if source in $(properties)
{
if static in $(properties)
{
if shared in $(properties)
{
# if libtorrent is being built as a shared library
# but we're linking against boost statically, we still
# need to make boost think it's being built as a shared
# library, so that it properly exports its symbols
result += BOOST_ALL_DYN_LINK ;
result += /boost/system//boost_system/static/BOOST_ALL_DYN_LINK ;
}
else
{
result += /boost/system//boost_system/static ;
}
if gcc in $(properties) && shared in $(properties)
{
result += on ;
}
}
else
{
result += /boost/system//boost_system/shared ;
}
result += $(BOOST_ROOT) BOOST_ALL_NO_LIB ;
}
else
{
result += boost_system ;
# on mac the boost headers are installed in
# a directory that isn't automatically accessable
# on open indiana, boost is install at /usr/g++/include
result += /opt/local/include/boost-1_35
/opt/local/include
/usr/g++/include
;
}
return $(result) ;
}
# rule for adding the right source files
# depending on target-os and features
rule building ( properties * )
{
local result ;
if ( debug in $(properties)
|| on in $(properties) )
{
result +=