-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #538 from metsma/openssl
Upgrade OpenSSL 3.0.9 and use vcpkg manifest
- Loading branch information
Showing
31 changed files
with
805 additions
and
199 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
diff --git a/Configure b/Configure | ||
index 5ac4b52..ad638e8 100755 | ||
--- a/Configure | ||
+++ b/Configure | ||
@@ -401,6 +401,7 @@ my @dtls = qw(dtls1 dtls1_2); | ||
my @disablables = ( | ||
"acvp-tests", | ||
"afalgeng", | ||
+ "apps", | ||
"aria", | ||
"asan", | ||
"asm", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl | ||
index 110ba06..5b6b1c7 100644 | ||
--- a/Configurations/unix-Makefile.tmpl | ||
+++ b/Configurations/unix-Makefile.tmpl | ||
@@ -611,7 +611,7 @@ install_sw: install_dev install_engines install_modules install_runtime | ||
|
||
uninstall_sw: uninstall_runtime uninstall_modules uninstall_engines uninstall_dev | ||
|
||
-install_docs: install_man_docs install_html_docs | ||
+install_docs: | ||
|
||
uninstall_docs: uninstall_man_docs uninstall_html_docs | ||
$(RM) -r $(DESTDIR)$(DOCDIR) | ||
diff --git a/Configurations/windows-makefile.tmpl b/Configurations/windows-makefile.tmpl | ||
index d054431..b5c1c88 100644 | ||
--- a/Configurations/windows-makefile.tmpl | ||
+++ b/Configurations/windows-makefile.tmpl | ||
@@ -487,7 +487,7 @@ install_sw: install_dev install_engines install_modules install_runtime | ||
|
||
uninstall_sw: uninstall_runtime uninstall_modules uninstall_engines uninstall_dev | ||
|
||
-install_docs: install_html_docs | ||
+install_docs: | ||
|
||
uninstall_docs: uninstall_html_docs | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
function(install_pc_file name pc_data) | ||
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") | ||
configure_file("${CMAKE_CURRENT_LIST_DIR}/openssl.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/${name}.pc" @ONLY) | ||
endif() | ||
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") | ||
configure_file("${CMAKE_CURRENT_LIST_DIR}/openssl.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/${name}.pc" @ONLY) | ||
endif() | ||
endfunction() | ||
|
||
install_pc_file(openssl [[ | ||
Name: OpenSSL | ||
Description: Secure Sockets Layer and cryptography libraries and tools | ||
Requires: libssl libcrypto | ||
]]) | ||
|
||
install_pc_file(libssl [[ | ||
Name: OpenSSL-libssl | ||
Description: Secure Sockets Layer and cryptography libraries | ||
Libs: -L"${libdir}" -llibssl | ||
Requires: libcrypto | ||
Cflags: -I"${includedir}" | ||
]]) | ||
|
||
install_pc_file(libcrypto [[ | ||
Name: OpenSSL-libcrypto | ||
Description: OpenSSL cryptography library | ||
Libs: -L"${libdir}" -llibcrypto | ||
Libs.private: -lcrypt32 -lws2_32 -ladvapi32 -luser32 | ||
Cflags: -I"${includedir}" | ||
]]) | ||
|
||
vcpkg_fixup_pkgconfig() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
prefix=${pcfiledir}/../.. | ||
exec_prefix=${prefix} | ||
libdir=${exec_prefix}/lib | ||
includedir=${prefix}/include | ||
Version: @VERSION@ | ||
@pc_data@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
if(EXISTS "${CURRENT_INSTALLED_DIR}/share/libressl/copyright" | ||
OR EXISTS "${CURRENT_INSTALLED_DIR}/share/boringssl/copyright") | ||
message(FATAL_ERROR "Can't build openssl if libressl/boringssl is installed. Please remove libressl/boringssl, and try install openssl again if you need it.") | ||
endif() | ||
|
||
if(VCPKG_TARGET_IS_EMSCRIPTEN) | ||
vcpkg_check_linkage(ONLY_STATIC_LIBRARY) | ||
endif() | ||
|
||
if (NOT "${VERSION}" MATCHES [[^([0-9]+)\.([0-9]+)\.([0-9]+)$]]) | ||
message(FATAL_ERROR "Version regex did not match.") | ||
endif() | ||
set(OPENSSL_VERSION_MAJOR "${CMAKE_MATCH_1}") | ||
set(OPENSSL_VERSION_MINOR "${CMAKE_MATCH_2}") | ||
set(OPENSSL_VERSION_FIX "${CMAKE_MATCH_3}") | ||
configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake.in" "${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake" @ONLY) | ||
|
||
vcpkg_from_github( | ||
OUT_SOURCE_PATH SOURCE_PATH | ||
REPO openssl/openssl | ||
REF "openssl-${VERSION}" | ||
SHA512 4762ce7faa0d7f43d0d4882700dcb10cd31bb025c52110fb2f1a8d3911f4ed92153db982935be6f38f45ae3f030f7edb4968e96dd5a41367ad7365c03c25edb1 | ||
PATCHES | ||
disable-apps.patch | ||
disable-install-docs.patch | ||
script-prefix.patch | ||
windows/install-layout.patch | ||
windows/install-pdbs.patch | ||
unix/android-cc.patch | ||
unix/move-openssldir.patch | ||
unix/no-empty-dirs.patch | ||
unix/no-static-libs-for-shared.patch | ||
) | ||
|
||
vcpkg_list(SET CONFIGURE_OPTIONS | ||
enable-static-engine | ||
enable-capieng | ||
no-ssl3 | ||
no-weak-ssl-ciphers | ||
no-tests | ||
) | ||
|
||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") | ||
vcpkg_list(APPEND CONFIGURE_OPTIONS shared) | ||
else() | ||
vcpkg_list(APPEND CONFIGURE_OPTIONS no-shared no-module) | ||
endif() | ||
|
||
if(NOT "tools" IN_LIST FEATURES) | ||
vcpkg_list(APPEND CONFIGURE_OPTIONS no-apps) | ||
endif() | ||
|
||
if(DEFINED OPENSSL_USE_NOPINSHARED) | ||
vcpkg_list(APPEND CONFIGURE_OPTIONS no-pinshared) | ||
endif() | ||
|
||
if(OPENSSL_NO_AUTOLOAD_CONFIG) | ||
vcpkg_list(APPEND CONFIGURE_OPTIONS no-autoload-config) | ||
endif() | ||
|
||
if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) | ||
include("${CMAKE_CURRENT_LIST_DIR}/windows/portfile.cmake") | ||
include("${CMAKE_CURRENT_LIST_DIR}/install-pc-files.cmake") | ||
else() | ||
include("${CMAKE_CURRENT_LIST_DIR}/unix/portfile.cmake") | ||
endif() | ||
|
||
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") | ||
file(INSTALL "${SOURCE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
diff --git a/tools/c_rehash.in b/tools/c_rehash.in | ||
index 343cdc1..e48038e 100644 | ||
--- a/tools/c_rehash.in | ||
+++ b/tools/c_rehash.in | ||
@@ -12,7 +12,7 @@ | ||
# and add symbolic links to their hash values. | ||
|
||
my $dir = {- quotify1($config{openssldir}) -}; | ||
-my $prefix = {- quotify1($config{prefix}) -}; | ||
+use FindBin; | ||
|
||
my $errorcount = 0; | ||
my $openssl = $ENV{OPENSSL} || "openssl"; | ||
@@ -61,7 +61,7 @@ if (defined(&Cwd::getcwd)) { | ||
|
||
# DOS/Win32 or Unix delimiter? Prefix our installdir, then search. | ||
my $path_delim = ($pwd =~ /^[a-z]\:/i) ? ';' : ':'; | ||
-$ENV{PATH} = "$prefix/bin" . ($ENV{PATH} ? $path_delim . $ENV{PATH} : ""); | ||
+$ENV{PATH} = "$FindBin::Bin" . ($ENV{PATH} ? $path_delim . $ENV{PATH} : ""); | ||
|
||
if (! -x $openssl) { | ||
my $found = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
diff --git a/Configurations/15-android.conf b/Configurations/15-android.conf | ||
index 41ad922..d15e34c 100644 | ||
--- a/Configurations/15-android.conf | ||
+++ b/Configurations/15-android.conf | ||
@@ -102,6 +102,7 @@ | ||
my $cflags; | ||
my $cppflags; | ||
|
||
+if (0) { | ||
# see if there is NDK clang on $PATH, "universal" or "standalone" | ||
if (which("clang") =~ m|^$ndk/.*/prebuilt/([^/]+)/|) { | ||
my $host=$1; | ||
@@ -158,6 +159,7 @@ | ||
$sysroot =~ s|^$ndk/||; | ||
$sysroot = " --sysroot=\$($ndk_var)/$sysroot"; | ||
} | ||
+} | ||
$android_ndk = { | ||
cflags => $cflags . $sysroot, | ||
cppflags => $cppflags, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
declare -a OUT_OPTIONS | ||
|
||
INTERPRETER=perl | ||
|
||
LAST_SEEN= | ||
COPY_OPTIONS=no | ||
for OPTION; do | ||
case "${OPTION},${COPY_OPTIONS}" in | ||
*/Configure,no) | ||
OUT_OPTIONS+=("${OPTION}") | ||
INTERPRETER="${LAST_SEEN}" | ||
COPY_OPTIONS=yes | ||
;; | ||
--prefix=*|--openssldir=*|--libdir=*|--cross-compile-prefix=*|--debug,*) | ||
OUT_OPTIONS+=("${OPTION}") | ||
;; | ||
-*|*=*) | ||
;; | ||
*,yes) | ||
OUT_OPTIONS+=("${OPTION}") | ||
;; | ||
esac | ||
LAST_SEEN="${OPTION}" | ||
done | ||
|
||
set -x | ||
"${INTERPRETER}" ${OUT_OPTIONS[@]} |
Oops, something went wrong.