From c99ad7b96250127883300ed8bf301b7c1860f4f5 Mon Sep 17 00:00:00 2001 From: arvidn Date: Sun, 9 Aug 2015 21:23:11 -0400 Subject: [PATCH] fix python binding Jamfile to detect BOOST_ROOT environment variable too --- bindings/python/Jamfile | 85 ++++++++++++++++++++++++----------------- 1 file changed, 49 insertions(+), 36 deletions(-) diff --git a/bindings/python/Jamfile b/bindings/python/Jamfile index 384a91625..9a3c28a75 100644 --- a/bindings/python/Jamfile +++ b/bindings/python/Jamfile @@ -3,11 +3,11 @@ import feature : feature ; import project ; import targets ; import "class" : new ; +import modules ; use-project /torrent : ../.. ; -lib boost_python : : darwin boost_python-mt $(boost-library-search-path) ; -lib boost_python : : boost_python ; +BOOST_ROOT = [ modules.peek : BOOST_ROOT ] ; feature visibility : default hidden : composite propagated link-incompatible ; feature.compose hidden : -fvisibility=hidden -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 on : -fPIC ; +if $(BOOST_ROOT) +{ + use-project /boost : $(BOOST_ROOT) ; + alias boost_python : /boost/python//boost_python : : : $(BOOST_ROOT) ; +} +else +{ + local boost-lib-search-path = + /opt/local/lib + /usr/lib + /usr/local/lib + /sw/lib + /usr/g++/lib + ; + + local boost-include-path = + /opt/local/include + /usr/local/include + /usr/sfw/include + ; + + # the names are decorated in MacPorts + lib boost_python : : darwin boost_python-mt + : : $(boost-include-path) ; + + lib boost_python : : boost_python + : : $(boost-include-path) ; +} + rule libtorrent_linking ( properties * ) { @@ -45,46 +74,30 @@ rule libtorrent_linking ( properties * ) ECHO "WARNING: you probably want to specify libtorrent-link=static rather than link=static" ; } - if source in $(properties) + if static in $(properties) && linux in $(properties) { - if static in $(properties) && 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" ; - } + 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) - if shared in $(properties) || linux in $(properties) - { - result += /boost/python//boost_python/shared ; - } - else - { - result += /boost/python//boost_python/static ; - } - - if shared in $(properties) - { - result += /torrent//torrent/shared/shared ; - } - else - { - result += /torrent//torrent/static/static ; - } + # 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) + if shared in $(properties) || linux in $(properties) + { + result += boost_python/shared ; } else { - result += boost_python ; + result += boost_python/static ; + } - if shared in $(properties) - { - result += /torrent//torrent/shared/shared ; - } - else - { - result += /torrent//torrent/static/static ; - } + if shared in $(properties) + { + result += /torrent//torrent/shared/shared ; + } + else + { + result += /torrent//torrent/static/static ; } return $(result) ;