diff options
| author | Sofapriester <stefan-salem@web.de> | 2020-08-14 18:51:10 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-14 09:51:10 -0700 |
| commit | e09594e42982bf7272bb12f49a4869b3fb8b90b7 (patch) | |
| tree | 642a1a061ebda86dbed683559483e68a912df7ae | |
| parent | 0b5bbe30d940c597242cefa899dc93168054e466 (diff) | |
| download | vcpkg-e09594e42982bf7272bb12f49a4869b3fb8b90b7.tar.gz vcpkg-e09594e42982bf7272bb12f49a4869b3fb8b90b7.zip | |
[openssl-windows] Added feature option to build openssl with no-pinshared flag (#12056)
* [openssl-windows] Added feature option to build openssl with no-pinshared flag
* Fix review findings from @NancyLi1013
* Try a CI test re-run
* Changed fix to idea from @ras0219-msft
* Remove options from message
As suggested by @ras0219.
Co-authored-by: ras0219 <533828+ras0219@users.noreply.github.com>
* Update ports/openssl-windows/CONTROL
Co-authored-by: Stefan Strauss <stefan.strauss@avira.com>
Co-authored-by: ras0219 <533828+ras0219@users.noreply.github.com>
Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com>
| -rw-r--r-- | ports/openssl-windows/CONTROL | 1 | ||||
| -rw-r--r-- | ports/openssl-windows/portfile.cmake | 34 |
2 files changed, 22 insertions, 13 deletions
diff --git a/ports/openssl-windows/CONTROL b/ports/openssl-windows/CONTROL index e9ea27a42..e70ab221c 100644 --- a/ports/openssl-windows/CONTROL +++ b/ports/openssl-windows/CONTROL @@ -1,4 +1,5 @@ Source: openssl-windows Version: 1.1.1g +Port-Version: 1 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. Supports: windows diff --git a/ports/openssl-windows/portfile.cmake b/ports/openssl-windows/portfile.cmake index a802c84c5..a4735d1fc 100644 --- a/ports/openssl-windows/portfile.cmake +++ b/ports/openssl-windows/portfile.cmake @@ -1,9 +1,9 @@ vcpkg_fail_port_install(MESSAGE "${PORT} is only for Windows Desktop" ON_TARGET "UWP" "Linux" "OSX") if(EXISTS "${CURRENT_INSTALLED_DIR}/include/openssl/ssl.h") - message(WARNING "Can't build openssl if libressl is installed. Please remove libressl, and try install openssl again if you need it. Build will continue but there might be problems since libressl is only a subset of openssl") - set(VCPKG_POLICY_EMPTY_PACKAGE enabled) - return() + message(WARNING "Can't build openssl if libressl is installed. Please remove libressl, and try install openssl again if you need it. Build will continue but there might be problems since libressl is only a subset of openssl") + set(VCPKG_POLICY_EMPTY_PACKAGE enabled) + return() endif() vcpkg_find_acquire_program(PERL) @@ -20,8 +20,8 @@ vcpkg_download_distfile(ARCHIVE ) vcpkg_extract_source_archive_ex( - OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE ${ARCHIVE} ) vcpkg_find_acquire_program(NASM) @@ -32,10 +32,10 @@ vcpkg_find_acquire_program(JOM) set(OPENSSL_SHARED no-shared) if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - set(OPENSSL_SHARED shared) + set(OPENSSL_SHARED shared) endif() -set(CONFIGURE_COMMAND ${PERL} Configure +set(CONFIGURE_OPTIONS enable-static-engine enable-capieng no-ssl2 @@ -44,6 +44,12 @@ set(CONFIGURE_COMMAND ${PERL} Configure ${OPENSSL_SHARED} ) +if(DEFINED OPENSSL_USE_NOPINSHARED) + set(CONFIGURE_OPTIONS ${CONFIGURE_OPTIONS} no-pinshared) +endif() + +set(CONFIGURE_COMMAND ${PERL} Configure ${CONFIGURE_OPTIONS}) + if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") set(OPENSSL_ARCH VC-WIN32) elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") @@ -170,13 +176,15 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL static) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/) endif() -file(READ "${CURRENT_PACKAGES_DIR}/include/openssl/dtls1.h" _contents) -string(REPLACE "<winsock.h>" "<winsock2.h>" _contents "${_contents}") -file(WRITE "${CURRENT_PACKAGES_DIR}/include/openssl/dtls1.h" "${_contents}") +vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/openssl/dtls1.h" + "<winsock.h>" + "<winsock2.h>" +) -file(READ "${CURRENT_PACKAGES_DIR}/include/openssl/rand.h" _contents) -string(REPLACE "# include <windows.h>" "#ifndef _WINSOCKAPI_\n#define _WINSOCKAPI_\n#endif\n# include <windows.h>" _contents "${_contents}") -file(WRITE "${CURRENT_PACKAGES_DIR}/include/openssl/rand.h" "${_contents}") +vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/openssl/rand.h" + "# include <windows.h>" + "#ifndef _WINSOCKAPI_\n#define _WINSOCKAPI_\n#endif\n# include <windows.h>" +) vcpkg_copy_pdbs() |
