summaryrefslogtreecommitdiff
path: root/indra/cmake
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2024-08-25 14:30:22 +0800
committerErik Kundiman <erik@megapahit.org>2024-08-25 14:37:43 +0800
commit633393b7947684d6bef55534a81577d25af64ab5 (patch)
treede44a038107ad4cbfa120fb3b9c4daec0b21a3f0 /indra/cmake
parent178c62d39e779fbcaecf8cbb14522c28385957d0 (diff)
Darwin prebuilt libcurl binary
Diffstat (limited to 'indra/cmake')
-rw-r--r--indra/cmake/CURL.cmake78
1 files changed, 33 insertions, 45 deletions
diff --git a/indra/cmake/CURL.cmake b/indra/cmake/CURL.cmake
index 60b74d3727..26704e6934 100644
--- a/indra/cmake/CURL.cmake
+++ b/indra/cmake/CURL.cmake
@@ -7,8 +7,25 @@ add_library( ll::libcurl INTERFACE IMPORTED )
if (NOT USESYSTEMLIBS)
use_system_binary(libcurl)
endif (NOT USESYSTEMLIBS)
-if (LINUX OR NOT USESYSTEMLIBS)
+if (DARWIN OR LINUX OR NOT USESYSTEMLIBS)
use_prebuilt_binary(curl)
+ if (DARWIN)
+ execute_process(
+ COMMAND lipo -archs libcurl.a
+ WORKING_DIRECTORY ${LIBS_PREBUILT_DIR}/lib/release
+ OUTPUT_VARIABLE curl_archs
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+ if (NOT ${curl_archs} EQUAL ${CMAKE_OSX_ARCHITECTURES})
+ execute_process(
+ COMMAND lipo
+ libcurl.a
+ -thin ${CMAKE_OSX_ARCHITECTURES}
+ -output libcurl.a
+ WORKING_DIRECTORY ${LIBS_PREBUILT_DIR}/lib/release
+ )
+ endif (NOT ${curl_archs} EQUAL ${CMAKE_OSX_ARCHITECTURES})
+ endif (DARWIN)
elseif (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/curl_installed OR NOT ${curl_installed} EQUAL 0)
if (NOT EXISTS ${CMAKE_BINARY_DIR}/3p-curl-7.54.1-r1.tar.gz)
file(DOWNLOAD
@@ -41,35 +58,15 @@ elseif (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRA
DESTINATION ${LIBS_PREBUILT_DIR}/lib
)
message("We need to temporarily have OpenSSL3 header directory and libraries renamed just until the libcurl building process with OpenSSL1.1 now is finished.")
- if (DARWIN)
- set(ENV{CFLAGS} "-arch ${CMAKE_OSX_ARCHITECTURES} -mmacosx-version-min=10.15 -std=c90")
- execute_process(COMMAND sudo mv /opt/local/include/openssl /opt/local/include/openssl3)
- execute_process(COMMAND sudo mv /opt/local/lib/libcrypto.a /opt/local/lib/libcrypto.a.3)
- execute_process(COMMAND sudo mv /opt/local/lib/libcrypto.dylib /opt/local/lib/libcrypto.dylib.3)
- execute_process(COMMAND sudo mv /opt/local/lib/libssl.a /opt/local/lib/libssl.a.3)
- execute_process(COMMAND sudo mv /opt/local/lib/libssl.dylib /opt/local/lib/libssl.dylib.3)
- if (CMAKE_OSX_ARCHITECTURES MATCHES arm64)
- execute_process(
- COMMAND ./configure --host=aarch64-apple-darwin --disable-alt-svc --disable-dict --disable-doh --disable-file --disable-gopher --disable-headers-api --disable-hsts --disable-imap --disable-ldap --disable-ldaps --disable-libcurl-option --disable-manual --disable-mqtt --disable-ntlm --disable-ntlm-wb --disable-pop3 --disable-rtsp --disable-shared --disable-smb --disable-smtp --disable-sspi --disable-telnet --disable-tftp --disable-tls-srp --disable-unix-sockets --disable-verbose --disable-versioned-symbols --enable-threaded-resolver --with-ssl=${LIBS_PREBUILT_DIR} --without-libidn2 --without-libpsl --without-libssh2
- WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/3p-curl-7.54.1-r1/curl
- )
- else (CMAKE_OSX_ARCHITECTURES MATCHES arm64)
- execute_process(
- COMMAND ./configure --host=${CMAKE_OSX_ARCHITECTURES}-apple-darwin --disable-alt-svc --disable-dict --disable-doh --disable-file --disable-gopher --disable-headers-api --disable-hsts --disable-imap --disable-ldap --disable-ldaps --disable-libcurl-option --disable-manual --disable-mqtt --disable-ntlm --disable-ntlm-wb --disable-pop3 --disable-rtsp --disable-shared --disable-smb --disable-smtp --disable-sspi --disable-telnet --disable-tftp --disable-tls-srp --disable-unix-sockets --disable-verbose --disable-versioned-symbols --enable-threaded-resolver --with-ssl=${LIBS_PREBUILT_DIR} --without-libidn2 --without-libpsl --without-libssh2
- WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/3p-curl-7.54.1-r1/curl
- )
- endif (CMAKE_OSX_ARCHITECTURES MATCHES arm64)
- else (DARWIN)
- execute_process(COMMAND sudo mv /usr/include/openssl /usr/include/openssl3)
- execute_process(COMMAND sudo mv /usr/lib/libcrypto.a /usr/lib/libcrypto.a.3)
- execute_process(COMMAND sudo mv /usr/lib/libcrypto.so /usr/lib/libcrypto.so.3)
- execute_process(COMMAND sudo mv /usr/lib/libssl.a /usr/lib/libssl.a.3)
- execute_process(COMMAND sudo mv /usr/lib/libssl.so /usr/lib/libssl.so.3)
- execute_process(
- COMMAND ./configure --disable-alt-svc --disable-dict --disable-doh --disable-file --disable-gopher --disable-headers-api --disable-hsts --disable-imap --disable-ldap --disable-ldaps --disable-libcurl-option --disable-manual --disable-mqtt --disable-ntlm --disable-ntlm-wb --disable-pop3 --disable-rtsp --disable-shared --disable-smb --disable-smtp --disable-sspi --disable-telnet --disable-tftp --disable-tls-srp --disable-unix-sockets --disable-verbose --disable-versioned-symbols --enable-threaded-resolver --with-ssl=${LIBS_PREBUILT_DIR} --without-libidn2 --without-libpsl --without-libssh2
- WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/3p-curl-7.54.1-r1/curl
- )
- endif (DARWIN)
+ execute_process(COMMAND sudo mv /usr/include/openssl /usr/include/openssl3)
+ execute_process(COMMAND sudo mv /usr/lib/libcrypto.a /usr/lib/libcrypto.a.3)
+ execute_process(COMMAND sudo mv /usr/lib/libcrypto.so /usr/lib/libcrypto.so.3)
+ execute_process(COMMAND sudo mv /usr/lib/libssl.a /usr/lib/libssl.a.3)
+ execute_process(COMMAND sudo mv /usr/lib/libssl.so /usr/lib/libssl.so.3)
+ execute_process(
+ COMMAND ./configure --disable-alt-svc --disable-dict --disable-doh --disable-file --disable-gopher --disable-headers-api --disable-hsts --disable-imap --disable-ldap --disable-ldaps --disable-libcurl-option --disable-manual --disable-mqtt --disable-ntlm --disable-ntlm-wb --disable-pop3 --disable-rtsp --disable-shared --disable-smb --disable-smtp --disable-sspi --disable-telnet --disable-tftp --disable-tls-srp --disable-unix-sockets --disable-verbose --disable-versioned-symbols --enable-threaded-resolver --with-ssl=${LIBS_PREBUILT_DIR} --without-libidn2 --without-libpsl --without-libssh2
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/3p-curl-7.54.1-r1/curl
+ )
execute_process(
COMMAND make -j${MAKE_JOBS}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/3p-curl-7.54.1-r1/curl
@@ -79,27 +76,18 @@ elseif (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRA
COPY ${CMAKE_BINARY_DIR}/3p-curl-7.54.1-r1/curl/lib/.libs/libcurl.a
DESTINATION ${LIBS_PREBUILT_DIR}/lib/release
)
- if (DARWIN)
- unset(ENV{CFLAGS})
- execute_process(COMMAND sudo mv /opt/local/include/openssl3 /opt/local/include/openssl)
- execute_process(COMMAND sudo mv /opt/local/lib/libcrypto.a.3 /opt/local/lib/libcrypto.a)
- execute_process(COMMAND sudo mv /opt/local/lib/libcrypto.dylib.3 /opt/local/lib/libcrypto.dylib)
- execute_process(COMMAND sudo mv /opt/local/lib/libssl.a.3 /opt/local/lib/libssl.a)
- execute_process(COMMAND sudo mv /opt/local/lib/libssl.dylib.3 /opt/local/lib/libssl.dylib)
- else (DARWIN)
- execute_process(COMMAND sudo mv /usr/include/openssl3 /usr/include/openssl)
- execute_process(COMMAND sudo mv /usr/lib/libcrypto.a.3 /usr/lib/libcrypto.a)
- execute_process(COMMAND sudo mv /usr/lib/libcrypto.so.3 /usr/lib/libcrypto.so)
- execute_process(COMMAND sudo mv /usr/lib/libssl.a.3 /usr/lib/libssl.a)
- execute_process(COMMAND sudo mv /usr/lib/libssl.so.3 /usr/lib/libssl.so)
- endif (DARWIN)
+ execute_process(COMMAND sudo mv /usr/include/openssl3 /usr/include/openssl)
+ execute_process(COMMAND sudo mv /usr/lib/libcrypto.a.3 /usr/lib/libcrypto.a)
+ execute_process(COMMAND sudo mv /usr/lib/libcrypto.so.3 /usr/lib/libcrypto.so)
+ execute_process(COMMAND sudo mv /usr/lib/libssl.a.3 /usr/lib/libssl.a)
+ execute_process(COMMAND sudo mv /usr/lib/libssl.so.3 /usr/lib/libssl.so)
message("OpenSSL3 header directory and library names have been restored.")
file(REMOVE
${LIBS_PREBUILT_DIR}/lib/libcrypto.a
${LIBS_PREBUILT_DIR}/lib/libssl.a
)
file(WRITE ${PREBUILD_TRACKING_DIR}/curl_installed "${curl_installed}")
-endif (LINUX OR NOT USESYSTEMLIBS)
+endif (DARWIN OR LINUX OR NOT USESYSTEMLIBS)
if (WINDOWS)
target_link_libraries(ll::libcurl INTERFACE libcurl.lib)
else (WINDOWS)