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
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 ..

28
Jamfile
View File

@ -51,31 +51,22 @@ rule linking ( properties * )
{
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
# exclude gcc from a regular windows build to make mingw
# link against the regular unix library name
if <ssl>openssl in $(properties)
if <crypto>openssl in $(properties)
{
if <openssl-version>pre1.1 in $(properties)
&& <target-os>windows in $(properties)
&& ! <toolset>gcc in $(properties)
{
result += <library>ssleay32 ;
result += <library>ssleay32 <library>libeay32 ;
}
else
{
# on windows the library names were changed to be in line with other
# 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
if <ssl>openssl in $(properties)
if ( <crypto>openssl in $(properties)
|| <crypto>libcrypto in $(propertes) )
&& <target-os>windows in $(properties)
&& ! <toolset>gcc in $(properties)
{
@ -124,7 +116,7 @@ rule linking ( properties * )
}
# gcrypt libraries, if enabled
if <crypto>libgcrypt in $(properties)
if <crypto>gcrypt in $(properties)
{
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.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>libgcrypt : <define>TORRENT_USE_LIBGCRYPT ;
feature.compose <crypto>gcrypt : <define>TORRENT_USE_LIBGCRYPT ;
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.compose <deprecated-functions>off : <define>TORRENT_NO_DEPRECATE ;

View File

@ -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

View File

@ -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. |