fix python binding Jamfile to detect BOOST_ROOT environment variable too
This commit is contained in:
parent
e38f461197
commit
c99ad7b962
|
@ -3,11 +3,11 @@ import feature : feature ;
|
|||
import project ;
|
||||
import targets ;
|
||||
import "class" : new ;
|
||||
import modules ;
|
||||
|
||||
use-project /torrent : ../.. ;
|
||||
|
||||
lib boost_python : : <target-os>darwin <name>boost_python-mt $(boost-library-search-path) ;
|
||||
lib boost_python : : <name>boost_python ;
|
||||
BOOST_ROOT = [ modules.peek : BOOST_ROOT ] ;
|
||||
|
||||
feature visibility : default hidden : composite propagated link-incompatible ;
|
||||
feature.compose <visibility>hidden : <cflags>-fvisibility=hidden <cxxflags>-fvisibility-inlines-hidden ;
|
||||
|
@ -16,6 +16,35 @@ feature libtorrent-link : shared static : composite propagated ;
|
|||
feature libtorrent-python-pic : off on : composite propagated link-incompatible ;
|
||||
feature.compose <libtorrent-python-pic>on : <cflags>-fPIC ;
|
||||
|
||||
if $(BOOST_ROOT)
|
||||
{
|
||||
use-project /boost : $(BOOST_ROOT) ;
|
||||
alias boost_python : /boost/python//boost_python : : : <include>$(BOOST_ROOT) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
local boost-lib-search-path =
|
||||
<search>/opt/local/lib
|
||||
<search>/usr/lib
|
||||
<search>/usr/local/lib
|
||||
<search>/sw/lib
|
||||
<search>/usr/g++/lib
|
||||
;
|
||||
|
||||
local boost-include-path =
|
||||
<include>/opt/local/include
|
||||
<include>/usr/local/include
|
||||
<include>/usr/sfw/include
|
||||
;
|
||||
|
||||
# the names are decorated in MacPorts
|
||||
lib boost_python : : <target-os>darwin <name>boost_python-mt
|
||||
: : $(boost-include-path) ;
|
||||
|
||||
lib boost_python : : <name>boost_python
|
||||
: : $(boost-include-path) ;
|
||||
}
|
||||
|
||||
|
||||
rule libtorrent_linking ( properties * )
|
||||
{
|
||||
|
@ -45,8 +74,6 @@ rule libtorrent_linking ( 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 in $(properties)
|
||||
{
|
||||
ECHO "WARNING: you cannot link statically against boost-python on linux, because it links against pthread statically in that case, which is not allowed" ;
|
||||
|
@ -57,11 +84,11 @@ rule libtorrent_linking ( properties * )
|
|||
# (the static build of libpthread is not position independent)
|
||||
if <boost-link>shared in $(properties) || <target-os>linux in $(properties)
|
||||
{
|
||||
result += <library>/boost/python//boost_python/<link>shared ;
|
||||
result += <library>boost_python/<link>shared ;
|
||||
}
|
||||
else
|
||||
{
|
||||
result += <library>/boost/python//boost_python/<link>static ;
|
||||
result += <library>boost_python/<link>static ;
|
||||
}
|
||||
|
||||
if <libtorrent-link>shared in $(properties)
|
||||
|
@ -72,20 +99,6 @@ rule libtorrent_linking ( properties * )
|
|||
{
|
||||
result += <library>/torrent//torrent/<link>static/<boost-link>static ;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
result += <library>boost_python ;
|
||||
|
||||
if <libtorrent-link>shared in $(properties)
|
||||
{
|
||||
result += <library>/torrent//torrent/<link>shared/<boost-link>shared ;
|
||||
}
|
||||
else
|
||||
{
|
||||
result += <library>/torrent//torrent/<link>static/<boost-link>static ;
|
||||
}
|
||||
}
|
||||
|
||||
return $(result) ;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue