summaryrefslogtreecommitdiff
path: root/indra/cmake
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2024-08-25 13:53:16 +0800
committerErik Kundiman <erik@megapahit.org>2024-08-25 13:53:16 +0800
commit178c62d39e779fbcaecf8cbb14522c28385957d0 (patch)
tree0e4cfa618325ca4fb3166c70021e2c9083a34cad /indra/cmake
parentd07e9ecfaf9b68f8bb5e804ef0f2b5fb5a31f748 (diff)
Darwin & Tumbleweed use prebuilt XMLRPC-EPI
Refer to this commit if you need to recover the steps in compiling XMLRPC-EPI. The prebuilt binary for Darwin is distributed as universal, and will be thinned accordingly. It also makes use of autobuild.xml, but only partially (the sha1sum isn't used yet in the Prebuilt.cmake reimplementation).
Diffstat (limited to 'indra/cmake')
-rw-r--r--indra/cmake/XmlRpcEpi.cmake89
1 files changed, 16 insertions, 73 deletions
diff --git a/indra/cmake/XmlRpcEpi.cmake b/indra/cmake/XmlRpcEpi.cmake
index 739648500c..756388957f 100644
--- a/indra/cmake/XmlRpcEpi.cmake
+++ b/indra/cmake/XmlRpcEpi.cmake
@@ -6,85 +6,28 @@ add_library( ll::xmlrpc-epi INTERFACE IMPORTED )
if (NOT USESYSTEMLIBS)
use_system_binary( xmlrpc-epi )
+endif (NOT USESYSTEMLIBS)
+if (${LINUX_DISTRO} MATCHES opensuse-tumbleweed OR DARWIN OR NOT USESYSTEMLIBS)
use_prebuilt_binary(xmlrpc-epi)
-elseif ((${LINUX_DISTRO} MATCHES opensuse-tumbleweed OR DARWIN) AND (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/xmlrpc-epi_installed OR NOT ${xmlrpc-epi_installed} EQUAL 0))
- if (NOT EXISTS ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2.tar.bz2)
- file(DOWNLOAD
- https://sourceforge.net/projects/xmlrpc-epi/files/xmlrpc-epi-base/0.54.2/xmlrpc-epi-0.54.2.tar.bz2
- ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2.tar.bz2
- )
- endif (NOT EXISTS ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2.tar.bz2)
- file(ARCHIVE_EXTRACT
- INPUT ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2.tar.bz2
- DESTINATION ${CMAKE_BINARY_DIR}
- )
- file(
- COPY
- ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2/src/base64.h
- ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2/src/encodings.h
- ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2/src/queue.h
- ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2/src/simplestring.h
- ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2/src/xml_element.h
- ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2/src/xml_to_xmlrpc.h
- ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2/src/xmlrpc.h
- ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2/src/xmlrpc_introspection.h
- DESTINATION ${LIBS_PREBUILT_DIR}/include/xmlrpc-epi
- )
- file(REMOVE
- ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2/config.sub
- ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2/missing
- )
- execute_process(
- COMMAND autoreconf -is
- WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2
- )
- set(ENV{CPPFLAGS} -I${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2/src)
if (DARWIN)
- set(ENV{CFLAGS} "-arch ${CMAKE_OSX_ARCHITECTURES} -mmacosx-version-min=10.15")
- if (CMAKE_OSX_ARCHITECTURES MATCHES arm64)
- execute_process(
- COMMAND sed -i '' -e "s/XMLRPC_VALUE find_named_value/__attribute__((always_inline)) XMLRPC_VALUE find_named_value/g"
- xmlrpc_introspection.c
- WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2/src
- )
- execute_process(
- COMMAND sed -i '' -e "s/void describe_method/__attribute__((always_inline)) void describe_method/g"
- xmlrpc_introspection.c
- WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2/src
- )
- execute_process(
- COMMAND ./configure --disable-static --host=aarch64-apple-darwin
- WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2
- )
- else (CMAKE_OSX_ARCHITECTURES MATCHES arm64)
- execute_process(
- COMMAND ./configure --disable-static --host=${CMAKE_OSX_ARCHITECTURES}-apple-darwin
- WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2
- )
- endif (CMAKE_OSX_ARCHITECTURES MATCHES arm64)
- unset(ENV{CFLAGS})
- else (DARWIN)
execute_process(
- COMMAND ./configure --disable-shared
- WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2
+ COMMAND lipo -archs libxmlrpc-epi.0.dylib
+ WORKING_DIRECTORY ${LIBS_PREBUILT_DIR}/lib/release
+ OUTPUT_VARIABLE xmlrpc-epi_archs
+ OUTPUT_STRIP_TRAILING_WHITESPACE
)
+ if (NOT ${xmlrpc-epi_archs} EQUAL ${CMAKE_OSX_ARCHITECTURES})
+ execute_process(
+ COMMAND lipo
+ libxmlrpc-epi.0.dylib
+ -thin ${CMAKE_OSX_ARCHITECTURES}
+ -output libxmlrpc-epi.0.dylib
+ WORKING_DIRECTORY ${LIBS_PREBUILT_DIR}/lib/release
+ )
+ endif (NOT ${xmlrpc-epi_archs} EQUAL ${CMAKE_OSX_ARCHITECTURES})
endif (DARWIN)
- execute_process(
- COMMAND make -j${MAKE_JOBS}
- WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2
- RESULT_VARIABLE xmlrpc-epi_installed
- )
- unset(ENV{CPPFLAGS})
- file(
- COPY
- ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2/src/.libs/libxmlrpc-epi.dylib
- ${CMAKE_BINARY_DIR}/xmlrpc-epi-0.54.2/src/.libs/libxmlrpc-epi.0.dylib
- DESTINATION ${LIBS_PREBUILT_DIR}/lib/release
- FOLLOW_SYMLINK_CHAIN
- )
- file(WRITE ${PREBUILD_TRACKING_DIR}/xmlrpc-epi_installed "${xmlrpc-epi_installed}")
-endif (NOT USESYSTEMLIBS)
+endif (${LINUX_DISTRO} MATCHES opensuse-tumbleweed OR DARWIN OR NOT USESYSTEMLIBS)
target_link_libraries(ll::xmlrpc-epi INTERFACE xmlrpc-epi )
if (NOT USESYSTEMLIBS)
target_include_directories( ll::xmlrpc-epi SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include)