summaryrefslogtreecommitdiffstats
path: root/packaging
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2016-08-24 13:19:30 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-08-24 13:36:32 -0700
commita5cf8aaa21842d491c583a17c01340bb61e4d4ed (patch)
tree66aae5fab024224283f205ef5cd2a124fd6ab808 /packaging
parent7dd8a62ceddbb2205bd41260964f3450e72fccab (diff)
downloadsubsurface-a5cf8aaa21842d491c583a17c01340bb61e4d4ed.tar.gz
Android build: try to create APK that works on Android 7.0
It appears that instead of statically linking against ssl/crypto/ssh2, you instead have to dynamically link against it and then bundle the library in the APK. The documentation is not 100% clear and I don't have an Android Nougat device to test this with, so for now this is an attempt. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'packaging')
-rw-r--r--packaging/android/build.sh15
1 files changed, 7 insertions, 8 deletions
diff --git a/packaging/android/build.sh b/packaging/android/build.sh
index 408a5467d..372a29b6b 100644
--- a/packaging/android/build.sh
+++ b/packaging/android/build.sh
@@ -184,7 +184,7 @@ if [ ! -e $PKG_CONFIG_LIBDIR/libssl.pc ] ; then
HOSTCC=gcc \
CC=gcc \
ANDROID_DEV=$PREFIX \
- bash -x ./config no-shared no-ssl2 no-ssl3 no-comp no-hw no-engine --openssldir=$PREFIX
+ bash -x ./config shared no-ssl2 no-ssl3 no-comp no-hw no-engine --openssldir=$PREFIX
make depend
make
make install_sw
@@ -206,7 +206,7 @@ perl -pi -e 's,ENGINE_register_all_complete\(\),,' libssh2-${LIBSSH2_VERSION}/sr
if [ ! -e $PKG_CONFIG_LIBDIR/libssh2.pc ] ; then
mkdir -p libssh2-build-$ARCH
pushd libssh2-build-$ARCH
- ../libssh2-${LIBSSH2_VERSION}/configure --host=${BUILDCHAIN} --prefix=${PREFIX} --enable-static --disable-shared
+ ../libssh2-${LIBSSH2_VERSION}/configure --host=${BUILDCHAIN} --prefix=${PREFIX} --enable-shared --disable-static
make
make install
# Patch away pkg-config dependency to zlib, its there, i promise
@@ -228,8 +228,8 @@ if [ ! -e $PKG_CONFIG_LIBDIR/libgit2.pc ] ; then
-DCMAKE_INSTALL_PREFIX=${PREFIX} \
-DCURL=OFF \
-DUSE_SSH=ON \
- -DOPENSSL_SSL_LIBRARY=${PREFIX}/lib/libssl.a \
- -DOPENSSL_CRYPTO_LIBRARY=${PREFIX}/lib/libcrypto.a \
+ -DOPENSSL_SSL_LIBRARY=${PREFIX}/lib/libssl.so \
+ -DOPENSSL_CRYPTO_LIBRARY=${PREFIX}/lib/libcrypto.so \
-DOPENSSL_INCLUDE_DIR=${PREFIX}/include/openssl \
-D_OPENSSL_VERSION=1.0.1p \
../libgit2-${LIBGIT2_VERSION}/
@@ -355,12 +355,11 @@ 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_LIBSSH2=$BUILDROOT/ndk-${ARCH}/sysroot/usr/lib/libssh2.so \
$SUBSURFACE_SOURCE
-# sometimes cmake tries to link both against the static and shared
-# libcrypto - that's not helpful
-sed -i -e "s/-lcrypto//g" CMakeFiles/subsurface-mobile.dir/link.txt
-
# set up the version number
rm -f ssrf-version.h