mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-11 23:49:38 -05:00
Fix android compilation with newer Qt
In lastest Qt versions linux-* mkspec doesn't match android anymore, this was triggering a compilation error as DATA_DIR was not defined the RsAccountsDetail::PathDataDirectory(bool check) code has been rearranged so it works reasonably also on Android and do not depend on DATA_DIR define anymore Updated Android compiling documentation
This commit is contained in:
parent
ebf99a4eaf
commit
034d88c4e2
@ -1,15 +1,13 @@
|
||||
Compile Retroshare for Android
|
||||
==============================
|
||||
|
||||
== Introduction
|
||||
|
||||
Compiling an application for Android is not as easy as one would imagine,
|
||||
expecially one like RetroShare that has a big codebase and is not well
|
||||
documented.
|
||||
This document is aimed to empower the reader so she can hopefully succed or at
|
||||
least have a significant help in compiling her own RetroShare APK package
|
||||
documented. This document is aimed to empower the reader so she can hopefully
|
||||
succed or at least have a significant help in compiling her own RetroShare APK
|
||||
installable on Android.
|
||||
|
||||
|
||||
== Preparing The Environement
|
||||
|
||||
First of all setup your Qt for Android development environement following the
|
||||
@ -21,7 +19,7 @@ on your Android phone Qt for Android examples.
|
||||
But RetroShare is not as simple to compile as those examples. The good news is
|
||||
that Android NDK ships all the necessary to build a custom toolchain that is
|
||||
suitable to build RetroShare.
|
||||
In order to build the toolchain with needed library RetroShare provides the
|
||||
In order to build the toolchain with needed libraries RetroShare provides the
|
||||
+android-prepare-toolchain.sh+ script; before you execute it you should define
|
||||
some variables the script cannot determine in an easy and reliable manner by
|
||||
itself in your terminal.
|
||||
@ -33,7 +31,7 @@ export ANDROID_NDK_PATH="/opt/android-ndk/"
|
||||
|
||||
## The path where your fresh compiled toolchain will be installed, make sure
|
||||
## the parent exists
|
||||
export NDK_TOOLCHAIN_PATH="/home/$(whoami)/Development/android-toolchains/retroshare-android/"
|
||||
export NDK_TOOLCHAIN_PATH="${HOME}/Builds/android-toolchains/retroshare-android/"
|
||||
|
||||
## The CPU architecture of the Android device you want to target
|
||||
export ANDROID_NDK_ARCH="arm"
|
||||
|
@ -5,7 +5,7 @@
|
||||
[ -z ${ANDROID_NDK_ARCH+x} ] && export ANDROID_NDK_ARCH="arm"
|
||||
[ -z ${ANDROID_NDK_ABI_VER+x} ] && export ANDROID_NDK_ABI_VER="4.9"
|
||||
[ -z ${ANDROID_PLATFORM_VER+x} ] && export ANDROID_PLATFORM_VER="18"
|
||||
[ -z ${NDK_TOOLCHAIN_PATH+x} ] && export NDK_TOOLCHAIN_PATH="/home/$(whoami)/Development/android-toolchains/retroshare-android-${ANDROID_PLATFORM_VER}-${ANDROID_NDK_ARCH}-abi${ANDROID_NDK_ABI_VER}/"
|
||||
[ -z ${NDK_TOOLCHAIN_PATH+x} ] && export NDK_TOOLCHAIN_PATH="${HOME}/Builds/android-toolchains/retroshare-android-${ANDROID_PLATFORM_VER}-${ANDROID_NDK_ARCH}-abi${ANDROID_NDK_ABI_VER}/"
|
||||
[ -z ${HOST_NUM_CPU+x} ] && export HOST_NUM_CPU=4
|
||||
|
||||
runDir="$(pwd)"
|
||||
|
@ -916,7 +916,7 @@ test_bitdht {
|
||||
################################# Android #####################################
|
||||
|
||||
android-g++ {
|
||||
## ifaddrs is missing on Android add them don't use the one from
|
||||
## ifaddrs is missing on Android to add them don't use the one from
|
||||
## https://github.com/morristech/android-ifaddrs
|
||||
## because they crash, use QNetworkInterface from Qt instead
|
||||
CONFIG *= qt
|
||||
|
@ -803,7 +803,8 @@ static bool checkAccount(std::string accountdir, AccountDetails &account,std::ma
|
||||
|
||||
/* Use RetroShare's exe dir */
|
||||
dataDirectory = ".";
|
||||
|
||||
#elif defined(ANDROID)
|
||||
dataDirectory = defaultBaseDirectory()+"/usr/share/retroshare";
|
||||
#elif defined(DATA_DIR)
|
||||
dataDirectory = DATA_DIR;
|
||||
// For all other OS the data directory must be set in libretroshare.pro
|
||||
|
@ -6,4 +6,4 @@
|
||||
androidBuildToolsVersion=24.0.1
|
||||
androidCompileSdkVersion=23
|
||||
buildDir=.build
|
||||
qt5AndroidDir=/opt/Qt5.8.0/5.8/android_armv7/src/android/java
|
||||
qt5AndroidDir=/opt/Qt/5.9.2/android_armv7/src/android/java
|
||||
|
@ -133,7 +133,7 @@ android-g++ {
|
||||
# message(ANDROID_EXTRA_LIBS: $$ANDROID_EXTRA_LIBS)
|
||||
# message(ANDROID_PLATFORM: $$ANDROID_PLATFORM)
|
||||
# message(ANDROID_PLATFORM_ROOT_PATH: $$ANDROID_PLATFORM_ROOT_PATH)
|
||||
# message(NDK_TOOLCHAIN_PATH: $$NDK_TOOLCHAIN_PATH)
|
||||
# message(NATIVE_LIBS_TOOLCHAIN_PATH: $$NATIVE_LIBS_TOOLCHAIN_PATH)
|
||||
}
|
||||
|
||||
win32 {
|
||||
|
Loading…
Reference in New Issue
Block a user