use boost.asio as headers only library again (simplify builds and hopefully fix shared linking of python module on gcc linux)

This commit is contained in:
arvidn 2015-07-27 14:49:22 -07:00
parent edf5e5eefc
commit 7f695f05d5
10 changed files with 7 additions and 87 deletions

View File

@ -8,7 +8,6 @@ set(sources
alert
alert_manager
allocator
asio
assert
bandwidth_limit
bandwidth_manager
@ -188,7 +187,7 @@ include_directories(${includes})
add_definitions(-DTORRENT_BUILDING_LIBRARY)
if (encryption)
list(APPEND sources mpi pe_crypto asio_ssl)
list(APPEND sources mpi pe_crypto)
if(NOT DEFINED OPENSSL_INCLUDE_DIR OR NOT DEFINED OPENSSL_LIBRARIES)
FIND_PACKAGE(OpenSSL REQUIRED)
endif()
@ -256,9 +255,7 @@ target_link_libraries(torrent-rasterbar ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_I
#add_definitions(-DBOOST_ASIO_HASH_MAP_BUCKETS=1021 -D__USE_W32_SOCKETS -DWIN32_LEAN_AND_MEAN )
if(NOT static_runtime)
add_definitions(-DBOOST_ASIO_DYN_LINK -DBOOST_SYSTEM_DYN_LINK -DBOOST_CHRONO_DYN_LINK -DBOOST_RANDOM_DYN_LINK)
else()
add_definitions(-DBOOST_ASIO_SEPARATE_COMPILATION)
add_definitions(-DBOOST_SYSTEM_DYN_LINK -DBOOST_CHRONO_DYN_LINK -DBOOST_RANDOM_DYN_LINK)
endif()
if (WIN32)

17
Jamfile
View File

@ -324,11 +324,6 @@ rule building ( properties * )
result += <source>src/assert.cpp ;
}
if <crypto>openssl in $(properties)
{
result += <source>src/asio_ssl.cpp ;
}
if <encryption>on in $(properties)
{
result += <source>src/mpi.c ;
@ -353,8 +348,6 @@ rule building ( properties * )
&& ! <debug-iterators>on in $(properties)
{
# hide non-external symbols
# use ms-compat because boost.asio (as of 1.47.0
# appears to have some types not fully exported)
result += <cflags>-fvisibility=hidden ;
result += <cxxflags>-fvisibility-inlines-hidden ;
@ -586,7 +579,6 @@ SOURCES =
alert
alert_manager
allocator
asio
assert
bandwidth_limit
bandwidth_manager
@ -752,10 +744,6 @@ local usage-requirements =
<boost>system:<linkflags>$(LDFLAGS)
# this works around a bug in asio in boost-1.39
<define>BOOST_ASIO_HASH_MAP_BUCKETS=1021
# make sure asio symbols are properly exported
# and imported
<link>shared:<define>BOOST_ASIO_DYN_LINK
<define>BOOST_ASIO_SEPARATE_COMPILATION
<tag>@tag
;
@ -772,11 +760,6 @@ lib torrent
<define>TORRENT_BUILDING_LIBRARY
<link>shared:<define>TORRENT_BUILDING_SHARED
<define>BOOST_NO_DEPRECATED
# on windows, when linking statically against asio
# but producing a DLL, everything inside the DLL needs
# to declare the symbol as being exported
<link>shared:<define>BOOST_ASIO_SOURCE
<link>shared:<define>BOOST_SYSTEM_SOURCE
<dht>on:<source>src/kademlia/$(KADEMLIA_SOURCES).cpp

View File

@ -99,11 +99,9 @@ DOCS_PAGES = \
docs/reference-Error_Codes.html \
docs/reference-Filter.html \
docs/reference-Plugins.html \
docs/reference-RSS.html \
docs/reference-Session.html \
docs/reference-Settings.html \
docs/reference-Storage.html \
docs/reference-String.html \
docs/reference-Time.html \
docs/reference-Utility.html \
docs/reference.html

View File

@ -541,9 +541,6 @@ COMPILETIME_OPTIONS="$COMPILETIME_OPTIONS -DBOOST_EXCEPTION_DISABLE "
AC_DEFINE([BOOST_ASIO_ENABLE_CANCELIO],[1],[Define to enable cancel support in asio on windows XP and older.])
COMPILETIME_OPTIONS="$COMPILETIME_OPTIONS -DBOOST_ASIO_ENABLE_CANCELIO "
AC_DEFINE([BOOST_ASIO_DYN_LINK],[1],[make asio export its symbols])
COMPILETIME_OPTIONS="$COMPILETIME_OPTIONS -DBOOST_ASIO_DYN_LINK"
dnl Use possibly specific python install params
AC_ARG_VAR([PYTHON_INSTALL_PARAMS], [Set specific install parameters for python bindings.])
AS_IF([test "x$PYTHON_INSTALL_PARAMS" = "x"],

View File

@ -39,6 +39,5 @@ LDADD = $(top_builddir)/src/libtorrent-rasterbar.la
AM_CPPFLAGS = -ftemplate-depth-50 -I$(top_srcdir)/include @DEBUGFLAGS@
AM_LDFLAGS = @BOOST_SYSTEM_LIB@
#AM_LDFLAGS = $(LDFLAGS) @BOOST_SYSTEM_LIB@ @BOOST_FILESYSTEM_LIB@ @BOOST_THREAD_LIB@ @OPENSSL_LDFLAGS@ @OPENSSL_LIBS@
#AM_LDFLAGS = @OPENSSL_LDFLAGS@
AM_LDFLAGS = @BOOST_SYSTEM_LIB@ @BOOST_CHRONO_LIB@ @BOOST_RANDOM_LIB@ @OPENSSL_LDFLAGS@ @OPENSSL_LIBS@

View File

@ -54,6 +54,7 @@ POSSIBILITY OF SUCH DAMAGE.
#ifdef __GNUC__
// this is to suppress the warnings for using std::auto_ptr
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif

View File

@ -29,16 +29,11 @@ KADEMLIA_SOURCES = \
../ed25519/src/verify.cpp
endif
if WITH_OPENSSL
ASIO_OPENSSL_SOURCES = asio_ssl.cpp
endif
libtorrent_rasterbar_la_SOURCES = \
web_connection_base.cpp \
alert.cpp \
alert_manager.cpp \
allocator.cpp \
asio.cpp \
assert.cpp \
bandwidth_limit.cpp \
bandwidth_manager.cpp \
@ -146,8 +141,7 @@ libtorrent_rasterbar_la_SOURCES = \
xml_parse.cpp \
file_progress.cpp \
\
$(KADEMLIA_SOURCES) \
$(ASIO_OPENSSL_SOURCES)
$(KADEMLIA_SOURCES)
libtorrent_rasterbar_la_LDFLAGS = -version-info $(INTERFACE_VERSION_INFO)
libtorrent_rasterbar_la_LIBADD = @BOOST_SYSTEM_LIB@ @OPENSSL_LIBS@

View File

@ -1,27 +0,0 @@
#include "libtorrent/aux_/disable_warnings_push.hpp"
// builds all boost.asio source as a separate compilation unit
#include <boost/version.hpp>
#include <boost/preprocessor/facilities/is_empty.hpp>
#include "libtorrent/config.hpp"
// only define BOOST_ASIO_DECL if it hasn't already been defined
// or if it has been defined to an empty string
#if !defined BOOST_ASIO_DECL || !BOOST_PP_IS_EMPTY(BOOST_ASIO_DECL)
#ifdef BOOST_ASIO_DECL
#undef BOOST_ASIO_DECL
#endif
#define BOOST_ASIO_DECL BOOST_SYMBOL_EXPORT
#endif
#if BOOST_VERSION >= 104500
#include <boost/asio/impl/src.hpp>
#elif BOOST_VERSION >= 104400
#include <boost/asio/impl/src.cpp>
#endif
#include "libtorrent/aux_/disable_warnings_pop.hpp"

View File

@ -1,23 +0,0 @@
// builds all boost.asio SSL source as a separate compilation unit
#include <boost/version.hpp>
#include <climits>
#ifndef BOOST_ASIO_SOURCE
#define BOOST_ASIO_SOURCE
#endif
#include "libtorrent/config.hpp"
#define TORRENT_HAS_ASIO_DECL x ## BOOST_ASIO_DECL
// only define BOOST_ASIO_DECL if it hasn't already been defined
// or if it has been defined to an empty string
#if TORRENT_HAS_ASIO_DECL == x
#undef BOOST_ASIO_DECL
#define BOOST_ASIO_DECL BOOST_SYMBOL_EXPORT
#endif
#if BOOST_VERSION >= 104610
#include <boost/asio/ssl/impl/src.hpp>
#endif

View File

@ -8077,6 +8077,7 @@ namespace libtorrent
default: TORRENT_ASSERT_VAL(false, idx);
}
#undef TORRENT_LIST_NAME
return "";
}
void torrent::update_list(int list, bool in)