Add Microsofts openssl fork which supports the UWP platform

This commit is contained in:
Patrick Dehne 2016-11-04 13:09:13 +01:00
parent d5d997bd7d
commit c1a87697dd
4 changed files with 309 additions and 0 deletions

View File

@ -0,0 +1,3 @@
Source: openssl-microsoft
Version: 1.0.2-winrt-stable
Description: OpenSSL is an open source project that provides a robust, commercial-grade, and full-featured toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols. It is also a general-purpose cryptography library. This is Microsofts fork of openssl that supports Windows Phone and Store apps.

View File

@ -0,0 +1,10 @@
set build=%1
perl Configure no-asm no-hw no-dso VC-WINUNIVERSAL
call ms\do_winuniversal.bat
call ms\setVSvars.bat universal10.0%build%
nmake -f ms\ntdll.mak

View File

@ -0,0 +1,111 @@
# Common Ambient Variables:
# VCPKG_ROOT_DIR = <C:\path\to\current\vcpkg>
# TARGET_TRIPLET is the current triplet (x86-windows, etc)
# PORT is the current port name (zlib, etc)
# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT}
# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET}
#
include(${CMAKE_TRIPLET_FILE})
if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
message(FATAL_ERROR "Static building not supported yet")
endif()
if (TARGET_TRIPLET MATCHES "arm-uwp")
set(UWP_PLATFORM "arm")
elseif (TARGET_TRIPLET MATCHES "x64-uwp")
set(UWP_PLATFORM "x64")
elseif (TARGET_TRIPLET MATCHES "x86-uwp")
set(UWP_PLATFORM "Win32")
else ()
message(FATAL_ERROR "Only UWP DLL builds are supported at the moment")
endif()
include(vcpkg_common_functions)
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/openssl-OpenSSL_1_0_2_WinRT-stable)
vcpkg_find_acquire_program(PERL)
get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY)
set(ENV{PATH} "${PERL_EXE_PATH};$ENV{PATH}")
vcpkg_download_distfile(ARCHIVE
URLS "https://github.com/Microsoft/openssl/archive/OpenSSL_1_0_2_WinRT-stable.zip"
FILENAME "openssl-microsoft-1.0.2.zip"
SHA512 f265b7dbeca6b86815dbc14af9f2b6688407efd921eb335b1acf5a642dddb6b6334a794fe0939666d9db66976db11a67ad78a3ed74484708d3bf2040aae598d2
)
vcpkg_extract_source_archive(${ARCHIVE})
# file(REMOVE_RECURSE ${SOURCE_PATH}/tmp32dll)
# file(REMOVE_RECURSE ${SOURCE_PATH}/out32dll)
# file(REMOVE_RECURSE ${SOURCE_PATH}/inc32dll)
file(COPY
${CMAKE_CURRENT_LIST_DIR}/setVSvars.bat
DESTINATION ${SOURCE_PATH}/ms)
file(COPY
${CMAKE_CURRENT_LIST_DIR}/make-openssl.bat
DESTINATION ${SOURCE_PATH})
message(STATUS "Build ${TARGET_TRIPLET}")
vcpkg_execute_required_process(
COMMAND ${SOURCE_PATH}/make-openssl.bat ${UWP_PLATFORM}
WORKING_DIRECTORY ${SOURCE_PATH}
LOGNAME make-openssl-${TARGET_TRIPLET}
)
message(STATUS "Build ${TARGET_TRIPLET} done")
file(
COPY ${SOURCE_PATH}/inc32/openssl
DESTINATION ${CURRENT_PACKAGES_DIR}/include
)
file(INSTALL ${SOURCE_PATH}/out32dll/libeay32.dll
DESTINATION ${CURRENT_PACKAGES_DIR}/bin)
file(INSTALL ${SOURCE_PATH}/out32dll/libeay32.pdb
DESTINATION ${CURRENT_PACKAGES_DIR}/bin)
file(INSTALL ${SOURCE_PATH}/out32dll/libeay32.lib
DESTINATION ${CURRENT_PACKAGES_DIR}/lib)
file(INSTALL ${SOURCE_PATH}/out32dll/ssleay32.dll
DESTINATION ${CURRENT_PACKAGES_DIR}/bin)
file(INSTALL ${SOURCE_PATH}/out32dll/ssleay32.pdb
DESTINATION ${CURRENT_PACKAGES_DIR}/bin)
file(INSTALL ${SOURCE_PATH}/out32dll/ssleay32.lib
DESTINATION ${CURRENT_PACKAGES_DIR}/lib)
file(INSTALL ${SOURCE_PATH}/out32dll/libeay32.dll
DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin)
file(INSTALL ${SOURCE_PATH}/out32dll/libeay32.pdb
DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin)
file(INSTALL ${SOURCE_PATH}/out32dll/libeay32.lib
DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib)
file(INSTALL ${SOURCE_PATH}/out32dll/ssleay32.dll
DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin)
file(INSTALL ${SOURCE_PATH}/out32dll/ssleay32.pdb
DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin)
file(INSTALL ${SOURCE_PATH}/out32dll/ssleay32.lib
DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib)
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/openssl-microsoft RENAME copyright)

View File

@ -0,0 +1,185 @@
@echo off
call:set_%1
exit /b
:set_universal10.0Win32
call:setVar _VS14VC VisualStudio14VC
call "%_VS14VC%vcvarsall" x86
set _VCPlatform=x86
set _VCLibPlat=
call:setEnv
goto :eof
:set_universal10.0x64
call:setVar _VS14VC VisualStudio14VC
call "%_VS14VC%vcvarsall" x64
set _VCPlatform=x64
set _VCLibPlat=amd64
call:setEnv
goto :eof
:set_universal10.0arm
call:setVar _VS14VC VisualStudio14VC
call "%_VS14VC%vcvarsall" x86_arm
set _VCPlatform=ARM
set _VCLibPlat=ARM
call:setEnv
goto :eof
:set_universal10.0arm64
call:setVar _VS14VC VisualStudio14VC
call "%_VS14VC%vcvarsall" x86_arm64
set _VCPlatform=ARM64
set _VCLibPlat=ARM64
call:setEnv
goto :eof
:set_wp8.1arm
call:setVar _VS12VC VisualStudio12VC
call:setVar _WPKITS81 WindowsPhoneKits8.1
call:setVar _VS14VC VisualStudio14VC
call "%_VS12VC%\vcvarsall" x86_arm
set PATH=%_VS12VC\Bin%;%PATH%
set INCLUDE=%_WPKITS81%\Include;%_WPKITS81%\Include\abi;%_WPKITS81%\Include\mincore;%_WPKITS81%\Include\minwin;%_WPKITS81%\Include\wrl;%INCLUDE%
set LIB=%_WPKITS81%\lib\ARM;%_VS12VC%\lib\store\ARM;
set LIBPATH=%LIBPATH%;%_VS12VC%\vcpackages;%WindowsSDK_ExecutablePath_x86%\..\..\Tools\MDILXAPCompile\WinMDs;%_VS14VC%\vcpackages;
goto :eof
:set_wp8.1Win32
call:setVar _VS12VC VisualStudio12VC
call:setVar _WPKITS81 WindowsPhoneKits8.1
call:setVar _VS14VC VisualStudio14VC
call "%_VS12VC%\vcvarsall" x86
set INCLUDE=%_WPKITS81%\Include;%_WPKITS81%\Include\abi;%_WPKITS81%\Include\mincore;%_WPKITS81%\Include\minwin;%_WPKITS81%\Include\wrl;%INCLUDE%
set LIB=%_WPKITS81%\lib\x86;%_VS12VC%\lib\store;
set LIBPATH=%LIBPATH%;%_VS12VC%\vcpackages;%WindowsSDK_ExecutablePath_x86%\..\..\Tools\MDILXAPCompile\WinMDs;%_VS14VC%\vcpackages;
goto :eof
:set_wp8.0arm
call:setVar _VS11VC VisualStudio11VC
call:setVar _WPKITS80 WindowsPhoneKits8.0
call "%_VS11VC%\WPSDK\WP80\vcvarsphoneall.bat" x86_arm
goto :eof
:set_wp8.0Win32
call:setVar _VS11VC VisualStudio11VC
call:setVar _WPKITS80 WindowsPhoneKits8.0
call "%_VS11VC%\WPSDK\WP80\vcvarsphoneall.bat" x86
goto :eof
:set_ws8.1Win32
call:setVar _VS12VC VisualStudio12VC
call:setVar _WSKITS81 WindowsKits8.1
call:setVar _VS14VC VisualStudio14VC
call "%_VS12VC%\vcvarsall" x86
set INCLUDE=%_VS12VC%\include;%_VS12VC%\atlmfc\include;%_WSKITS81%\Include\um;%_WSKITS81%\Include\shared;%_WSKITS81%\Include\winrt;
set LIB=%_VS12VC%\lib\store;%_VS12VC%\atlmfc\lib;%_WSKITS81%\lib\winv6.3\um\x86;
set LIBPATH=%_WSKITS81%\References\CommonConfiguration\Neutral;%_VS12VC%\atlmfc\lib;%_VS12VC%\lib\store;%_VS12VC%\vcpackages;%WindowsSDK_ExecutablePath_x86%\..\..\Tools\MDILXAPCompile\WinMDs;%_VS14VC%\vcpackages;
goto :eof
:set_ws8.1x64
call:setVar _VS12VC VisualStudio12VC
call:setVar _WSKITS81 WindowsKits8.1
call:setVar _VS14VC VisualStudio14VC
call "%_VS12VC%\vcvarsall" x64
set INCLUDE=%_VS12VC%\include;%_VS12VC%\atlmfc\include;%_WSKITS81%\Include\um;%_WSKITS81%\Include\shared;%_WSKITS81%\Include\winrt;
set LIB=%_VS12VC%\lib\store\amd64;%_VS12VC%\atlmfc\lib\amd64;%_WSKITS81%\lib\winv6.3\um\x64;
set LIBPATH=%_WSKITS81%\References\CommonConfiguration\Neutral;%_VS12VC%\atlmfc\lib\amd64;%_VS12VC%\lib\store;%_VS12VC%\vcpackages;%WindowsSDK_ExecutablePath_x86%\..\..\Tools\MDILXAPCompile\WinMDs;%_VS14VC%\vcpackages;
goto :eof
:set_ws8.1arm
call:setVar _VS12VC VisualStudio12VC
call:setVar _WSKITS81 WindowsKits8.1
call:setVar _VS14VC VisualStudio14VC
call "%_VS12VC%\vcvarsall" x86_arm
set INCLUDE=%_VS12VC%\include;%_VS12VC%\atlmfc\include;%_WSKITS81%\Include\um;%_WSKITS81%\Include\shared;%_WSKITS81%\Include\winrt;
set LIB=%_VS12VC%\lib\store\arm;%_VS12VC%\atlmfc\lib\arm;%_WSKITS81%\lib\winv6.3\um\arm;
set LIBPATH=%_WSKITS81%\References\CommonConfiguration\Neutral;%_VS12VC%\atlmfc\lib\arm;%_VS12VC%\lib\store;%_VS12VC%\vcpackages;%WindowsSDK_ExecutablePath_x86%\..\..\Tools\MDILXAPCompile\WinMDs;%_VS14VC%\vcpackages;
goto :eof
:setVar
call:set%1
if "!%1!"=="" echo warning: could not locate %2
goto :eof
:setRegVar
for /F "usebackq tokens=2*" %%A IN (`reg query %1 /v %2 2^>nul`) do (
set %3=%%B
)
goto :eof
:setAppend
if exist %1%2 set %3=%1%2
goto :eof
:set_VS11VC
if not "%_VS11VC%"=="" goto :eof
call:setRegVar "HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0_Config\Setup\VC" ProductDir _VS11VC
if not "%_VS11VC%"=="" goto :eof
call:setRegVar "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\11.0\Setup\VC" ProductDir _VS11VC
if not "%_VS11VC%"=="" goto :eof
call:setAppend VSSDK110Install \..\VC _VS11VC
if not "%_VS11VC%"=="" goto :eof
call:setAppend VS110COMNTOOLS \..\..\VC _VS11VC
goto :eof
:set_VS12VC
if not "%_VS12VC%"=="" goto :eof
call:setRegVar "HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0_Config\Setup\VC" ProductDir _VS12VC
if not "%_VS12VC%"=="" goto :eof
call:setRegVar "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\12.0\Setup\VC" ProductDir _VS12VC
if not "%_VS12VC%"=="" goto :eof
call:setAppend VSSDK120Install \..\VC _VS12VC
if not "%_VS12VC%"=="" goto :eof
call:setAppend VS120COMNTOOLS \..\..\VC _VS12VC
goto :eof
:set_VS14VC
if not "%_VS14VC%"=="" goto :eof
call:setRegVar "HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\14.0_Config\Setup\VC" ProductDir _VS14VC
if not "%_VS14VC%"=="" goto :eof
call:setRegVar "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0\Setup\VC" ProductDir _VS14VC
if not "%_VS14VC%"=="" goto :eof
call:setAppend VSSDK140Install \..\VC _VS14VC
if not "%_VS14VC%"=="" goto :eof
call:setAppend VS140COMNTOOLS \..\..\VC _VS14VC
goto :eof
:set_WPKITS80
if not "%_WPKITS80%"=="" goto :eof
call:setRegVar "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows Phone\v8.0" InstallationFolder _WPKITS80
if not "%_WPKITS80%"=="" goto :eof
goto :eof
:set_WPKITS81
if not "%_WPKITS81%"=="" goto :eof
call:setRegVar "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows Phone\v8.1" InstallationFolder _WPKITS81
if not "%_WPKITS81%"=="" goto :eof
goto :eof
:set_WSKITS81
if not "%_WSKITS81%"=="" goto :eof
call:setRegVar "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Kits\Installed Roots" KitsRoot81 _WSKITS81
if not "%_WSKITS81%"=="" goto :eof
goto :eof
:set_WKITS10
if not "%_WKITS10%"=="" goto :eof
call:setRegVar "HKLM\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0" InstallationFolder _WKITS10
if not "%_WKITS10%"=="" goto :eof
goto :eof
:set_WKITS10VER
if not "%_WKITS10VER%"=="" goto :eof
call:setRegVar "HKLM\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0" ProductVersion _WKITS10VER
echo %_WKITS10VER%
if not "%_WKITS10VER%"=="" goto :eof
goto :eof
:setEnv
call:setVar _VS14VC VisualStudio14VC
call:setVar _WKITS10 WindowsKits10.0
set PATH=%_VS14VCBin%;%PATH%
set "LIBPATH=%_WKITS10%UnionMetadata\Facade;%_VS14VC%vcpackages;%_WKITS10%references\windows.foundation.foundationcontract\1.0.0.0\;%_WKITS10%references\windows.foundation.universalapicontract\1.0.0.0\"
goto :eof
:end