diff --git a/thirdparty/openssl/CMakeLists.txt b/thirdparty/openssl/CMakeLists.txt index b5b0928be..b0a266984 100644 --- a/thirdparty/openssl/CMakeLists.txt +++ b/thirdparty/openssl/CMakeLists.txt @@ -1,5 +1,4 @@ list(APPEND PATCH_FILES - openssl-1.1.0j-parallel_install_fix.patch reduce_build_verbosity.patch macos_rpath.patch ) @@ -27,7 +26,23 @@ if(CHOST) list(APPEND CFG_ENV_VAR CROSS_COMPILE=${CHOST}-) endif() -set(CFG_OPTS shared) +if(MONOLIBTIC) + set(CFG_OPTS no-shared) +else() + set(CFG_OPTS shared) +endif() + +list(APPEND CFG_OPTS + no-comp + no-default-thread-pool + no-hw + no-legacy + no-quic + no-thread-pool + no-ui-console + no-uplink + no-whirlpool +) if(ANDROID) assert_var_defined(ENV{NDKABI}) @@ -79,12 +94,9 @@ list(APPEND CFG_CMD COMMAND env ${CFG_ENV_VAR} ${CONFIGURE_CMD} --prefix=${STAGING_DIR} + --libdir=lib ${CFG_OPTS} ) -if(ANDROID) - # Disable versioning of shared objects. - list(APPEND CFG_CMD COMMAND ${ISED} "s|^SHLIB_EXT=.*|SHLIB_EXT=${LIB_EXT}|" Makefile) -endif() set(MAKE_CMD make @@ -102,20 +114,14 @@ list(APPEND BUILD_CMD COMMAND ${MAKE_CMD} build_libs) list(APPEND INSTALL_CMD COMMAND ${MAKE_CMD} install_dev) -if(MONOLIBTIC) - list(APPEND INSTALL_CMD COMMAND sh -c "rm -v \"$1\"* \"$2\"*" -- - ${STAGING_DIR}/lib/libcrypto${LIB_EXT} - ${STAGING_DIR}/lib/libssl${LIB_EXT} - ) -else() - append_shared_lib_install_commands(INSTALL_CMD crypto VERSION 1.1) - append_shared_lib_install_commands(INSTALL_CMD ssl VERSION 1.1) +if(NOT MONOLIBTIC) + append_shared_lib_install_commands(INSTALL_CMD crypto VERSION 3) + append_shared_lib_install_commands(INSTALL_CMD ssl VERSION 3) endif() external_project( - DOWNLOAD URL 3f76825f195e52d4b10c70040681a275 - https://github.com/openssl/openssl/releases/download/OpenSSL_1_1_1w/openssl-1.1.1w.tar.gz - https://www.openssl.org/source/old/1.1.1/openssl-1.1.1w.tar.gz + DOWNLOAD URL 34733f7be2d60ecd8bd9ddb796e182af + https://github.com/openssl/openssl/releases/download/openssl-3.4.0/openssl-3.4.0.tar.gz PATCH_FILES ${PATCH_FILES} CONFIGURE_COMMAND ${CFG_CMD} BUILD_COMMAND ${BUILD_CMD} diff --git a/thirdparty/openssl/fix_libcrypto_pkg-config_entry.patch b/thirdparty/openssl/fix_libcrypto_pkg-config_entry.patch index b8c201b72..28bd2d1b8 100644 --- a/thirdparty/openssl/fix_libcrypto_pkg-config_entry.patch +++ b/thirdparty/openssl/fix_libcrypto_pkg-config_entry.patch @@ -1,13 +1,13 @@ ---- a/Configurations/unix-Makefile.tmpl -+++ b/Configurations/unix-Makefile.tmpl -@@ -974,8 +974,8 @@ - echo 'Name: OpenSSL-libcrypto'; \ - echo 'Description: OpenSSL cryptography library'; \ - echo 'Version: '$(VERSION); \ -- echo 'Libs: -L$${libdir} -lcrypto'; \ -- echo 'Libs.private: $(LIB_EX_LIBS)'; \ -+ echo 'Libs: -L$${libdir} -lcrypto $(LIB_EX_LIBS)'; \ -+ echo 'Libs.private:'; \ - echo 'Cflags: -I$${includedir}' ) > libcrypto.pc - - libssl.pc: +--- i/exporters/pkg-config/libcrypto.pc.in ++++ w/exporters/pkg-config/libcrypto.pc.in +@@ -17,8 +17,8 @@ + Name: OpenSSL-libcrypto + Description: OpenSSL cryptography library + Version: {- $OpenSSL::safe::installdata::VERSION -} +-Libs: -L${libdir} -lcrypto +-Libs.private: {- join(' ', @OpenSSL::safe::installdata::LDLIBS) -} ++Libs: -L${libdir} -lcrypto {- join(' ', @OpenSSL::safe::installdata::LDLIBS) -} ++Libs.private: + Cflags:{- $OUT = ' -I${includedir}'; + if (scalar @OpenSSL::safe::installdata::INCLUDEDIR_REL_PREFIX > 1) { + $OUT = ''; diff --git a/thirdparty/openssl/macos_rpath.patch b/thirdparty/openssl/macos_rpath.patch index 9736d41b9..55cee7ac3 100644 --- a/thirdparty/openssl/macos_rpath.patch +++ b/thirdparty/openssl/macos_rpath.patch @@ -1,10 +1,10 @@ --- i/Configurations/shared-info.pl +++ w/Configurations/shared-info.pl -@@ -44,7 +44,7 @@ my %shared_info; +@@ -49,7 +49,7 @@ 'darwin-shared' => { module_ldflags => '-bundle', shared_ldflag => '-dynamiclib -current_version $(SHLIB_VERSION_NUMBER) -compatibility_version $(SHLIB_VERSION_NUMBER)', -- shared_sonameflag => '-install_name $(INSTALLTOP)/$(LIBDIR)/', +- shared_sonameflag => '-install_name $(libdir)/', + shared_sonameflag => '-install_name @rpath/', }, 'cygwin-shared' => { diff --git a/thirdparty/openssl/openssl-1.1.0j-parallel_install_fix.patch b/thirdparty/openssl/openssl-1.1.0j-parallel_install_fix.patch deleted file mode 100644 index c837e208c..000000000 --- a/thirdparty/openssl/openssl-1.1.0j-parallel_install_fix.patch +++ /dev/null @@ -1,21 +0,0 @@ -https://github.com/openssl/openssl/issues/7679 - ---- a/Configurations/unix-Makefile.tmpl -+++ b/Configurations/unix-Makefile.tmpl -@@ -77,8 +77,14 @@ - # to. You're welcome. - sub dependmagic { - my $target = shift; -- -- return "$target: build_generated\n\t\$(MAKE) depend && \$(MAKE) _$target\n_$target"; -+ my $magic = <<"_____"; -+$target: build_generated depend -+ \$(MAKE) _$target -+_$target -+_____ -+ # Remove line ending -+ $magic =~ s|\R$||; -+ return $magic; - } - ''; - -}