Skip to content

Commit

Permalink
Updated OpenSSL
Browse files Browse the repository at this point in the history
  • Loading branch information
EduMenges committed Jul 9, 2024
1 parent eae4811 commit 1084f07
Show file tree
Hide file tree
Showing 16 changed files with 129 additions and 62 deletions.
2 changes: 1 addition & 1 deletion AsyncIOManager
Submodule AsyncIOManager updated 1 files
+4 −4 CMakeLists.txt
5 changes: 1 addition & 4 deletions build/Android/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,7 @@ set(OPENSSL_INCLUDE_DIR ${OPENSSL_ROOT_DIR}/include)
set(_OPENSSL_CACHE_ARGS
-DOPENSSL_USE_STATIC_LIBS:BOOL=ON
-DOPENSSL_ROOT_DIR:PATH=${OPENSSL_ROOT_DIR}
-DOPENSSL_INCLUDE_DIR:PATH=${OPENSSL_INCLUDE_DIR}
-DOPENSSL_LIBRARIES:PATH=${OPENSSL_ROOT_DIR}/lib
-DOPENSSL_CRYPTO_LIBRARY:FILEPATH=${OPENSSL_ROOT_DIR}/lib/libcrypto${CMAKE_STATIC_LIBRARY_SUFFIX}
-DOPENSSL_SSL_LIBRARY:FILEPATH=${OPENSSL_ROOT_DIR}/lib/libssl${CMAKE_STATIC_LIBRARY_SUFFIX}
-DOpenSSL_DIR:PATH=${OPENSSL_ROOT_DIR}/lib/cmake/OpenSSL
)

# rocksdb
Expand Down
2 changes: 1 addition & 1 deletion build/Android/Openssl-build/build-win.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export CC=clang
SCRIPT_PATH="${0%/*}"
CONFIGDIR="$SCRIPT_PATH/../../../openssl"
REALCONFIGDIR=$(cd "$CONFIGDIR" && pwd)
OPENSSL_CONFIGURE_CMD="${REALCONFIGDIR}/Configure $DEBUG_FLAGS no-asm no-shared $ABI --prefix=$BUILD_DIR --openssldir=$BUILD_DIR"
OPENSSL_CONFIGURE_CMD="${REALCONFIGDIR}/Configure $DEBUG_FLAGS no-asm no-shared $ABI --prefix=$BUILD_DIR --openssldir=$BUILD_DIR" --libdir=lib android-arm64

echo "Building OpenSSL"
echo $OPENSSL_CONFIGURE_CMD
Expand Down
2 changes: 1 addition & 1 deletion build/Android/Openssl-build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export PATH=$LOCAL_ANDROID_NDK:$LOCAL_ANDROID_TOOLCHAIN:$LOCAL_PATH
CONFIGDIR=$(dirname $0)/../../../openssl
REALCONFIGDIR=$(realpath ${CONFIGDIR})

OPENSSL_CONFIGURE_CMD="${REALCONFIGDIR}/Configure $ABI $BUILD_TYPE no-asm no-shared --prefix=$BUILD_DIR --openssldir=$BUILD_DIR"
OPENSSL_CONFIGURE_CMD="${REALCONFIGDIR}/Configure $ABI $BUILD_TYPE no-asm no-shared --prefix=$BUILD_DIR --openssldir=$BUILD_DIR --libdir=lib"

echo "Building OpenSSL"
echo $OPENSSL_CONFIGURE_CMD
Expand Down
5 changes: 4 additions & 1 deletion build/CommonCompilerOptions.CMake
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,7 @@ set(BOOST_INCLUDE_LIBRARIES date_time filesystem log program_options random rege
list(JOIN BOOST_INCLUDE_LIBRARIES "," BOOST_INCLUDE_LIBRARIES_COMMA_SEPARATED)

string(REPLACE " " ";" BOOST_B2_FLAGS "${CMAKE_CXX_FLAGS}")
list(TRANSFORM BOOST_B2_FLAGS PREPEND "cxxflags=")
list(TRANSFORM BOOST_B2_FLAGS PREPEND "cxxflags=")

# OpenSSL
set(OPENSSL_VARIANT $<IF:$<CONFIG:Debug>,--debug,--release>)
15 changes: 7 additions & 8 deletions build/CommonTargets.CMake
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ ExternalProject_Add(libp2p
${_BOOST_CACHE_ARGS}
${_OPENSSL_CACHE_ARGS}
${_CMAKE_COMMON_CACHE_ARGS}
-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}\ -I\ ${_FINDPACKAGE_GSL_INCLUDE_DIR}\ -I\ ${_FINDPACKAGE_SQLITE3_INCLUDE_DIR}\ -I\ ${OPENSSL_INCLUDE_DIR}
-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}\ -I\ ${_FINDPACKAGE_GSL_INCLUDE_DIR}\ -I\ ${_FINDPACKAGE_SQLITE3_INCLUDE_DIR}
DEPENDS Boost Microsoft.GSL openssl cares ${PROTOBUF_TARGET} fmt yaml-cpp soralog tsl_hat_trie Boost.DI SQLiteModernCpp grpc
)
set(_FINDPACKAGE_libp2p_CONFIG_DIR "${CMAKE_CURRENT_BINARY_DIR}/libp2p/lib/cmake/libp2p")
Expand Down Expand Up @@ -404,7 +404,7 @@ ExternalProject_Add(ipfs-lite-cpp
${_BOOST_CACHE_ARGS}
${_OPENSSL_CACHE_ARGS}
${ipfs-lite-cpp_EXTRA_PARAM}
-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}\ -I\ ${_FINDPACKAGE_GSL_INCLUDE_DIR}\ -I\ ${OPENSSL_INCLUDE_DIR}
-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}\ -I\ ${_FINDPACKAGE_GSL_INCLUDE_DIR}
DEPENDS Microsoft.GSL spdlog tsl_hat_trie libp2p grpc ${PROTOBUF_TARGET} rocksdb Boost.DI
)
set(_FINDPACKAGE_IPFS_LITE_CONFIG_DIR "${CMAKE_CURRENT_BINARY_DIR}/ipfs-lite-cpp/cmake/ipfs-lite-cpp")
Expand Down Expand Up @@ -438,7 +438,7 @@ ExternalProject_Add(ipfs-pubsub
${_BOOST_CACHE_ARGS}
${_OPENSSL_CACHE_ARGS}
${ipfs-pubsub_EXTRA_PARAM}
-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}\ -I\ ${_FINDPACKAGE_GSL_INCLUDE_DIR}\ -I\ ${OPENSSL_INCLUDE_DIR}
-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}\ -I\ ${_FINDPACKAGE_GSL_INCLUDE_DIR}
DEPENDS Microsoft.GSL spdlog tsl_hat_trie libp2p Boost.DI ipfs-lite-cpp
)
set(_FINDPACKAGE_IPFS_PUBSUB_CONFIG_DIR "${CMAKE_CURRENT_BINARY_DIR}/ipfs-pubsub/lib/cmake/ipfs-pubsub")
Expand Down Expand Up @@ -471,7 +471,7 @@ ExternalProject_Add(ipfs-bitswap-cpp
${_BOOST_CACHE_ARGS}
${_OPENSSL_CACHE_ARGS}
${ipfs-bitswap-cpp_EXTRA_PARAM}
-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}\ -I\ ${Boost_INCLUDE_DIR}\ -I\ ${_FINDPACKAGE_GSL_INCLUDE_DIR}\ -I\ ${_FINDPACKAGE_SPDLOG_INCLUDE_DIR}\ -I\ ${OPENSSL_INCLUDE_DIR}\ -I\ ${Protobuf_INCLUDE_DIR}
-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}\ -I\ ${_FINDPACKAGE_GSL_INCLUDE_DIR}
DEPENDS Microsoft.GSL spdlog libp2p Boost
)
set(_FINDPACKAGE_IPFS_BITSWAP_CONFIG_DIR "${CMAKE_CURRENT_BINARY_DIR}/ipfs-bitswap-cpp/lib/cmake/ipfs-bitswap-cpp")
Expand Down Expand Up @@ -619,13 +619,11 @@ ExternalProject_Add(wallet-core
${_BOOST_CACHE_ARGS}
${_OPENSSL_CACHE_ARGS}
${_GRPC_CACHE_ARGS}
-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}\ -I\ ${OPENSSL_INCLUDE_DIR}
PATCH_COMMAND ${_WALLET_CORE_GENERATE_SCRIPT} --target-os=${_WALLET_CORE_ARCH} --arch-abi=${WALLET_CORE_ARCH_ABI} --protobuf-dir=${PROTOBUF_HOST_PREFIX} --out-dir=<INSTALL_DIR> --plugin-dir=${ProtobufPlugin_DIR}/bin
DEPENDS Boost grpc openssl protobuf-plugin
)

# ----------------------BUILD EXTERNAL PROJECT------------------
# LIBSSH2
# libssh2
ExternalProject_Add(libssh2
PREFIX libssh2
SOURCE_DIR "${THIRDPARTY_DIR}/libssh2"
Expand All @@ -648,6 +646,7 @@ set(_FINDPACKAGE_LIBSSH2_CONFIG_DIR "${CMAKE_CURRENT_BINARY_DIR}/libssh2/lib/cma
set(_FINDPACKAGE_LIBSSH2_LIBRARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/libssh2/lib")
set(_FINDPACKAGE_LIBSSH2_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}/libssh2/include")

# AsyncIOManager
ExternalProject_Add(AsyncIOManager
PREFIX AsyncIOManager
SOURCE_DIR "${THIRDPARTY_DIR}/AsyncIOManager"
Expand Down Expand Up @@ -681,7 +680,7 @@ ExternalProject_Add(AsyncIOManager
${_BOOST_CACHE_ARGS}
${_OPENSSL_CACHE_ARGS}
${_CMAKE_COMMON_CACHE_ARGS}
DEPENDS libssh2 openssl ipfs-lite-cpp ipfs-bitswap-cpp grpc ${PROTOBUF_TARGET} Boost
DEPENDS libssh2 openssl ipfs-lite-cpp ipfs-bitswap-cpp grpc ${PROTOBUF_TARGET} Boost MNN
)
set(_FINDPACKAGE_ASIOMGR_CONFIG_DIR "${CMAKE_CURRENT_BINARY_DIR}/AsyncIOManager/lib/cmake/AsyncIOManager")
set(_FINDPACKAGE_ASIOMGR_LIBRARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/AsyncIOManager/lib")
Expand Down
7 changes: 2 additions & 5 deletions build/Linux/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,10 @@ set(_BOOST_CACHE_ARGS
# OpenSSL
set(OPENSSL_ROOT_DIR "${CMAKE_CURRENT_BINARY_DIR}/openssl/build/${CMAKE_SYSTEM_NAME}")

set(OPENSSL_VARIANT "$<$<CONFIG:Debug>:-d >")

ExternalProject_Add(openssl
PREFIX openssl
SOURCE_DIR "${THIRDPARTY_DIR}/openssl"
CONFIGURE_COMMAND <SOURCE_DIR>/config ${OPENSSL_VARIANT}-fPIC --prefix=${OPENSSL_ROOT_DIR} --openssldir=${OPENSSL_ROOT_DIR} --static -static
CONFIGURE_COMMAND <SOURCE_DIR>/Configure ${OPENSSL_VARIANT} -fPIC --prefix=${OPENSSL_ROOT_DIR} --openssldir=${OPENSSL_ROOT_DIR} --libdir=lib -static linux-${CMAKE_SYSTEM_PROCESSOR}-clang
BUILD_COMMAND make build_libs
BUILD_IN_SOURCE FALSE
INSTALL_COMMAND make install_dev
Expand All @@ -50,8 +48,7 @@ set(OPENSSL_INCLUDE_DIR ${OPENSSL_ROOT_DIR}/include)
set(_OPENSSL_CACHE_ARGS
-DOPENSSL_USE_STATIC_LIBS:BOOL=ON
-DOPENSSL_ROOT_DIR:PATH=${OPENSSL_ROOT_DIR}
-DOPENSSL_INCLUDE_DIR:PATH=${OPENSSL_INCLUDE_DIR}
-DOPENSSL_LIBRARIES:PATH=${OPENSSL_ROOT_DIR}/lib
-DOpenSSL_DIR:PATH=${OPENSSL_ROOT_DIR}/lib/cmake/OpenSSL
)

# ed25519 crypto
Expand Down
6 changes: 2 additions & 4 deletions build/OSX/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,11 @@ set(_BOOST_CACHE_ARGS

# OpenSSL
set(OPENSSL_ROOT_DIR "${CMAKE_CURRENT_BINARY_DIR}/openssl/build/${CMAKE_SYSTEM_NAME}")
set(OPENSSL_VARIANT "$<IF:$<CONFIG:Debug>,--debug,--release>")

ExternalProject_Add(openssl
PREFIX openssl
SOURCE_DIR "${THIRDPARTY_DIR}/openssl"
CONFIGURE_COMMAND <SOURCE_DIR>/Configure darwin64-x86_64-cc ${OPENSSL_VARIANT} -static --prefix=${OPENSSL_ROOT_DIR} --openssldir=${OPENSSL_ROOT_DIR} -mmacosx-version-min=12.1
CONFIGURE_COMMAND <SOURCE_DIR>/Configure ${OPENSSL_VARIANT} --prefix=${OPENSSL_ROOT_DIR} --openssldir=${OPENSSL_ROOT_DIR} -mmacosx-version-min=12.1 --libdir=lib -static darwin64-${CMAKE_SYSTEM_PROCESSOR}-cc
BUILD_COMMAND make build_libs
BUILD_IN_SOURCE FALSE
INSTALL_COMMAND make install_dev
Expand All @@ -95,8 +94,7 @@ set(OPENSSL_INCLUDE_DIR ${OPENSSL_ROOT_DIR}/include)
set(_OPENSSL_CACHE_ARGS
-DOPENSSL_USE_STATIC_LIBS:BOOL=ON
-DOPENSSL_ROOT_DIR:PATH=${OPENSSL_ROOT_DIR}
-DOPENSSL_INCLUDE_DIR:PATH=${OPENSSL_INCLUDE_DIR}
-DOPENSSL_LIBRARIES:PATH=${OPENSSL_ROOT_DIR}/lib
-DOpenSSL_DIR:PATH=${OPENSSL_ROOT_DIR}/lib/cmake/OpenSSL
)

# MoltenVK
Expand Down
5 changes: 2 additions & 3 deletions build/Windows/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ set(OPENSSL_ROOT_DIR "${CMAKE_CURRENT_BINARY_DIR}/openssl/build/${CMAKE_SYSTEM_N
ExternalProject_Add(openssl
PREFIX openssl
SOURCE_DIR "${THIRDPARTY_DIR}/openssl"
CONFIGURE_COMMAND perl ${THIRDPARTY_DIR}/openssl/Configure $<IF:$<CONFIG:Debug>,--debug,--release> enable-capieng no-shared no-asm --prefix=${OPENSSL_ROOT_DIR} --openssldir=${OPENSSL_ROOT_DIR} VC-WIN64A
CONFIGURE_COMMAND perl ${THIRDPARTY_DIR}/openssl/Configure ${OPENSSL_VARIANT} enable-capieng no-shared --prefix=${OPENSSL_ROOT_DIR} --openssldir=${OPENSSL_ROOT_DIR} --libdir=lib -static VC-WIN64A
BUILD_COMMAND nmake build_libs
BUILD_IN_SOURCE false
INSTALL_COMMAND nmake install_dev
Expand All @@ -96,8 +96,7 @@ set(_OPENSSL_CACHE_ARGS
-DOPENSSL_USE_STATIC_LIBS:BOOL=ON
-DOPENSSL_MSVC_STATIC_RT:BOOL=ON
-DOPENSSL_ROOT_DIR:PATH=${OPENSSL_ROOT_DIR}
-DOPENSSL_INCLUDE_DIR:PATH=${OPENSSL_INCLUDE_DIR}
-DOPENSSL_LIBRARIES:PATH=${OPENSSL_ROOT_DIR}/lib
-DOpenSSL_DIR:PATH=${OPENSSL_ROOT_DIR}/lib/cmake/OpenSSL
)

# ed25519 crypto
Expand Down
6 changes: 2 additions & 4 deletions build/iOS/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ ExternalProject_Add(openssl
PREFIX openssl
SOURCE_DIR "${THIRDPARTY_DIR}/openssl"
CONFIGURE_COMMAND ""
BUILD_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/Openssl-build/build-libssl.sh ${BOOST_BUILD_VARIANT} --version=1.1.1g --targets=ios64-cross-arm64 --src-dir=${THIRDPARTY_DIR}/openssl --build-dir=${OPENSSL_ROOT_DIR}
BUILD_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/Openssl-build/build-libssl.sh $<$<CONFIG:Debug>:--debug> --version=3.3.1 --targets=ios64-cross-arm64 --src-dir=${THIRDPARTY_DIR}/openssl --build-dir=${OPENSSL_ROOT_DIR}
INSTALL_COMMAND ""
UPDATE_COMMAND ""
)
Expand All @@ -89,9 +89,7 @@ set(OPENSSL_INCLUDE_DIR ${OPENSSL_ROOT_DIR}/include)
set(_OPENSSL_CACHE_ARGS
-DOPENSSL_USE_STATIC_LIBS:BOOL=ON
-DOPENSSL_ROOT_DIR:PATH=${OPENSSL_ROOT_DIR}
-DOPENSSL_INCLUDE_DIR:PATH=${OPENSSL_INCLUDE_DIR}
-DOPENSSL_CRYPTO_LIBRARY:FILEPATH=${OPENSSL_ROOT_DIR}/lib/libcrypto${CMAKE_STATIC_LIBRARY_SUFFIX}
-DOPENSSL_SSL_LIBRARY:FILEPATH=${OPENSSL_ROOT_DIR}/lib/libssl${CMAKE_STATIC_LIBRARY_SUFFIX}
-DOpenSSL_DIR:PATH=${OPENSSL_ROOT_DIR}/lib/cmake/OpenSSL
)

# MoltenVK
Expand Down
59 changes: 50 additions & 9 deletions build/iOS/Openssl-build/build-libssl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,16 @@ set -u
# SCRIPT DEFAULTS

# Default version in case no version is specified
DEFAULTVERSION="1.1.1j"
DEFAULTVERSION="3.2.0"

# Default (=full) set of targets (OpenSSL >= 1.1.1) to build
DEFAULTTARGETS=`cat <<TARGETS
ios-sim-cross-x86_64 ios-sim-cross-arm64 ios64-cross-arm64 ios64-cross-arm64e
macos64-x86_64 macos64-arm64
mac-catalyst-x86_64 mac-catalyst-arm64
watchos-cross-armv7k watchos-cross-arm64_32 watchos-sim-cross-x86_64 watchos-sim-cross-i386 watchos-sim-cross-arm64
tvos-sim-cross-x86_64 tvos64-cross-arm64
tvos-sim-cross-x86_64 tvos-sim-cross-arm64 tvos-cross-arm64
xros-sim-cross-arm64 xros-cross-arm64
TARGETS`
# Minimum iOS/tvOS SDK version to build for
Expand All @@ -42,6 +43,7 @@ MACOS_MIN_SDK_VERSION="10.15"
CATALYST_MIN_SDK_VERSION="10.15"
WATCHOS_MIN_SDK_VERSION="4.0"
TVOS_MIN_SDK_VERSION="12.0"
XROS_MIN_SDK_VERSION="1.0"
# Init optional env variables (use available variable or default to empty string)
CURL_OPTIONS="${CURL_OPTIONS:-}"
Expand All @@ -61,12 +63,12 @@ echo_help()
echo " --catalyst-sdk=SDKVERSION Override macOS SDK version for Catalyst"
echo " --watchos-sdk=SDKVERSION Override watchOS SDK version"
echo " --tvos-sdk=SDKVERSION Override tvOS SDK version"
echo " --xros-sdk=SDKVERSION Override xrOS SDK version"
echo " --min-ios-sdk=SDKVERSION Set minimum iOS SDK version (default: $IOS_MIN_SDK_VERSION)"
echo " --min-macos-sdk=SDKVERSION Set minimum macOS SDK version (default: $MACOS_MIN_SDK_VERSION)"
echo " --min-watchos-sdk=SDKVERSION Set minimum watchOS SDK version (default: $WATCHOS_MIN_SDK_VERSION)"
echo " --min-tvos-sdk=SDKVERSION Set minimum tvOS SDK version (default: $TVOS_MIN_SDK_VERSION)"
echo " --noparallel Disable running make with parallel jobs (make -j)"
echo " --disable-bitcode Disable embedding Bitcode"
echo " -v, --verbose Enable verbose logging"
echo " --verbose-on-error Dump last 500 lines from log file if an error occurs (for Travis builds)"
echo " --version=VERSION OpenSSL version to build (defaults to ${DEFAULTVERSION})"
Expand Down Expand Up @@ -186,6 +188,14 @@ finish_build_loop()
else
OPENSSLCONF_SUFFIX="ios_${ARCH}"
fi
elif [[ "${PLATFORM}" == XR* ]]; then
LIBSSL_XROS+=("${TARGETDIR}/lib/libssl.a")
LIBCRYPTO_XROS+=("${TARGETDIR}/lib/libcrypto.a")
if [[ "${PLATFORM}" == XRSimulator* ]]; then
OPENSSLCONF_SUFFIX="xros_sim_${ARCH}"
else
OPENSSLCONF_SUFFIX="xros_${ARCH}"
fi
elif [[ "${PLATFORM}" == Watch* ]]; then
LIBSSL_WATCHOS+=("${TARGETDIR}/lib/libssl.a")
LIBCRYPTO_WATCHOS+=("${TARGETDIR}/lib/libcrypto.a")
Expand Down Expand Up @@ -223,25 +233,40 @@ finish_build_loop()
fi
}
gpg_validate()
{
local TARGET=$1
local SIG=${2:-${TARGET}.asc}
GPG_B=$(which gpg)
if [ ! -x "${GPG_B}" ]; then
echo "WARN: No gpg executable found in PATH. Please consider installing gpg so archive signature validation can proceed."
return 1
fi
$GPG_B --keyserver keys.openpgp.org --keyserver-options auto-key-retrieve,include-subkeys --verify-options show-photos --verify "${SIG}" "${TARGET}"
}
# Init optional command line vars
ARCHS=""
BRANCH=""
CLEANUP=""
CONFIG_ENABLE_EC_NISTP_64_GCC_128=""
CONFIG_DISABLE_BITCODE=""
CONFIG_DISABLE_BITCODE="true"
CONFIG_NO_DEPRECATED=""
IOS_SDKVERSION=""
MACOS_SDKVERSION=""
CATALYST_SDKVERSION=""
WATCHOS_SDKVERSION=""
TVOS_SDKVERSION=""
XROS_SDKVERSION=""
LOG_VERBOSE=""
PARALLEL=""
TARGETS=""
VERSION=""
SRC_DIR=""
BUILD_DIR=""
DEBUG_FLAGS=""
DEBUG_FLAGS="--release"
# Process command line arguments
for i in "$@"
Expand All @@ -260,9 +285,6 @@ case $i in
--ec-nistp-64-gcc-128)
CONFIG_ENABLE_EC_NISTP_64_GCC_128="true"
;;
--disable-bitcode)
CONFIG_DISABLE_BITCODE="true"
;;
-h|--help)
echo_help
exit
Expand Down Expand Up @@ -303,6 +325,10 @@ case $i in
TVOS_MIN_SDK_VERSION="${i#*=}"
shift
;;
--min-xros-sdk=*)
XROS_MIN_SDK_VERSION="${i#*=}"
shift
;;
--noparallel)
PARALLEL="false"
;;
Expand All @@ -329,7 +355,7 @@ case $i in
shift
;;
--debug)
DEBUG_FLAGS="-g"
DEBUG_FLAGS="--debug"
shift
;;
*)
Expand Down Expand Up @@ -402,6 +428,9 @@ fi
if [ ! -n "${TVOS_SDKVERSION}" ]; then
TVOS_SDKVERSION=$(xcrun -sdk appletvos --show-sdk-version)
fi
if [ ! -n "${XROS_SDKVERSION}" ]; then
XROS_SDKVERSION=$(xcrun -sdk xros --show-sdk-version)
fi
# Truncate to minor version
MINOR_VERSION=(${MACOS_SDKVERSION//./ })
Expand Down Expand Up @@ -456,6 +485,7 @@ echo " macOS SDK: ${MACOS_SDKVERSION} (min ${MACOS_MIN_SDK_VERSION})"
echo " macOS SDK (Catalyst): ${CATALYST_SDKVERSION} (min ${CATALYST_MIN_SDK_VERSION})"
echo " watchOS SDK: ${WATCHOS_SDKVERSION} (min ${WATCHOS_MIN_SDK_VERSION})"
echo " tvOS SDK: ${TVOS_SDKVERSION} (min ${TVOS_MIN_SDK_VERSION})"
echo " xrOS SDK: ${XROS_SDKVERSION} (min ${XROS_MIN_SDK_VERSION})"
if [ "${CONFIG_DISABLE_BITCODE}" == "true" ]; then
echo " Bitcode embedding disabled"
fi
Expand Down Expand Up @@ -542,6 +572,8 @@ LIBSSL_WATCHOS=()
LIBCRYPTO_WATCHOS=()
LIBSSL_TVOS=()
LIBCRYPTO_TVOS=()
LIBSSL_XROS=()
LIBCRYPTO_XROS=()
source "${SCRIPTDIR}/scripts/build-loop-targets.sh"
Expand Down Expand Up @@ -608,9 +640,18 @@ if [ ${#OPENSSLCONF_ALL[@]} -gt 1 ]; then
*_tvos_arm64.h)
DEFINE_CONDITION="TARGET_OS_TV && TARGET_OS_EMBEDDED && TARGET_CPU_ARM64"
;;
*_tvos_sim_arm64.h)
DEFINE_CONDITION="TARGET_OS_TV && TARGET_OS_SIMULATOR && TARGET_CPU_ARM64"
;;
*_tvos_sim_x86_64.h)
DEFINE_CONDITION="TARGET_OS_TV && TARGET_OS_SIMULATOR && TARGET_CPU_X86_64"
;;
*_xros_sim_arm64.h)
DEFINE_CONDITION="TARGET_OS_VISION && TARGET_OS_SIMULATOR && TARGET_CPU_ARM64"
;;
*_xros_arm64.h)
DEFINE_CONDITION="TARGET_OS_VISION && TARGET_CPU_ARM64"
;;
*)
# Don't run into unexpected cases by setting the default condition to false
DEFINE_CONDITION="0"
Expand Down
Loading

0 comments on commit 1084f07

Please sign in to comment.