@@ -244,8 +244,6 @@ libxml2_version=$(versionFromTag ${swift_source_dir}/libxml2)
244244curl_desc=$( describe ${swift_source_dir} /curl | tr ' _' ' .' )
245245curl_version=${curl_desc# curl-}
246246
247- boringssl_version=$( describe ${source_dir} /boringssl)
248-
249247function quiet_pushd {
250248 pushd " $1 " > /dev/null 2>&1
251249}
@@ -289,7 +287,7 @@ echo "Building from:"
289287echo " - Swift ${swift_version} "
290288echo " - libxml2 ${libxml2_version} "
291289echo " - curl ${curl_version} "
292- echo " - BoringSSL ${boringssl_version} "
290+ echo " - OpenSSL 3.6.0 "
293291
294292# make sure the products_dir is writeable
295293ls -lad $products_dir
@@ -365,29 +363,42 @@ for arch in $archs; do
365363 quiet_popd
366364 groupend
367365
368- groupstart " Building boringssl for ${compiler_target_host} "
369- quiet_pushd ${source_dir} /boringssl
370- run cmake \
371- -GNinja \
372- -B ${build_dir} /$arch /boringssl \
373- -DANDROID_ABI=$android_abi \
374- -DANDROID_PLATFORM=android-$android_api \
375- -DCMAKE_TOOLCHAIN_FILE=$ndk_home /build/cmake/android.toolchain.cmake \
376- -DCMAKE_BUILD_TYPE=$build_type \
377- -DCMAKE_INSTALL_PREFIX=$sdk_root /usr \
378- -DCMAKE_EXTRA_LINK_FLAGS=" -Wl,-z,max-page-size=16384" \
379- -DBUILD_SHARED_LIBS=OFF \
380- -DBUILD_STATIC_LIBS=ON \
381- -DBUILD_TESTING=OFF
382-
383- quiet_pushd ${build_dir} /$arch /boringssl
384- run ninja -j$parallel_jobs
385- quiet_popd
386-
387- header " Installing BoringSSL for $arch "
388- quiet_pushd ${build_dir} /$arch /boringssl
389- run ninja -j$parallel_jobs install
390- quiet_popd
366+ groupstart " Building openssl for ${compiler_target_host} "
367+ quiet_pushd ${source_dir} /openssl
368+ (
369+ # Isolated environment
370+ export ANDROID_NDK_ROOT=" $ANDROID_NDK_HOME "
371+ export PATH=" $ANDROID_NDK_ROOT /toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH "
372+ export CFLAGS=" -O3 -g -DNDEBUG -fpic -ffunction-sections -fdata-sections -fstack-protector-strong -funwind-tables -no-canonical-prefixes"
373+
374+ case $arch in
375+ armv7)
376+ openssl_arch=" android-arm"
377+ ;;
378+ aarch64)
379+ openssl_arch=" android-arm64"
380+ ;;
381+ x86_64)
382+ openssl_arch=" android-x86_64"
383+ ;;
384+ x86)
385+ openssl_arch=" android-x86"
386+ ;;
387+ * )
388+ echo " Unknown architecture '$1 '"
389+ usage
390+ exit 0
391+ ;;
392+ esac
393+
394+ ./Configure $openssl_arch \
395+ no-shared \
396+ no-engine \
397+ zlib \
398+ --prefix=" $sdk_root /usr"
399+
400+ make && make install_sw
401+ )
391402 quiet_popd
392403 groupend
393404
@@ -637,7 +648,7 @@ mkdir -p ${swift_res_root}
637648
638649cat > $swift_res_root /SDKSettings.json << EOF
639650{
640- "DisplayName": "Swift Android SDK",
651+ "DisplayName": "Readdle Swift Android SDK",
641652 "Version": "${android_sdk_version} ",
642653 "VersionMap": {},
643654 "CanonicalName": "linux-android"
792803 "sdkRootPath": "${ndk_sysroot} ",
793804 "swiftResourcesPath": "${swift_res_root} /usr/lib/${SWIFT_RES_DIR} ",
794805 "swiftStaticResourcesPath": "${swift_res_root} /usr/lib/${SWIFT_STATIC_RES_DIR} ",
806+ "includeSearchPaths": ["${swift_res_root} /usr/include"],
795807 "toolsetPaths": [ "swift-toolset.json" ]
796808EOF
797809 # "librarySearchPaths": [ "${swift_res_root}/usr/lib/swift-x86_64/android/x86_64" ],
0 commit comments