From ec65e12ee61ca49f563613e2a6a5f75d60f9bf84 Mon Sep 17 00:00:00 2001 From: arvidn Date: Wed, 12 Jul 2017 00:34:48 -0700 Subject: [PATCH] add boost-build feature to link against libcrypto and libssl on windows #1931 --- Jamfile | 29 +++++++++++++++++++++-------- appveyor.yml | 12 ++++++------ docs/building.rst | 8 ++++++++ 3 files changed, 35 insertions(+), 14 deletions(-) diff --git a/Jamfile b/Jamfile index 99fcb5e65..496d51329 100644 --- a/Jamfile +++ b/Jamfile @@ -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 openssl in $(properties) { - # exclude gcc from a regular windows build to make mingw - # link against the regular unix library name - if windows in $(properties) - && ! gcc in $(properties) + if pre1.1 in $(properties) + && windows in $(properties) + && ! gcc in $(properties) { result += ssleay32 libeay32 - advapi32 - user32 - shell32 - gdi32 ; } else { + # on windows the library names were changed to be in line with other + # system starting with OpenSSL 1.1 result += crypto ssl ; } } + # windows needs some more libraries when using openSSL + if openssl in $(properties) + && windows in $(properties) + && ! gcc in $(properties) + { + result += advapi32 + user32 + shell32 + gdi32 + ; + } + if on in $(properties) { result += /libsimulator//simulator ; @@ -471,6 +482,8 @@ feature crypto : built-in openssl gcrypt : composite propagated ; feature.compose openssl : TORRENT_USE_OPENSSL ; feature.compose gcrypt : TORRENT_USE_GCRYPT ; +feature openssl-version : 1.1 pre1.1 : composite propagated ; + feature resolve-countries : on off : composite propagated link-incompatible ; feature.compose off : TORRENT_DISABLE_RESOLVE_COUNTRIES ; diff --git a/appveyor.yml b/appveyor.yml index 30b100eb3..808ce94ab 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -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: diff --git a/docs/building.rst b/docs/building.rst index 59963d9a6..dc6706495 100644 --- a/docs/building.rst +++ b/docs/building.rst @@ -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()`` |