From 38b6ee9e75bf31f1880ea1a6cb9fc9ea9730795d Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Fri, 21 Jun 2019 01:53:34 +0800 Subject: [PATCH 1/4] Remove workaround for boost 1.39 ... by raising minimum version to 1.40. Bug report: https://svn.boost.org/trac10/ticket/3095 --- CMakeLists.txt | 2 +- INSTALL | 2 +- cmake/Modules/winconf.cmake | 1 - configure | 20 ++++++++++---------- configure.ac | 2 +- winconf.pri | 1 - 6 files changed, 13 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 924e8ccd0..e5f0d33b3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,7 +30,7 @@ include(GNUInstallDirs) include(FeatureSummary) # version requirements -set(requiredBoostVersion 1.35) +set(requiredBoostVersion 1.40) set(requiredQtVersion 5.9.0) set(requiredOpensslVersion 1.0) set(requiredLibtorrentVersion 1.1.10) diff --git a/INSTALL b/INSTALL index d5ad61289..f4967b8f1 100644 --- a/INSTALL +++ b/INSTALL @@ -3,7 +3,7 @@ qBittorrent - A BitTorrent client in C++ / Qt 1) Install these dependencies: - - Boost >= 1.35 + - Boost >= 1.40 - libtorrent-rasterbar >= 1.1.10 (by Arvid Norberg) * https://www.libtorrent.org/ diff --git a/cmake/Modules/winconf.cmake b/cmake/Modules/winconf.cmake index 7e178c123..757d84e31 100644 --- a/cmake/Modules/winconf.cmake +++ b/cmake/Modules/winconf.cmake @@ -6,7 +6,6 @@ list(APPEND CMAKE_LIBRARY_PATH "$ENV{LIB}") # libtorrent set(LibtorrentRasterbar_USE_STATIC_LIBS True) set(LibtorrentRasterbar_CUSTOM_DEFINITIONS - -DBOOST_ALL_NO_LIB -DBOOST_ASIO_HASH_MAP_BUCKETS=1021 -DBOOST_EXCEPTION_DISABLE -DBOOST_SYSTEM_STATIC_LINK=1 -DTORRENT_USE_OPENSSL diff --git a/configure b/configure index 9cae4c479..51d876e22 100755 --- a/configure +++ b/configure @@ -4729,10 +4729,10 @@ BOOST_CPPFLAGS="" if test "x$want_boost" = "xyes"; then : - if test "x1.35" = "x"; then : + if test "x1.40" = "x"; then : _AX_BOOST_BASE_TONUMERICVERSION_req="1.20.0" else - _AX_BOOST_BASE_TONUMERICVERSION_req="1.35" + _AX_BOOST_BASE_TONUMERICVERSION_req="1.40" fi _AX_BOOST_BASE_TONUMERICVERSION_req_shorten=`expr $_AX_BOOST_BASE_TONUMERICVERSION_req : '\([0-9]*\.[0-9]*\)'` _AX_BOOST_BASE_TONUMERICVERSION_req_major=`expr $_AX_BOOST_BASE_TONUMERICVERSION_req : '\([0-9]*\)'` @@ -4774,16 +4774,16 @@ esac if test "x$_AX_BOOST_BASE_boost_path" != "x"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for boostlib >= 1.35 ($WANT_BOOST_VERSION) includes in \"$_AX_BOOST_BASE_boost_path/include\"" >&5 -$as_echo_n "checking for boostlib >= 1.35 ($WANT_BOOST_VERSION) includes in \"$_AX_BOOST_BASE_boost_path/include\"... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for boostlib >= 1.40 ($WANT_BOOST_VERSION) includes in \"$_AX_BOOST_BASE_boost_path/include\"" >&5 +$as_echo_n "checking for boostlib >= 1.40 ($WANT_BOOST_VERSION) includes in \"$_AX_BOOST_BASE_boost_path/include\"... " >&6; } if test -d "$_AX_BOOST_BASE_boost_path/include" && test -r "$_AX_BOOST_BASE_boost_path/include"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } BOOST_CPPFLAGS="-I$_AX_BOOST_BASE_boost_path/include" for _AX_BOOST_BASE_boost_path_tmp in $multiarch_libsubdir $libsubdirs; do - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for boostlib >= 1.35 ($WANT_BOOST_VERSION) lib path in \"$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp\"" >&5 -$as_echo_n "checking for boostlib >= 1.35 ($WANT_BOOST_VERSION) lib path in \"$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp\"... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for boostlib >= 1.40 ($WANT_BOOST_VERSION) lib path in \"$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp\"" >&5 +$as_echo_n "checking for boostlib >= 1.40 ($WANT_BOOST_VERSION) lib path in \"$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp\"... " >&6; } if test -d "$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp" && test -r "$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp" ; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 @@ -4826,8 +4826,8 @@ fi BOOST_LDFLAGS="-L$_AX_BOOST_BASE_boost_lib_path" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for boostlib >= 1.35 ($WANT_BOOST_VERSION)" >&5 -$as_echo_n "checking for boostlib >= 1.35 ($WANT_BOOST_VERSION)... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for boostlib >= 1.40 ($WANT_BOOST_VERSION)" >&5 +$as_echo_n "checking for boostlib >= 1.40 ($WANT_BOOST_VERSION)... " >&6; } CPPFLAGS_SAVED="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" export CPPFLAGS @@ -4996,8 +4996,8 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test "x$succeeded" != "xyes" ; then if test "x$_version" = "x0" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: We could not detect the boost libraries (version 1.35 or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in . See http://randspringer.de/boost for more documentation." >&5 -$as_echo "$as_me: We could not detect the boost libraries (version 1.35 or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in . See http://randspringer.de/boost for more documentation." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: We could not detect the boost libraries (version 1.40 or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in . See http://randspringer.de/boost for more documentation." >&5 +$as_echo "$as_me: We could not detect the boost libraries (version 1.40 or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in . See http://randspringer.de/boost for more documentation." >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: Your boost libraries seems to old (version $_version)." >&5 $as_echo "$as_me: Your boost libraries seems to old (version $_version)." >&6;} diff --git a/configure.ac b/configure.ac index ffd046f6d..098be1546 100644 --- a/configure.ac +++ b/configure.ac @@ -163,7 +163,7 @@ AS_CASE(["x$enable_qt_dbus"], AC_MSG_ERROR([Unknown option "$enable_qt_dbus". Use either "yes" or "no".])]) -AX_BOOST_BASE([1.35], +AX_BOOST_BASE([1.40], [AC_MSG_NOTICE([Boost CXXFLAGS: "$BOOST_CPPFLAGS"]) AC_MSG_NOTICE([Boost LDFLAGS: "$BOOST_LDFLAGS"])], [AC_MSG_ERROR([Could not find Boost])]) diff --git a/winconf.pri b/winconf.pri index 6db3ef61f..dd5dfe318 100644 --- a/winconf.pri +++ b/winconf.pri @@ -1,4 +1,3 @@ -DEFINES += BOOST_ASIO_HASH_MAP_BUCKETS=1021 # After 1.55 some Windows users reported regular UI freezes. # This makes ASIO use the pre-1.56 way of doing things. See issue #2003 DEFINES += BOOST_ASIO_DISABLE_CONNECTEX From e418ea03e263a7797f55a753c759ef5a6eaab14d Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Sun, 23 Jun 2019 11:37:46 +0800 Subject: [PATCH 2/4] Move __USE_W32_SOCKETS to its place From boost.asio documentation: > The following platforms may also work: > Win32 using Cygwin. (__USE_W32_SOCKETS must be defined.) --- winconf.pri | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/winconf.pri b/winconf.pri index dd5dfe318..b378024ef 100644 --- a/winconf.pri +++ b/winconf.pri @@ -13,7 +13,6 @@ DEFINES += _WIN32 DEFINES += WIN32_LEAN_AND_MEAN DEFINES += _CRT_SECURE_NO_DEPRECATE DEFINES += _SCL_SECURE_NO_DEPRECATE -DEFINES += __USE_W32_SOCKETS DEFINES += _FILE_OFFSET_BITS=64 DEFINES += NOMINMAX @@ -30,6 +29,7 @@ win32-g++* { QMAKE_LFLAGS -= -Wl,--dynamicbase } + DEFINES += __USE_W32_SOCKETS RC_FILE = qbittorrent_mingw.rc LIBS += libadvapi32 libshell32 libuser32 libole32 libwsock32 libws2_32 From 7c8948c45ee861137530ba42649c4d0699be6ac1 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Sun, 23 Jun 2019 11:43:28 +0800 Subject: [PATCH 3/4] Move _FILE_OFFSET_BITS to its place _FILE_OFFSET_BITS is only useful for glibc. --- winconf.pri | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/winconf.pri b/winconf.pri index b378024ef..f26de480a 100644 --- a/winconf.pri +++ b/winconf.pri @@ -13,7 +13,6 @@ DEFINES += _WIN32 DEFINES += WIN32_LEAN_AND_MEAN DEFINES += _CRT_SECURE_NO_DEPRECATE DEFINES += _SCL_SECURE_NO_DEPRECATE -DEFINES += _FILE_OFFSET_BITS=64 DEFINES += NOMINMAX CONFIG(debug, debug|release) { @@ -29,7 +28,9 @@ win32-g++* { QMAKE_LFLAGS -= -Wl,--dynamicbase } + DEFINES += _FILE_OFFSET_BITS=64 DEFINES += __USE_W32_SOCKETS + RC_FILE = qbittorrent_mingw.rc LIBS += libadvapi32 libshell32 libuser32 libole32 libwsock32 libws2_32 From 8220f8d003dcd355b853047b82a4db44afcd11b0 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Sun, 23 Jun 2019 11:45:58 +0800 Subject: [PATCH 4/4] Remove MSVC-only compilation flags Our code base is able to compile without warnings even when these flags removed. --- winconf.pri | 2 -- 1 file changed, 2 deletions(-) diff --git a/winconf.pri b/winconf.pri index f26de480a..d90b603f0 100644 --- a/winconf.pri +++ b/winconf.pri @@ -11,8 +11,6 @@ DEFINES += _UNICODE DEFINES += WIN32 DEFINES += _WIN32 DEFINES += WIN32_LEAN_AND_MEAN -DEFINES += _CRT_SECURE_NO_DEPRECATE -DEFINES += _SCL_SECURE_NO_DEPRECATE DEFINES += NOMINMAX CONFIG(debug, debug|release) {