forked from premiere/premiere-libtorrent
attempt to make shared library builds to work with visibility=hidden
This commit is contained in:
parent
7f2d6325df
commit
7b1a441aeb
|
@ -5,6 +5,7 @@ set(sources
|
||||||
web_connection_base
|
web_connection_base
|
||||||
alert
|
alert
|
||||||
allocator
|
allocator
|
||||||
|
asio
|
||||||
assert
|
assert
|
||||||
bandwidth_limit
|
bandwidth_limit
|
||||||
bandwidth_manager
|
bandwidth_manager
|
||||||
|
@ -142,6 +143,7 @@ else (dht)
|
||||||
endif (dht)
|
endif (dht)
|
||||||
|
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -fvisibility-inlines-hidden")
|
||||||
|
|
||||||
if (shared)
|
if (shared)
|
||||||
add_library(torrent-rasterbar SHARED ${sources2})
|
add_library(torrent-rasterbar SHARED ${sources2})
|
||||||
|
@ -157,7 +159,7 @@ include_directories(${Boost_INCLUDE_DIR})
|
||||||
target_link_libraries(torrent-rasterbar ${Boost_LIBRARIES})
|
target_link_libraries(torrent-rasterbar ${Boost_LIBRARIES})
|
||||||
|
|
||||||
# this works around a bug in asio in boost-1.39
|
# this works around a bug in asio in boost-1.39
|
||||||
add_definitions(-DBOOST_ASIO_HASH_MAP_BUCKETS=1021)
|
add_definitions(-DBOOST_ASIO_HASH_MAP_BUCKETS=1021 -DBOOST_ASIO_DYN_LINK)
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
target_link_libraries(torrent-rasterbar wsock32 ws2_32)
|
target_link_libraries(torrent-rasterbar wsock32 ws2_32)
|
||||||
|
|
44
Jamfile
44
Jamfile
|
@ -31,6 +31,13 @@ rule linking ( properties * )
|
||||||
{
|
{
|
||||||
local result ;
|
local result ;
|
||||||
|
|
||||||
|
if <link>shared in $(properties)
|
||||||
|
{
|
||||||
|
# make sure asio symbols are properly exported
|
||||||
|
# and imported
|
||||||
|
result += <define>BOOST_ASIO_DYN_LINK ;
|
||||||
|
}
|
||||||
|
|
||||||
# openssl libraries, if enabled
|
# openssl libraries, if enabled
|
||||||
if <encryption>openssl in $(properties)
|
if <encryption>openssl in $(properties)
|
||||||
{
|
{
|
||||||
|
@ -61,7 +68,6 @@ rule linking ( properties * )
|
||||||
# linker library on linux, required when using openssl
|
# linker library on linux, required when using openssl
|
||||||
result += <library>dl ;
|
result += <library>dl ;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if <target-os>windows in $(properties)
|
if <target-os>windows in $(properties)
|
||||||
|
@ -83,11 +89,6 @@ rule linking ( properties * )
|
||||||
result += <library>gcrypt <include>/opt/local/include ;
|
result += <library>gcrypt <include>/opt/local/include ;
|
||||||
}
|
}
|
||||||
|
|
||||||
if <encryption>tommath in $(properties)
|
|
||||||
{
|
|
||||||
result += <source>src/mpi.c ;
|
|
||||||
}
|
|
||||||
|
|
||||||
if <geoip>shared in $(properties)
|
if <geoip>shared in $(properties)
|
||||||
{
|
{
|
||||||
result += <library>GeoIP ;
|
result += <library>GeoIP ;
|
||||||
|
@ -210,6 +211,11 @@ rule building ( properties * )
|
||||||
result += <source>src/assert.cpp ;
|
result += <source>src/assert.cpp ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if <encryption>tommath in $(properties)
|
||||||
|
{
|
||||||
|
result += <source>src/mpi.c ;
|
||||||
|
}
|
||||||
|
|
||||||
if <geoip>static in $(properties)
|
if <geoip>static in $(properties)
|
||||||
{
|
{
|
||||||
result += <source>src/GeoIP.c ;
|
result += <source>src/GeoIP.c ;
|
||||||
|
@ -226,6 +232,19 @@ rule building ( properties * )
|
||||||
result += <source>src/pe_crypto.cpp ;
|
result += <source>src/pe_crypto.cpp ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( <toolset>darwin in $(properties)
|
||||||
|
|| <toolset>gcc in $(properties)
|
||||||
|
|| <toolset>clang in $(propertoes) )
|
||||||
|
&& <link>shared in $(properties)
|
||||||
|
{
|
||||||
|
# hide non-external symbols
|
||||||
|
# use ms-compat because boost.asio (as of 1.47.0
|
||||||
|
# appears to have some types not fulle exported)
|
||||||
|
result += <cflags>-fvisibility-ms-compat ;
|
||||||
|
result += <cxxflags>-fvisibility-inlines-hidden ;
|
||||||
|
result += <linkflags>-W1,-Bsymbolic ;
|
||||||
|
}
|
||||||
|
|
||||||
return $(result) ;
|
return $(result) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -406,6 +425,7 @@ lib iphlpapi : : <name>iphlpapi <link>shared ;
|
||||||
SOURCES =
|
SOURCES =
|
||||||
alert
|
alert
|
||||||
allocator
|
allocator
|
||||||
|
asio
|
||||||
assert
|
assert
|
||||||
bandwidth_limit
|
bandwidth_limit
|
||||||
bandwidth_manager
|
bandwidth_manager
|
||||||
|
@ -550,16 +570,8 @@ lib torrent
|
||||||
<conditional>@building
|
<conditional>@building
|
||||||
<boost>system:<cxxflags>$(CXXFLAGS)
|
<boost>system:<cxxflags>$(CXXFLAGS)
|
||||||
|
|
||||||
# hide non-external symbols
|
# tell asio to export its symbols
|
||||||
<toolset>darwin:<cflags>-fvisibility=hidden
|
<link>shared:<define>BOOST_ASIO_SOURCE
|
||||||
<toolset>darwin:<cxxflags>-fvisibility-inlines-hidden
|
|
||||||
<toolset>darwin:<linkflags>-W1,-Bsymbolic
|
|
||||||
<toolset>gcc:<cflags>-fvisibility=hidden
|
|
||||||
<toolset>gcc:<cxxflags>-fvisibility-inlines-hidden
|
|
||||||
<toolset>gcc:<linkflags>-W1,-Bsymbolic
|
|
||||||
<toolset>llvm:<cflags>-fvisibility=hidden
|
|
||||||
<toolset>llvm:<cxxflags>-fvisibility-inlines-hidden
|
|
||||||
<toolset>llvm:<linkflags>-W1,-Bsymbolic
|
|
||||||
|
|
||||||
$(usage-requirements)
|
$(usage-requirements)
|
||||||
|
|
||||||
|
|
|
@ -98,7 +98,7 @@ AX_PTHREAD()
|
||||||
|
|
||||||
LIBS="$PTHREAD_LIBS $LIBS"
|
LIBS="$PTHREAD_LIBS $LIBS"
|
||||||
CFLAGS="$PTHREAD_CFLAGS $CFLAGS -fvisibility=hidden"
|
CFLAGS="$PTHREAD_CFLAGS $CFLAGS -fvisibility=hidden"
|
||||||
CXXFLAGS="$CXXFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
|
CXXFLAGS="$CXXFLAGS -fvisibility-inlines-hidden"
|
||||||
CC="$PTHREAD_CC"
|
CC="$PTHREAD_CC"
|
||||||
|
|
||||||
AS_ECHO
|
AS_ECHO
|
||||||
|
@ -159,7 +159,7 @@ AC_CHECK_FUNCS([clock_gettime], [],
|
||||||
|
|
||||||
|
|
||||||
dnl Pass some build options to setup.py and .pc file
|
dnl Pass some build options to setup.py and .pc file
|
||||||
COMPILETIME_OPTIONS=""
|
COMPILETIME_OPTIONS="-DBOOST_ASIO_DYN_LINK "
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
|
@ -44,6 +44,10 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include <boost/function/function1.hpp>
|
#include <boost/function/function1.hpp>
|
||||||
#include <boost/function/function2.hpp>
|
#include <boost/function/function2.hpp>
|
||||||
|
|
||||||
|
#ifndef BOOST_NO_EXCEPTIONS
|
||||||
|
#include <boost/system/system_error.hpp>
|
||||||
|
#endif
|
||||||
|
|
||||||
#define CCONTROL_TARGET 100
|
#define CCONTROL_TARGET 100
|
||||||
|
|
||||||
namespace libtorrent
|
namespace libtorrent
|
||||||
|
|
|
@ -20,6 +20,7 @@ libtorrent_rasterbar_la_SOURCES = \
|
||||||
web_connection_base.cpp \
|
web_connection_base.cpp \
|
||||||
alert.cpp \
|
alert.cpp \
|
||||||
allocator.cpp \
|
allocator.cpp \
|
||||||
|
asio.cpp \
|
||||||
assert.cpp \
|
assert.cpp \
|
||||||
bandwidth_limit.cpp \
|
bandwidth_limit.cpp \
|
||||||
bandwidth_manager.cpp \
|
bandwidth_manager.cpp \
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
// builds all boost.asio source as a separate compilation unit
|
||||||
|
#include <boost/asio/impl/src.hpp>
|
||||||
|
|
|
@ -9,7 +9,7 @@ explicit test_natpmp ;
|
||||||
|
|
||||||
project
|
project
|
||||||
: requirements
|
: requirements
|
||||||
<library>/torrent//torrent
|
<library>/torrent//torrent/<link>shared
|
||||||
<source>main.cpp
|
<source>main.cpp
|
||||||
<source>setup_transfer.cpp
|
<source>setup_transfer.cpp
|
||||||
: default-build
|
: default-build
|
||||||
|
|
Loading…
Reference in New Issue