diff --git a/README.md b/README.md index 5eba9cd..6559681 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Android OpenSSL support for Qt -OpenSSL scripts and binaries for Android (useful for Qt Android apps) +OpenSSL scripts and binaries - supports Qt for Android apps. In this repo you can find the prebuilt OpenSSL libs for Android, a QMake include project `.pri` file that can be used integrated with Qt projects, and a `.cmake` file for CMake based projects. @@ -50,10 +50,10 @@ endif() ## Build Script -The build script `build_ssl.sh` can be used to rebuild the OpenSSL libraries. Since specific -versions might depend or work better with specific NDK versions, the OpenSSL/NDK version -combinations are defined in the script. Before running the script, check that the NDK paths -are correct for your environment. +You may use `build_ssl.sh` to rebuild OpenSSL libraries. OpenSSL/NDK version +pairs are predefined in the script to ensure compatibility with specific Qt +versions. Make sure the NDK paths and versions match your setup before running +it. ### Build Prerequisites diff --git a/build_ssl.sh b/build_ssl.sh index 238a630..5b321fd 100755 --- a/build_ssl.sh +++ b/build_ssl.sh @@ -153,9 +153,15 @@ EOF ;; esac + echo "Configuring OpenSSL $ssl_version with NDK $ndk on ABI $arch" config_params=( "${build_type}" "shared" "android-${arch}" "-U__ANDROID_API__" "-D__ANDROID_API__=${ANDROID_API}" ) - echo "Configuring OpenSSL $ssl_version with NDK $ndk" + if [ "$arch" = "arm64" -o "$arch" = "x86_64" ]; then + if [ "${ndk:0:2}" -ge 25 ]; then + echo "Configuring OpenSSL to 16KB page sizes" + config_params+=("LDFLAGS="$LDFLAGS -Wl,-z,max-page-size=16384"") + fi + fi echo "Configure parameters: ${config_params[@]}" ./Configure "${config_params[@]}" 2>&1 1>${log_file} | tee -a ${log_file} || exit 1 @@ -220,20 +226,18 @@ for build_type in "${build_types[@]}"; do rm -fr "$output_dir" mkdir -p "$output_dir" || exit 1 + build_ssl ${log_file} + strip_libs + copy_build_artefacts ${output_dir} + # Copy the include dir only once since since it's the same for all abis if [ ! -d "$output_dir/../include" ]; then cp -a include "$output_dir/../" || exit 1 # Clean include folder - find "$output_dir/../" -name "*.in" -delete - find "$output_dir/../" -name "*.def" -delete + find "$output_dir/../" -name "*.in" -print -delete + find "$output_dir/../" -name "*.def" -print -delete fi - - build_ssl ${log_file} - strip_libs - copy_build_artefacts ${output_dir} - - popd done popd