From 3d34d30afb0e3136ce724a5a16f43f59d5f1d8c4 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sat, 20 Dec 2008 21:12:39 +0000 Subject: [PATCH] use -fvisibility=hidden for darwin and gcc toolkits --- Jamfile | 32 ++++++++++++++++++++++---------- bindings/python/Jamfile | 20 +++++++++++++++++--- 2 files changed, 39 insertions(+), 13 deletions(-) diff --git a/Jamfile b/Jamfile index 2fc213fc0..9be994c0e 100755 --- a/Jamfile +++ b/Jamfile @@ -110,22 +110,29 @@ rule linking ( properties * ) { if static in $(properties) { - result += /boost/thread//boost_thread/static - /boost/filesystem//boost_filesystem/static - /boost/system//boost_system/static - $(BOOST_ROOT) - BOOST_ALL_NO_LIB - ; + if darwin in $(properties) || gcc in $(properties) + { + result += /boost/thread//boost_thread/static/-fvisibility=hidden + /boost/filesystem//boost_filesystem/static/-fvisibility=hidden + /boost/system//boost_system/static +#/-fvisibility=hidden + ; + } + else + { + result += /boost/thread//boost_thread/static + /boost/filesystem//boost_filesystem/static + /boost/system//boost_system/static + ; + } } else { result += /boost/thread//boost_thread/shared /boost/filesystem//boost_filesystem/shared - /boost/system//boost_system/shared - $(BOOST_ROOT) - BOOST_ALL_NO_LIB - ; + /boost/system//boost_system/shared ; } + result += $(BOOST_ROOT) BOOST_ALL_NO_LIB ; } if system in $(properties) @@ -146,6 +153,11 @@ rule building ( properties * ) { local result ; + if gcc in $(properties) || darwin in $(properties) + { + result += -fvisibility=hidden ; + } + if ( linux in $(properties) || darwin in $(properties) ) && ( gcc in $(properties) diff --git a/bindings/python/Jamfile b/bindings/python/Jamfile index 60dc88d04..5d1f3aa05 100755 --- a/bindings/python/Jamfile +++ b/bindings/python/Jamfile @@ -2,7 +2,7 @@ import python ; use-project /torrent : ../.. ; -lib boost_python : : boost_python $(library-search-path) ; +lib boost_python : : boost_python-mt $(library-search-path) ; rule libtorrent_linking ( properties * ) { @@ -10,13 +10,28 @@ rule libtorrent_linking ( properties * ) if gcc in $(properties) { - result += /torrent//torrent/static/-fPIC/-fPIC -fPIC ; + result += /torrent//torrent/static/-fPIC + -fPIC ; } else { result += /torrent//torrent/static ; } + if gcc in $(properties) || darwin in $(properties) + { + result += -fvisibility=hidden ; + + if source in $(properties) && static in $(properties) + { + result += /boost/python//boost_python/static/-fvisibility=hidden ; + } + } + else if source in $(properties) && static in $(properties) + { + result += /boost/python//boost_python/static ; + } + # when building peer_plugin.cpp on msvc-7.1 it fails # running out of internal heap space. Don't add it # to windows build, since it's not critical anyway @@ -54,7 +69,6 @@ python-extension libtorrent src/magnet_uri.cpp : src system:boost_python - source,static:/boost/python//boost_python/static source,shared:/boost/python//boost_python/shared @libtorrent_linking ;