Change Jamfile default openssl path on Windows

The widely used Windows OpenSSL package[1] uses C:\OpenSSL-Win[32|64] as
the install location so set this as default in Jamfile for Windows. It
also means that the appveyor builds can be simplified by using their
installed OpenSSL.

Mingw is set to the same location so remove seperate specification.

[1]: https://slproweb.com/products/Win32OpenSSL.html
This commit is contained in:
Calum Lind 2018-12-01 18:44:13 +00:00 committed by Arvid Norberg
parent 5d711f4929
commit c76e9cc5e1
3 changed files with 9 additions and 39 deletions

27
Jamfile
View File

@ -359,20 +359,13 @@ rule openssl-lib-path ( properties * )
# brew install openssl # brew install openssl
OPENSSL_LIB = /usr/local/opt/openssl/lib ; OPENSSL_LIB = /usr/local/opt/openssl/lib ;
} }
else if <target-os>windows in $(properties)
&& <toolset>gcc in $(properties)
&& $(OPENSSL_LIB) = ""
{
# on mingw, assume openssl is installed in c:\OpenSSL-Win32 by default
OPENSSL_LIB = c:\\OpenSSL-Win32\\lib ;
}
else if <target-os>windows in $(properties) && $(OPENSSL_LIB) = "" else if <target-os>windows in $(properties) && $(OPENSSL_LIB) = ""
{ {
# on windows, just assume openssl is installed to c:\openssl # on windows, assume openssl is installed to c:\OpenSSL-Win32
if <address-model>64 in $(properties) if <address-model>64 in $(properties)
{ OPENSSL_LIB = c:\\openssl\\lib64 ; } { OPENSSL_LIB = c:\\OpenSSL-Win64\\lib ; }
else else
{ OPENSSL_LIB = c:\\openssl\\lib ; } { OPENSSL_LIB = c:\\OpenSSL-Win32\\lib ; }
} }
local result ; local result ;
@ -392,21 +385,13 @@ rule openssl-include-path ( properties * )
# brew install openssl # brew install openssl
OPENSSL_INCLUDE = /usr/local/opt/openssl/include ; OPENSSL_INCLUDE = /usr/local/opt/openssl/include ;
} }
else if <target-os>windows in $(properties)
&& <toolset>gcc in $(properties)
&& $(OPENSSL_INCLUDE) = ""
{
# on mingw, assume openssl is installed in c:\OpenSSL-Win32 by default
OPENSSL_INCLUDE = c:\\OpenSSL-Win32\\include ;
}
else if <target-os>windows in $(properties) && $(OPENSSL_INCLUDE) = "" else if <target-os>windows in $(properties) && $(OPENSSL_INCLUDE) = ""
{ {
# on windows, just assume openssl is installed to c:\openssl # on windows, assume openssl is installed to c:\OpenSSL-Win32
# not sure if there's a better way to find out where it may be
if <address-model>64 in $(properties) if <address-model>64 in $(properties)
{ OPENSSL_INCLUDE = c:\\openssl\\include64 ; } { OPENSSL_INCLUDE = c:\\OpenSSL-Win64\\include ; }
else else
{ OPENSSL_INCLUDE = c:\\openssl\\include ; } { OPENSSL_INCLUDE = c:\\OpenSSL-Win32\\include ; }
} }
local result ; local result ;

View File

@ -37,19 +37,6 @@ install:
- 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="" )
- if %compiler% == msvc-14.0 if defined crypto if not exist openssl-1.0.1p-vs2015.7z (
echo downloading openssl-2015
& appveyor DownloadFile "https://www.npcglib.org/~stathis/downloads/openssl-1.0.1p-vs2015.7z"
)
- if %compiler% == msvc-14.0 if defined crypto (
echo extracting openssl-2015
& 7z x -oc:\ -aoa openssl-1.0.1p-vs2015.7z > nul
& rename c:\openssl-1.0.1p-vs2015 openssl
& copy c:\openssl\lib64\ssleay32MT.lib c:\openssl\lib64\ssleay32.lib
& copy c:\openssl\lib64\libeay32MT.lib c:\openssl\lib64\libeay32.lib
& copy c:\openssl\lib\ssleay32MT.lib c:\openssl\lib\ssleay32.lib
& copy c:\openssl\lib\libeay32MT.lib c:\openssl\lib\libeay32.lib
)
- cd %ROOT_DIRECTORY% - cd %ROOT_DIRECTORY%
- set BOOST_ROOT=c:\Libraries\boost_1_63_0 - set BOOST_ROOT=c:\Libraries\boost_1_63_0
- set BOOST_BUILD_PATH=%BOOST_ROOT%\tools\build - set BOOST_BUILD_PATH=%BOOST_ROOT%\tools\build
@ -67,9 +54,6 @@ install:
- build.bat >nul - build.bat >nul
- cd %ROOT_DIRECTORY% - cd %ROOT_DIRECTORY%
cache:
- openssl-1.0.1p-vs2015.7z
build_script: build_script:
# examples # examples
- cd %ROOT_DIRECTORY%\examples - cd %ROOT_DIRECTORY%\examples

View File

@ -235,7 +235,8 @@ For more build configuration flags see `Build configurations`_.
When enabling linking against openssl (by setting the ``crypto`` feature to When enabling linking against openssl (by setting the ``crypto`` feature to
``openssl``) the Jamfile will look in some default directory for the openssl ``openssl``) the Jamfile will look in some default directory for the openssl
headers and libraries. On macOS, it will look for the homebrew openssl package. headers and libraries. On macOS, it will look for the homebrew openssl package.
On windows it will look in ``c:\openssl`` and MinGW in ``c:\OpenSSL-Win32``. On Windows, it will look in ``C:\OpenSSL-Win32``, or ``C:\OpenSSL-Win64`` if
compiling in 64-bit.
To customize the library path and include path for openssl, set the features To customize the library path and include path for openssl, set the features
``openssl-lib`` and ``openssl-include`` respectively. ``openssl-lib`` and ``openssl-include`` respectively.
@ -482,7 +483,7 @@ If you enabled test in the configuration step, to run them, run::
building with other build systems building with other build systems
--------------------------------- ---------------------------------
If you're building in MS Visual Studio, you may have to set the compiler If you're building in MS Visual Studio, you may have to set the compiler
options "force conformance in for loop scope", "treat wchar_t as built-in options "force conformance in for loop scope", "treat wchar_t as built-in
type" and "Enable Run-Time Type Info" to Yes. type" and "Enable Run-Time Type Info" to Yes.