diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2019-10-03 16:49:10 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-10-05 08:19:31 -0700 |
commit | 00550d9284725fdc84d7b1a8f35ae42a565861e9 (patch) | |
tree | ac9e7146faeb8fc013073948594a06cec80a9cd7 /packaging/android | |
parent | ea0e447e0dec06a7063cbe435d7f8498d5a5fba7 (diff) | |
download | subsurface-00550d9284725fdc84d7b1a8f35ae42a565861e9.tar.gz |
Android: work around Android 5.x issues with OpenSSL
The Qt documentation has specific suggestions how to build our own
version of OpenSSL in order to work on Android 5.x:
https://doc.qt.io/qt-5/android-openssl-support.html
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'packaging/android')
-rwxr-xr-x | packaging/android/build.sh | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/packaging/android/build.sh b/packaging/android/build.sh index 4c97be75d..70c73b060 100755 --- a/packaging/android/build.sh +++ b/packaging/android/build.sh @@ -252,22 +252,18 @@ if [ "$QUICK" = "" ] ; then # Use env to make all these temporary, so they don't pollute later builds. env PATH=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH \ CC=clang \ - ./Configure android-"$ARCH" no-ssl2 no-ssl3 no-comp no-hw no-engine no-asm --prefix="$PREFIX" -DOPENSSL_NO_UI_CONSOLE -DOPENSSL_NO_STDIO + ./Configure shared android-"$ARCH" no-ssl2 no-ssl3 no-comp no-hw no-engine no-asm \ + --prefix="$PREFIX" -DOPENSSL_NO_UI_CONSOLE -DOPENSSL_NO_STDIO \ + -D__ANDROID_API__=$ANDROID_PLATFORM_LEVEL make depend - make build_libs - - # now fix the reference to libcrypto.so.1.1 and libssl.so.1.1 to be just unversioned - # as androiddeployqt and Android itself does not like versioned shared objects - perl -pi -e 's/libcrypto.so.1.1/libcrypto.so\x00\x00\x00\x00/' libcrypto.so.1.1 - perl -pi -e 's/libcrypto.so.1.1/libcrypto.so\x00\x00\x00\x00/' libssl.so.1.1 - perl -pi -e 's/libssl.so.1.1/libssl.so\x00\x00\x00\x00/' libcrypto.so.1.1 - perl -pi -e 's/libssl.so.1.1/libssl.so\x00\x00\x00\x00/' libssl.so.1.1 + # follow the suggestions here: https://doc.qt.io/qt-5/android-openssl-support.html + make SHLIB_VERSION_NUMBER= SHLIB_EXT=_1_1.so build_libs cp -RL include/openssl $PREFIX/include/openssl cp libcrypto.a $PREFIX/lib - cp libcrypto.so* $PREFIX/lib + cp libcrypto_1_1.so* $PREFIX/lib cp libssl.a $PREFIX/lib - cp libssl.so* $PREFIX/lib + cp libssl_1_1.so* $PREFIX/lib cp *.pc $PKG_CONFIG_LIBDIR popd @@ -312,8 +308,8 @@ if [ "$QUICK" = "" ] ; then -DCMAKE_INSTALL_PREFIX="$PREFIX" \ -DCURL=OFF \ -DUSE_SSH=OFF \ - -DOPENSSL_SSL_LIBRARY="$PREFIX"/lib/libssl.so \ - -DOPENSSL_CRYPTO_LIBRARY="$PREFIX"/lib/libcrypto.so \ + -DOPENSSL_SSL_LIBRARY="$PREFIX"/lib/libssl_1_1.so \ + -DOPENSSL_CRYPTO_LIBRARY="$PREFIX"/lib/libcrypto_1_1.so \ -DOPENSSL_INCLUDE_DIR="$PREFIX"/include/openssl \ -D_OPENSSL_VERSION="${OPENSSL_VERSION}" \ -DCMAKE_DISABLE_FIND_PACKAGE_HTTP_Parser=TRUE \ @@ -439,8 +435,8 @@ cmake $MOBILE_CMAKE \ -DCMAKE_BUILD_TYPE="$BUILD_TYPE" \ -DMAKE_TESTS=OFF \ -DFTDISUPPORT=${FTDI} \ - -DANDROID_NATIVE_LIBSSL="$BUILDROOT/ndk-$ARCH/sysroot/usr/lib/libssl.so" \ - -DANDROID_NATIVE_LIBCRYPT="$BUILDROOT/ndk-$ARCH/sysroot/usr/lib/libcrypto.so" \ + -DANDROID_NATIVE_LIBSSL="$BUILDROOT/ndk-$ARCH/sysroot/usr/lib/libssl_1_1.so" \ + -DANDROID_NATIVE_LIBCRYPT="$BUILDROOT/ndk-$ARCH/sysroot/usr/lib/libcrypto_1_1.so" \ -DCMAKE_MAKE_PROGRAM="make" \ "$SUBSURFACE_SOURCE" |