restore ssl/crypto build feature in Jamfile to stay compatible with 1.1

This commit is contained in:
arvidn 2017-07-13 23:42:56 -07:00 committed by Arvid Norberg
parent bff09a70fe
commit a9b3982f7c
4 changed files with 31 additions and 48 deletions

View File

@ -4,7 +4,7 @@ matrix:
fast_finish: true fast_finish: true
include: include:
- env: variant=test_debug lint=1 tests=1 toolset=gcc-sanitizer - 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: variant=test_release coverage=1 tests=1 toolset=gcc-coverage python=1
- env: autotools=1 toolset=gcc - env: autotools=1 toolset=gcc
- os: osx - os: osx
@ -12,7 +12,7 @@ matrix:
env: variant=test_release docs=1 tests=1 toolset=darwin env: variant=test_release docs=1 tests=1 toolset=darwin
- os: osx - os: osx
osx_image: xcode7.3 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 - os: osx
osx_image: xcode7.3 osx_image: xcode7.3
env: variant=test_barebones tools=1 examples=1 toolset=darwin python=1 env: variant=test_barebones tools=1 examples=1 toolset=darwin python=1
@ -52,7 +52,6 @@ addons:
before_install: before_install:
- git submodule update --init --recursive - git submodule update --init --recursive
- 'if [[ $ssl == "" ]]; then export ssl=off; fi'
- 'if [[ $crypto == "" ]]; then export crypto=built-in; 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 - '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; 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 # libtorrent is the name of the test suite target
- cd test - cd test
- 'if [ "$tests" == "1" ]; then - '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 if [ "$coverage" == "1" ]; then
codecov --root .. --gcov-exec gcov-5; codecov --root .. --gcov-exec gcov-5;
fi; fi;
@ -154,13 +153,13 @@ script:
- cd ../examples - cd ../examples
- 'if [ "$examples" == "1" ]; then - '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' fi'
- cd .. - cd ..
- cd tools - cd tools
- 'if [ "$tools" == "1" ]; then - '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' fi'
- cd .. - cd ..
@ -169,13 +168,13 @@ script:
# as the main library, so we cannot stage them to the same directory # 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 # here we specify the temporary lib dir as a path to look for the main library
- 'if [ "$python" == "1" ]; then - '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' fi'
# a binary built with sanitizer does not interact well with python # a binary built with sanitizer does not interact well with python
- cd bindings/python - cd bindings/python
- 'if [[ "$python" == "1" ]]; then - '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; LD_LIBRARY_PATH=../../lib DYLD_LIBRARY_PATH=../../lib python test.py;
fi' fi'
- cd ../..; - cd ../..;
@ -183,7 +182,7 @@ script:
# simulation # simulation
- cd simulation - cd simulation
- 'if [[ "$sim" == "1" ]]; then - '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' fi'
- cd .. - cd ..
@ -202,6 +201,6 @@ script:
- cd test - cd test
- 'if [[ "$arch" == "arm" ]]; - 'if [[ "$arch" == "arm" ]];
then 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' fi'
- cd .. - cd ..

28
Jamfile
View File

@ -51,31 +51,22 @@ rule linking ( properties * )
{ {
local result ; local result ;
# ssl=openssl => crypto=libcrypto
# this match the previous behavior
if <ssl>openssl in $(properties)
&& ! <crypto>libcrypto in $(properties)
{
ECHO "with ssl=openssl the value for crypto must be libcrypto" ;
result += <build>no ;
}
# openssl libraries, if enabled # openssl libraries, if enabled
# exclude gcc from a regular windows build to make mingw # exclude gcc from a regular windows build to make mingw
# link against the regular unix library name # link against the regular unix library name
if <ssl>openssl in $(properties) if <crypto>openssl in $(properties)
{ {
if <openssl-version>pre1.1 in $(properties) if <openssl-version>pre1.1 in $(properties)
&& <target-os>windows in $(properties) && <target-os>windows in $(properties)
&& ! <toolset>gcc in $(properties) && ! <toolset>gcc in $(properties)
{ {
result += <library>ssleay32 ; result += <library>ssleay32 <library>libeay32 ;
} }
else else
{ {
# on windows the library names were changed to be in line with other # on windows the library names were changed to be in line with other
# system starting with OpenSSL 1.1 # system starting with OpenSSL 1.1
result += <library>ssl ; result += <library>crypto <library>ssl ;
} }
} }
@ -97,7 +88,8 @@ rule linking ( properties * )
} }
# windows needs some more libraries when using openSSL # windows needs some more libraries when using openSSL
if <ssl>openssl in $(properties) if ( <crypto>openssl in $(properties)
|| <crypto>libcrypto in $(propertes) )
&& <target-os>windows in $(properties) && <target-os>windows in $(properties)
&& ! <toolset>gcc in $(properties) && ! <toolset>gcc in $(properties)
{ {
@ -124,7 +116,7 @@ rule linking ( properties * )
} }
# gcrypt libraries, if enabled # gcrypt libraries, if enabled
if <crypto>libgcrypt in $(properties) if <crypto>gcrypt in $(properties)
{ {
result += <library>gcrypt ; result += <library>gcrypt ;
} }
@ -466,15 +458,13 @@ feature.compose <encryption>off : <define>TORRENT_DISABLE_ENCRYPTION ;
feature mutable-torrents : on off : composite propagated link-incompatible ; feature mutable-torrents : on off : composite propagated link-incompatible ;
feature.compose <mutable-torrents>off : <define>TORRENT_DISABLE_MUTABLE_TORRENTS ; feature.compose <mutable-torrents>off : <define>TORRENT_DISABLE_MUTABLE_TORRENTS ;
feature crypto : built-in libcrypto libgcrypt : composite propagated ; feature crypto : built-in openssl libcrypto gcrypt : composite propagated ;
feature.compose <crypto>openssl : <define>TORRENT_USE_LIBCRYPTO <define>TORRENT_USE_OPENSSL <define>OPENSSL_NO_SSL2 ;
feature.compose <crypto>libcrypto : <define>TORRENT_USE_LIBCRYPTO ; feature.compose <crypto>libcrypto : <define>TORRENT_USE_LIBCRYPTO ;
feature.compose <crypto>libgcrypt : <define>TORRENT_USE_LIBGCRYPT ; feature.compose <crypto>gcrypt : <define>TORRENT_USE_LIBGCRYPT ;
feature openssl-version : 1.1 pre1.1 : composite propagated ; feature openssl-version : 1.1 pre1.1 : composite propagated ;
feature ssl : off openssl : composite propagated ;
feature.compose <ssl>openssl : <define>TORRENT_USE_OPENSSL <define>OPENSSL_NO_SSL2 ;
feature deprecated-functions : on off : composite propagated link-incompatible ; feature deprecated-functions : on off : composite propagated link-incompatible ;
feature.compose <deprecated-functions>off : <define>TORRENT_NO_DEPRECATE ; feature.compose <deprecated-functions>off : <define>TORRENT_NO_DEPRECATE ;

View File

@ -19,15 +19,13 @@ environment:
compiler: msvc-14.0 compiler: msvc-14.0
model: 64 model: 64
python: 1 python: 1
ssl: openssl crypto: openssl
crypto: libcrypto
linkflags: 'linkflags="/LIBPATH:C:\\openssl-1.0.1p-vs2015\\lib64"' linkflags: 'linkflags="/LIBPATH:C:\\openssl-1.0.1p-vs2015\\lib64"'
include: 'include="c:\\openssl-1.0.1p-vs2015\\include"' include: 'include="c:\\openssl-1.0.1p-vs2015\\include"'
- variant: test_debug - variant: test_debug
compiler: gcc compiler: gcc
model: 32 model: 32
ssl: openssl crypto: openssl
crypto: libcrypto
linkflags: 'linkflags="-LC:\\OpenSSL-Win32\\lib"' linkflags: 'linkflags="-LC:\\OpenSSL-Win32\\lib"'
include: 'include="c:\\OpenSSL-Win32\\include"' include: 'include="c:\\OpenSSL-Win32\\include"'
@ -35,11 +33,11 @@ install:
- if defined sim ( git submodule update --init --recursive ) - if defined sim ( git submodule update --init --recursive )
- set ROOT_DIRECTORY=%CD% - set ROOT_DIRECTORY=%CD%
- cd %ROOT_DIRECTORY% - 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 echo downloading openssl-2015
& appveyor DownloadFile "http://www.npcglib.org/~stathis/downloads/openssl-1.0.1p-vs2015.7z" & 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 echo extracting openssl-2015
& 7z x -oc:\ -aoa openssl-1.0.1p-vs2015.7z > nul & 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 & 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\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 & 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 crypto ( set crypto=built-in )
- if not defined linkflags ( set linkflags="" ) - if not defined linkflags ( set linkflags="" )
- if not defined include ( set include="" ) - if not defined include ( set include="" )
@ -74,21 +71,21 @@ cache:
build_script: build_script:
# examples # examples
- cd %ROOT_DIRECTORY%\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 # tools
- cd %ROOT_DIRECTORY%\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 # test
- cd %ROOT_DIRECTORY%\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 # python binding
- cd %ROOT_DIRECTORY%\bindings\python - cd %ROOT_DIRECTORY%\bindings\python
# we use 64 bit python builds # we use 64 bit python builds
- if defined python ( - 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 # simulations
@ -99,7 +96,7 @@ build_script:
test_script: test_script:
- cd %ROOT_DIRECTORY%\test - 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 - cd %ROOT_DIRECTORY%\bindings\python
# we use 64 bit python build # we use 64 bit python build

View File

@ -279,17 +279,14 @@ Build features:
| ``crypto`` | * ``built-in`` - (default) uses built-in SHA-1 | | ``crypto`` | * ``built-in`` - (default) uses built-in SHA-1 |
| | implementation. In macOS/iOS it uses | | | implementation. In macOS/iOS it uses |
| | CommonCrypto SHA-1 implementation. | | | CommonCrypto SHA-1 implementation. |
| | * ``openssl`` - links against openssl to enable |
| | torrents over ssl feature. |
| | the option crypto=libcrypto. |
| | * ``libcrypto`` - links against libcrypto | | | * ``libcrypto`` - links against libcrypto |
| | to use the SHA-1 implementation. | | | to use the SHA-1 implementation. |
| | * ``libgcrypt`` - links against libgcrypt | | | * ``gcrypt`` - links against libgcrypt |
| | to use the SHA-1 implementation. | | | 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 | | ``openssl-version`` | This can be used on windows to link against the |
| | special OpenSSL library names used on windows | | | special OpenSSL library names used on windows |
| | prior to OpenSSL 1.1. | | | prior to OpenSSL 1.1. |