From a9b3982f7cf70d05eec7c6083398bd61c268b2a7 Mon Sep 17 00:00:00 2001 From: arvidn Date: Thu, 13 Jul 2017 23:42:56 -0700 Subject: [PATCH] restore ssl/crypto build feature in Jamfile to stay compatible with 1.1 --- .travis.yml | 19 +++++++++---------- Jamfile | 28 +++++++++------------------- appveyor.yml | 21 +++++++++------------ docs/building.rst | 11 ++++------- 4 files changed, 31 insertions(+), 48 deletions(-) diff --git a/.travis.yml b/.travis.yml index 20ecb6cb8..207041aa7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ matrix: fast_finish: true include: - env: variant=test_debug lint=1 tests=1 toolset=gcc-sanitizer - - env: variant=test_debug sim=1 ssl=openssl crypto=libcrypto toolset=gcc-sanitizer + - env: variant=test_debug sim=1 crypto=openssl toolset=gcc-sanitizer - env: variant=test_release coverage=1 tests=1 toolset=gcc-coverage python=1 - env: autotools=1 toolset=gcc - os: osx @@ -12,7 +12,7 @@ matrix: env: variant=test_release docs=1 tests=1 toolset=darwin - os: osx osx_image: xcode7.3 - env: variant=test_debug ssl=openssl tests=1 crypto=libcrypto toolset=darwin + env: variant=test_debug crypto=openssl tests=1 toolset=darwin - os: osx osx_image: xcode7.3 env: variant=test_barebones tools=1 examples=1 toolset=darwin python=1 @@ -52,7 +52,6 @@ addons: before_install: - git submodule update --init --recursive - - 'if [[ $ssl == "" ]]; then export ssl=off; fi' - 'if [[ $crypto == "" ]]; then export crypto=built-in; fi' - 'if [[ $TRAVIS_OS_NAME == "osx" && ( "$tests" == "1" || "$sim" == 1 || "$examples" == "1" || "$tools" == "1" || "$python" == "1" ) ]]; then travis_retry brew update > /dev/null && brew install ccache boost-build; @@ -146,7 +145,7 @@ script: # libtorrent is the name of the test suite target - cd test - 'if [ "$tests" == "1" ]; then - travis_retry bjam -j3 warnings-as-errors=on ssl=$ssl crypto=$crypto debug-iterators=on picker-debugging=on invariant-checks=full $toolset variant=$variant libtorrent test_natpmp enum_if -l300 && + travis_retry bjam -j3 warnings-as-errors=on crypto=$crypto debug-iterators=on picker-debugging=on invariant-checks=full $toolset variant=$variant libtorrent test_natpmp enum_if -l300 && if [ "$coverage" == "1" ]; then codecov --root .. --gcov-exec gcov-5; fi; @@ -154,13 +153,13 @@ script: - cd ../examples - 'if [ "$examples" == "1" ]; then - bjam -j3 warnings-as-errors=on ssl=$ssl crypto=$crypto debug-iterators=on picker-debugging=on invariant-checks=full $toolset variant=$variant link=shared; + bjam -j3 warnings-as-errors=on crypto=$crypto debug-iterators=on picker-debugging=on invariant-checks=full $toolset variant=$variant link=shared; fi' - cd .. - cd tools - 'if [ "$tools" == "1" ]; then - bjam -j3 warnings-as-errors=on ssl=$ssl crypto=$crypto debug-iterators=on picker-debugging=on invariant-checks=full $toolset variant=$variant link=shared; + bjam -j3 warnings-as-errors=on crypto=$crypto debug-iterators=on picker-debugging=on invariant-checks=full $toolset variant=$variant link=shared; fi' - cd .. @@ -169,13 +168,13 @@ script: # as the main library, so we cannot stage them to the same directory # here we specify the temporary lib dir as a path to look for the main library - 'if [ "$python" == "1" ]; then - bjam -j3 warnings-as-errors=on ssl=$ssl crypto=$crypto debug-iterators=on picker-debugging=on invariant-checks=full $toolset variant=$variant link=shared install location=./lib; + bjam -j3 warnings-as-errors=on crypto=$crypto debug-iterators=on picker-debugging=on invariant-checks=full $toolset variant=$variant link=shared install location=./lib; fi' # a binary built with sanitizer does not interact well with python - cd bindings/python - 'if [[ "$python" == "1" ]]; then - bjam -j3 warnings-as-errors=on ssl=$ssl crypto=$crypto debug-iterators=on picker-debugging=on invariant-checks=full $toolset variant=$variant stage_module libtorrent-link=shared install-type=LIB dll-path=../../lib && + bjam -j3 warnings-as-errors=on crypto=$crypto debug-iterators=on picker-debugging=on invariant-checks=full $toolset variant=$variant stage_module libtorrent-link=shared install-type=LIB dll-path=../../lib && LD_LIBRARY_PATH=../../lib DYLD_LIBRARY_PATH=../../lib python test.py; fi' - cd ../..; @@ -183,7 +182,7 @@ script: # simulation - cd simulation - 'if [[ "$sim" == "1" ]]; then - bjam -j2 crypto=built-in ssl=off warnings-as-errors=on debug-iterators=on picker-debugging=on invariant-checks=full $toolset; + bjam -j2 crypto=built-in warnings-as-errors=on debug-iterators=on picker-debugging=on invariant-checks=full $toolset; fi' - cd .. @@ -202,6 +201,6 @@ script: - cd test - 'if [[ "$arch" == "arm" ]]; then - bjam arm-tests warnings-as-errors=on ssl=$ssl crypto=$crypto variant=test_arm $toolset target-os=linux link=static testing.launcher="sudo cp -R bin rootfs/; sudo chroot rootfs"; + bjam arm-tests warnings-as-errors=on crypto=$crypto variant=test_arm $toolset target-os=linux link=static testing.launcher="sudo cp -R bin rootfs/; sudo chroot rootfs"; fi' - cd .. diff --git a/Jamfile b/Jamfile index 35ef1ef46..3b556aa4c 100644 --- a/Jamfile +++ b/Jamfile @@ -51,31 +51,22 @@ rule linking ( properties * ) { local result ; - # ssl=openssl => crypto=libcrypto - # this match the previous behavior - if openssl in $(properties) - && ! libcrypto in $(properties) - { - ECHO "with ssl=openssl the value for crypto must be libcrypto" ; - result += no ; - } - # openssl libraries, if enabled # exclude gcc from a regular windows build to make mingw # link against the regular unix library name - if openssl in $(properties) + if openssl in $(properties) { if pre1.1 in $(properties) && windows in $(properties) && ! gcc in $(properties) { - result += ssleay32 ; + result += ssleay32 libeay32 ; } else { # on windows the library names were changed to be in line with other # system starting with OpenSSL 1.1 - result += ssl ; + result += crypto ssl ; } } @@ -97,7 +88,8 @@ rule linking ( properties * ) } # windows needs some more libraries when using openSSL - if openssl in $(properties) + if ( openssl in $(properties) + || libcrypto in $(propertes) ) && windows in $(properties) && ! gcc in $(properties) { @@ -124,7 +116,7 @@ rule linking ( properties * ) } # gcrypt libraries, if enabled - if libgcrypt in $(properties) + if gcrypt in $(properties) { result += gcrypt ; } @@ -466,15 +458,13 @@ feature.compose off : TORRENT_DISABLE_ENCRYPTION ; feature mutable-torrents : on off : composite propagated link-incompatible ; feature.compose off : TORRENT_DISABLE_MUTABLE_TORRENTS ; -feature crypto : built-in libcrypto libgcrypt : composite propagated ; +feature crypto : built-in openssl libcrypto gcrypt : composite propagated ; +feature.compose openssl : TORRENT_USE_LIBCRYPTO TORRENT_USE_OPENSSL OPENSSL_NO_SSL2 ; feature.compose libcrypto : TORRENT_USE_LIBCRYPTO ; -feature.compose libgcrypt : TORRENT_USE_LIBGCRYPT ; +feature.compose gcrypt : TORRENT_USE_LIBGCRYPT ; feature openssl-version : 1.1 pre1.1 : composite propagated ; -feature ssl : off openssl : composite propagated ; -feature.compose openssl : TORRENT_USE_OPENSSL OPENSSL_NO_SSL2 ; - feature deprecated-functions : on off : composite propagated link-incompatible ; feature.compose off : TORRENT_NO_DEPRECATE ; diff --git a/appveyor.yml b/appveyor.yml index 20b9bbfb7..1fd84ed86 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -19,15 +19,13 @@ environment: compiler: msvc-14.0 model: 64 python: 1 - ssl: openssl - crypto: libcrypto + crypto: openssl linkflags: 'linkflags="/LIBPATH:C:\\openssl-1.0.1p-vs2015\\lib64"' include: 'include="c:\\openssl-1.0.1p-vs2015\\include"' - variant: test_debug compiler: gcc model: 32 - ssl: openssl - crypto: libcrypto + crypto: openssl linkflags: 'linkflags="-LC:\\OpenSSL-Win32\\lib"' include: 'include="c:\\OpenSSL-Win32\\include"' @@ -35,11 +33,11 @@ install: - if defined sim ( git submodule update --init --recursive ) - set ROOT_DIRECTORY=%CD% - cd %ROOT_DIRECTORY% -- if %compiler% == msvc-14.0 if defined ssl if not exist openssl-1.0.1p-vs2015.7z ( +- if %compiler% == msvc-14.0 if defined crypto if not exist openssl-1.0.1p-vs2015.7z ( echo downloading openssl-2015 & appveyor DownloadFile "http://www.npcglib.org/~stathis/downloads/openssl-1.0.1p-vs2015.7z" ) -- if %compiler% == msvc-14.0 if defined ssl ( +- if %compiler% == msvc-14.0 if defined crypto ( echo extracting openssl-2015 & 7z x -oc:\ -aoa openssl-1.0.1p-vs2015.7z > nul & copy c:\openssl-1.0.1p-vs2015\lib64\ssleay32MT.lib c:\openssl-1.0.1p-vs2015\lib64\ssleay32.lib @@ -47,7 +45,6 @@ install: & copy c:\openssl-1.0.1p-vs2015\lib\ssleay32MT.lib c:\openssl-1.0.1p-vs2015\lib\ssleay32.lib & copy c:\openssl-1.0.1p-vs2015\lib\libeay32MT.lib c:\openssl-1.0.1p-vs2015\lib\libeay32.lib ) -- if not defined ssl ( set ssl=off ) - if not defined crypto ( set crypto=built-in ) - if not defined linkflags ( set linkflags="" ) - if not defined include ( set include="" ) @@ -74,21 +71,21 @@ cache: build_script: # examples - cd %ROOT_DIRECTORY%\examples -- b2.exe --hash openssl-version=pre1.1 warnings-as-errors=on -j2 %compiler% address-model=%model% debug-iterators=on picker-debugging=on invariant-checks=full variant=%variant% %linkflags% %include% link=shared ssl=%ssl% crypto=%crypto% +- b2.exe --hash openssl-version=pre1.1 warnings-as-errors=on -j2 %compiler% address-model=%model% debug-iterators=on picker-debugging=on invariant-checks=full variant=%variant% %linkflags% %include% link=shared crypto=%crypto% crypto=%crypto% # tools - cd %ROOT_DIRECTORY%\tools -- b2.exe --hash openssl-version=pre1.1 warnings-as-errors=on -j2 %compiler% address-model=%model% debug-iterators=on picker-debugging=on invariant-checks=full variant=%variant% %linkflags% %include% link=shared ssl=%ssl% crypto=%crypto% +- b2.exe --hash openssl-version=pre1.1 warnings-as-errors=on -j2 %compiler% address-model=%model% debug-iterators=on picker-debugging=on invariant-checks=full variant=%variant% %linkflags% %include% link=shared crypto=%crypto% crypto=%crypto% # test - cd %ROOT_DIRECTORY%\test -- b2.exe --hash openssl-version=pre1.1 warnings-as-errors=on -j2 %compiler% address-model=%model% debug-iterators=on picker-debugging=on invariant-checks=full variant=%variant% %linkflags% %include% link=shared ssl=%ssl% crypto=%crypto% win-tests test_upnp test_natpmp testing.execute=off +- b2.exe --hash openssl-version=pre1.1 warnings-as-errors=on -j2 %compiler% address-model=%model% debug-iterators=on picker-debugging=on invariant-checks=full variant=%variant% %linkflags% %include% link=shared crypto=%crypto% crypto=%crypto% win-tests test_upnp test_natpmp testing.execute=off # python binding - cd %ROOT_DIRECTORY%\bindings\python # we use 64 bit python builds - if defined python ( - b2.exe --hash openssl-version=pre1.1 warnings-as-errors=on -j2 %compiler% address-model=%model% debug-iterators=on picker-debugging=on invariant-checks=full variant=%variant% %linkflags% %include% link=shared ssl=%ssl% crypto=%crypto% libtorrent-link=shared stage_module install-dependencies=on + b2.exe --hash openssl-version=pre1.1 warnings-as-errors=on -j2 %compiler% address-model=%model% debug-iterators=on picker-debugging=on invariant-checks=full variant=%variant% %linkflags% %include% link=shared crypto=%crypto% crypto=%crypto% libtorrent-link=shared stage_module install-dependencies=on ) # simulations @@ -99,7 +96,7 @@ build_script: test_script: - cd %ROOT_DIRECTORY%\test -- appveyor-retry b2.exe -l400 --hash openssl-version=pre1.1 warnings-as-errors=on -j2 %compiler% address-model=%model% debug-iterators=on picker-debugging=on invariant-checks=full variant=%variant% %linkflags% %include% link=shared ssl=%ssl% crypto=%crypto% win-tests +- appveyor-retry b2.exe -l400 --hash openssl-version=pre1.1 warnings-as-errors=on -j2 %compiler% address-model=%model% debug-iterators=on picker-debugging=on invariant-checks=full variant=%variant% %linkflags% %include% link=shared crypto=%crypto% crypto=%crypto% win-tests - cd %ROOT_DIRECTORY%\bindings\python # we use 64 bit python build diff --git a/docs/building.rst b/docs/building.rst index 5d491c2e9..dc5a8d487 100644 --- a/docs/building.rst +++ b/docs/building.rst @@ -279,17 +279,14 @@ Build features: | ``crypto`` | * ``built-in`` - (default) uses built-in SHA-1 | | | implementation. In macOS/iOS it uses | | | CommonCrypto SHA-1 implementation. | +| | * ``openssl`` - links against openssl to enable | +| | torrents over ssl feature. | +| | the option crypto=libcrypto. | | | * ``libcrypto`` - links against libcrypto | | | to use the SHA-1 implementation. | -| | * ``libgcrypt`` - links against libgcrypt | +| | * ``gcrypt`` - links against libgcrypt | | | to use the SHA-1 implementation. | +--------------------------+----------------------------------------------------+ -| ``ssl`` | * ``off`` - (default) disable torrents over ssl | -| | feature. | -| | * ``openssl`` - links against openssl to enable | -| | torrents over ssl feature. Requires | -| | the option crypto=libcrypto. | -+--------------------------+----------------------------------------------------+ | ``openssl-version`` | This can be used on windows to link against the | | | special OpenSSL library names used on windows | | | prior to OpenSSL 1.1. |