fix linux python build and test_ssl build

This commit is contained in:
Arvid Norberg 2015-04-04 18:03:55 +00:00
parent 8cc9339550
commit d019f3d4c3
3 changed files with 17 additions and 7 deletions

View File

@ -136,7 +136,7 @@ rule linking ( properties * )
}
# clock_gettime on linux requires librt
if <need-librt>yes in $(properties)
if <target-os>linux in $(properties)
{
result += <library>librt ;
}
@ -324,8 +324,6 @@ feature.compose <sanitize>address : <cflags>-fsanitize=address <linkflags>-fsani
# RTC (runtime check) is an msvc feature
feature.compose <sanitize>rtc : <cflags>/RTCc <cflags>/RTCsu ;
feature need-librt : no yes : composite propagated link-incompatible ;
feature fiemap : off on : composite propagated ;
feature.compose <fiemap>on : <define>HAVE_LINUX_FIEMAP_H ;
@ -503,7 +501,7 @@ lib boost_random : : <name>boost_random ;
# openssl on linux/bsd/macos etc.
lib gcrypt : : <name>gcrypt <link>shared <search>/opt/local/lib ;
lib z : : <link>shared <name>z <search>/usr/lib ;
lib crypto : : <name>crypto <search>/usr/lib <use>z ;
lib crypto : : <name>crypto <link>shared <search>/usr/lib <use>z ;
lib ssl : : <name>ssl <link>shared <use>crypto <search>/opt/local/lib ;
lib dl : : <link>shared <name>dl ;
lib aio : : <link>shared <name>aio ;

View File

@ -39,8 +39,19 @@ rule libtorrent_linking ( properties * )
}
}
if <link>static in $(properties)
{
ECHO "WARNING: you probably want to specify libtorrent-link=static rather than link=static" ;
}
if <boost>source in $(properties)
{
if <boost-link>static in $(properties) && <target-os>linux
{
ECHO "WARNING: you cannot link statically against boost-python on linux, because it links against pthread statically in that case, which is not allowed" ;
}
# linux must link dynamically against boost python because it pulls
# in libpthread, which must be linked dynamically since we're building a .so
# (the static build of libpthread is not position independent)
@ -130,5 +141,6 @@ my-python-extension libtorrent
<suppress-import-lib>false
;
install stage_module : libtorrent : <location>. ;
install stage_module : libtorrent : <install-type>LIB <install-dependencies>on <location>. ;

View File

@ -88,14 +88,14 @@ int ssl_peer_disconnects = 0;
bool on_alert(alert const* a)
{
if (peer_disconnected_alert* e = alert_cast<peer_disconnected_alert>(a))
if (peer_disconnected_alert const* e = alert_cast<peer_disconnected_alert>(a))
{
++peer_disconnects;
if (e->error.category() == boost::asio::error::get_ssl_category())
++ssl_peer_disconnects;
}
if (peer_error_alert* e = alert_cast<peer_error_alert>(a))
if (peer_error_alert const* e = alert_cast<peer_error_alert>(a))
{
++peer_disconnects;
++peer_errors;