add boost-build feature to link against libcrypto and libssl on windows #1931

This commit is contained in:
arvidn 2017-07-12 00:34:48 -07:00 committed by Arvid Norberg
parent cc30434c52
commit ec65e12ee6
3 changed files with 35 additions and 14 deletions

29
Jamfile
View File

@ -67,27 +67,38 @@ rule linking ( properties * )
local result ;
# openssl libraries, if enabled
# exclude gcc from a regular windows build to make mingw
# link against the regular unix library name
if <crypto>openssl in $(properties)
{
# exclude gcc from a regular windows build to make mingw
# link against the regular unix library name
if <target-os>windows in $(properties)
&& ! <toolset>gcc in $(properties)
if <openssl-version>pre1.1 in $(properties)
&& <target-os>windows in $(properties)
&& ! <toolset>gcc in $(properties)
{
result += <library>ssleay32
<library>libeay32
<library>advapi32
<library>user32
<library>shell32
<library>gdi32
;
}
else
{
# on windows the library names were changed to be in line with other
# system starting with OpenSSL 1.1
result += <library>crypto <library>ssl ;
}
}
# windows needs some more libraries when using openSSL
if <crypto>openssl in $(properties)
&& <target-os>windows in $(properties)
&& ! <toolset>gcc in $(properties)
{
result += <library>advapi32
<library>user32
<library>shell32
<library>gdi32
;
}
if <simulator>on in $(properties)
{
result += <library>/libsimulator//simulator ;
@ -471,6 +482,8 @@ feature crypto : built-in openssl gcrypt : composite propagated ;
feature.compose <crypto>openssl : <define>TORRENT_USE_OPENSSL ;
feature.compose <crypto>gcrypt : <define>TORRENT_USE_GCRYPT ;
feature openssl-version : 1.1 pre1.1 : composite propagated ;
feature resolve-countries : on off : composite propagated link-incompatible ;
feature.compose <resolve-countries>off : <define>TORRENT_DISABLE_RESOLVE_COUNTRIES ;

View File

@ -117,12 +117,12 @@ build_script:
- if not defined x64 (
cd %ROOT_DIRECTORY%\examples
& if %compiler% == msvc-14.0 (
b2.exe --hash -j2 address-model=32 %compiler% variant=%variant% debug-iterators=on picker-debugging=on invariant-checks=full linkflags=%linkflags% include=%include% link=shared bt-get bt-get2
b2.exe --hash -j2 openssl-version=pre1.1 address-model=32 %compiler% variant=%variant% debug-iterators=on picker-debugging=on invariant-checks=full linkflags=%linkflags% include=%include% link=shared bt-get bt-get2
) else (
b2.exe --hash -j2 address-model=32 %compiler% variant=%variant% debug-iterators=on picker-debugging=on invariant-checks=full linkflags=%linkflags% include=%include% link=shared
b2.exe --hash -j2 openssl-version=pre1.1 address-model=32 %compiler% variant=%variant% debug-iterators=on picker-debugging=on invariant-checks=full linkflags=%linkflags% include=%include% link=shared
)
& cd %ROOT_DIRECTORY%\bindings\python
& b2.exe --hash -j2 %compiler% stage_module install-dependencies=on variant=%variant% libtorrent-link=shared linkflags=%linkflags% include=%include%
& b2.exe --hash -j2 openssl-version=pre1.1 %compiler% stage_module install-dependencies=on variant=%variant% libtorrent-link=shared linkflags=%linkflags% include=%include%
& python test.py
& if defined python_package ( python setup.py --bjam bdist_msi )
)
@ -130,13 +130,13 @@ build_script:
test_script:
- cd %ROOT_DIRECTORY%\test
- if defined x64 (
appveyor-retry b2.exe --hash -j2 address-model=64 win-tests %compiler% variant=%variant% link=shared linkflags=%linkflags% include=%include%
appveyor-retry b2.exe --hash -j2 openssl-version=pre1.1 address-model=64 win-tests %compiler% variant=%variant% link=shared linkflags=%linkflags% include=%include%
) else (
appveyor-retry b2.exe --hash -j2 address-model=32 win-tests %compiler% variant=%variant% link=shared linkflags=%linkflags% include=%include%
appveyor-retry b2.exe --hash -j2 openssl-version=pre1.1 address-model=32 win-tests %compiler% variant=%variant% link=shared linkflags=%linkflags% include=%include%
)
- if defined sim (
cd %ROOT_DIRECTORY%\simulation
& b2.exe --hash -j2 link=shared crypto=built-in %compiler%
& b2.exe --hash -j2 openssl-version=pre1.1 link=shared crypto=built-in %compiler%
)
artifacts:

View File

@ -283,6 +283,14 @@ Build features:
| | * ``gcrypt`` - links against libgcrypt to use for |
| | SHA-1 hashing. |
+--------------------------+----------------------------------------------------+
| ``openssl-version`` | This can be used on windows to link against the |
| | special OpenSSL library names used on windows |
| | prior to OpenSSL 1.1. |
| | * ``1.1`` - link against the normal openssl |
| | library name. (default) |
| | * ``pre1.1`` - link against the old windows names |
| | (i.e. ``ssleay32`` and ``libeay32``. |
+--------------------------+----------------------------------------------------+
| ``allocator`` | * ``pool`` - default, uses pool allocators for |
| | send buffers. |
| | * ``system`` - uses ``malloc()`` and ``free()`` |