diff options
-rw-r--r-- | autobuild.xml | 2 | ||||
-rw-r--r-- | indra/cmake/OpenSSL.cmake | 55 |
2 files changed, 39 insertions, 18 deletions
diff --git a/autobuild.xml b/autobuild.xml index b9abfa2626..093acc6e74 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -2284,7 +2284,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string> <key>hash_algorithm</key> <string>sha1</string> <key>url</key> - <string>https://github.com/secondlife/3p-openssl/releases/download/v1.1.1q.de53f55/openssl-1.1.1q.de53f55-darwin64-de53f55.tar.zst</string> + <string>https://megapahit.net/downloads/openssl-1.1.1q.de53f55-darwin64-de53f55.tar.zst</string> </map> <key>name</key> <string>darwin64</string> diff --git a/indra/cmake/OpenSSL.cmake b/indra/cmake/OpenSSL.cmake index 4481b3460f..118ca84132 100644 --- a/indra/cmake/OpenSSL.cmake +++ b/indra/cmake/OpenSSL.cmake @@ -7,8 +7,40 @@ add_library( ll::openssl INTERFACE IMPORTED ) if (NOT USESYSTEMLIBS) use_system_binary(openssl) endif (NOT USESYSTEMLIBS) -if (CMAKE_OSX_ARCHITECTURES MATCHES x86_64 OR LINUX OR NOT USESYSTEMLIBS) +if (DARWIN OR LINUX OR NOT USESYSTEMLIBS) use_prebuilt_binary(openssl) + if (DARWIN) + execute_process( + COMMAND lipo -archs libcrypto.a + WORKING_DIRECTORY ${LIBS_PREBUILT_DIR}/lib/release + OUTPUT_VARIABLE crypto_archs + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + if (NOT ${crypto_archs} STREQUAL ${CMAKE_OSX_ARCHITECTURES}) + execute_process( + COMMAND lipo + libcrypto.a + -thin ${CMAKE_OSX_ARCHITECTURES} + -output libcrypto.a + WORKING_DIRECTORY ${LIBS_PREBUILT_DIR}/lib/release + ) + endif (NOT ${crypto_archs} STREQUAL ${CMAKE_OSX_ARCHITECTURES}) + execute_process( + COMMAND lipo -archs libssl.a + WORKING_DIRECTORY ${LIBS_PREBUILT_DIR}/lib/release + OUTPUT_VARIABLE ssl_archs + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + if (NOT ${ssl_archs} STREQUAL ${CMAKE_OSX_ARCHITECTURES}) + execute_process( + COMMAND lipo + libssl.a + -thin ${CMAKE_OSX_ARCHITECTURES} + -output libssl.a + WORKING_DIRECTORY ${LIBS_PREBUILT_DIR}/lib/release + ) + endif (NOT ${ssl_archs} STREQUAL ${CMAKE_OSX_ARCHITECTURES}) + endif (DARWIN) elseif (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/openssl_installed OR NOT ${openssl_installed} EQUAL 0) if (NOT EXISTS ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55.tar.gz) file(DOWNLOAD @@ -20,26 +52,15 @@ elseif (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRA INPUT ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55.tar.gz DESTINATION ${CMAKE_BINARY_DIR} ) - if (CMAKE_OSX_ARCHITECTURES MATCHES arm64) - set(ENV{CFLAGS} "-mmacosx-version-min=11.0") - execute_process( - COMMAND ./Configure no-shared darwin64-arm64-cc - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl - ) - else (CMAKE_OSX_ARCHITECTURES MATCHES arm64) - execute_process( - COMMAND ./config no-shared - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl - ) - endif (CMAKE_OSX_ARCHITECTURES MATCHES arm64) + execute_process( + COMMAND ./config no-shared + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl + ) execute_process( COMMAND make -j${MAKE_JOBS} WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl RESULT_VARIABLE openssl_installed ) - if (CMAKE_OSX_ARCHITECTURES MATCHES arm64) - unset(ENV{CFLAGS}) - endif (CMAKE_OSX_ARCHITECTURES MATCHES arm64) file( COPY ${CMAKE_BINARY_DIR}/3p-openssl-1.1.1q.de53f55/openssl/include/openssl/aes.h @@ -155,7 +176,7 @@ elseif (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRA DESTINATION ${LIBS_PREBUILT_DIR}/lib/release ) file(WRITE ${PREBUILD_TRACKING_DIR}/openssl_installed "${openssl_installed}") -endif (CMAKE_OSX_ARCHITECTURES MATCHES x86_64 OR LINUX OR NOT USESYSTEMLIBS) +endif (DARWIN OR LINUX OR NOT USESYSTEMLIBS) if (WINDOWS) target_link_libraries(ll::openssl INTERFACE libssl libcrypto) elseif (LINUX) |