From 2ff19597dcd4abc486dbd311b551f0c22369177c Mon Sep 17 00:00:00 2001 From: Mathew Date: Fri, 9 Nov 2018 15:20:52 +1300 Subject: [PATCH] fix scripts to build with ndk r15c, cache dependancies so we are not hitting github often update android dependancies to latest and compile. ./android-build-freerdp.sh --ndk ~/Programming/android-ndk-r15c --relWithDebug --jpeg Still an error compiling openh264 --- client/Android/Studio/aFreeRDP/build.gradle | 12 ++++----- client/Android/Studio/build.gradle | 4 +-- client/Android/Studio/freeRDPCore/build.gradle | 12 ++++----- .../gradle/wrapper/gradle-wrapper.properties | 2 +- cmake/AndroidToolchain.cmake | 4 --- scripts/android-build-32.conf | 2 +- scripts/android-build-64.conf | 2 +- scripts/android-build-common.sh | 29 ++++++++++++++-------- scripts/android-build-freerdp.sh | 7 +++--- scripts/android-build-jpeg.sh | 7 +++--- scripts/android-build-openh264.sh | 4 +-- scripts/android-build-openssl.sh | 6 ++--- scripts/android-build.conf | 4 +-- 13 files changed, 49 insertions(+), 46 deletions(-) diff --git a/client/Android/Studio/aFreeRDP/build.gradle b/client/Android/Studio/aFreeRDP/build.gradle index be32859..9c30fe4 100644 --- a/client/Android/Studio/aFreeRDP/build.gradle +++ b/client/Android/Studio/aFreeRDP/build.gradle @@ -1,13 +1,13 @@ apply plugin: 'com.android.application' android { - compileSdkVersion = 27 - buildToolsVersion = "27.0.3" + compileSdkVersion = 28 + buildToolsVersion = "28.0.3" defaultConfig { applicationId "com.freerdp.afreerdp" - minSdkVersion 14 - targetSdkVersion 27 + minSdkVersion 21 + targetSdkVersion 28 vectorDrawables.useSupportLibrary = true versionCode = 14 versionName = rootProject.ext.versionName @@ -16,7 +16,7 @@ android { signingConfigs { release { storeFile file(RELEASE_STORE_FILE) - storePassword RELEASE_STORE_PASSWORD + storePassword RELEASE_KEY_PASSWORD keyAlias RELEASE_KEY_ALIAS keyPassword RELEASE_KEY_PASSWORD storeType "jks" @@ -37,5 +37,5 @@ android { } dependencies { - compile project(':freeRDPCore') + implementation project(':freeRDPCore') } diff --git a/client/Android/Studio/build.gradle b/client/Android/Studio/build.gradle index f6174c8..694fa38 100644 --- a/client/Android/Studio/build.gradle +++ b/client/Android/Studio/build.gradle @@ -6,7 +6,7 @@ if (file.canRead()) { } if (!hasProperty('RELEASE_STORE_FILE')) { - ext.RELEASE_STORE_FILE='' + ext.RELEASE_STORE_FILE='nokeyfile' } if (!hasProperty('RELEASE_KEY_ALIAS')) { ext.RELEASE_KEY_ALIAS='' @@ -43,7 +43,7 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:3.0.1' + classpath 'com.android.tools.build:gradle:3.2.1' } } diff --git a/client/Android/Studio/freeRDPCore/build.gradle b/client/Android/Studio/freeRDPCore/build.gradle index 28c2e6b..63da9f2 100644 --- a/client/Android/Studio/freeRDPCore/build.gradle +++ b/client/Android/Studio/freeRDPCore/build.gradle @@ -1,12 +1,12 @@ apply plugin: 'com.android.library' android { - compileSdkVersion = 27 - buildToolsVersion = "27.0.3" + compileSdkVersion = 28 + buildToolsVersion = "28.0.3" defaultConfig { minSdkVersion 14 - targetSdkVersion 27 + targetSdkVersion 28 vectorDrawables.useSupportLibrary = true versionCode = 14 versionName = rootProject.ext.versionName @@ -25,7 +25,7 @@ android { } dependencies { - compile 'com.android.support:appcompat-v7:27.0.2' - compile 'com.android.support:support-v4:27.0.2' - compile 'com.android.support:support-vector-drawable:27.0.2' + implementation 'com.android.support:appcompat-v7:28.0.0' + implementation 'com.android.support:support-v4:28.0.0' + implementation 'com.android.support:support-vector-drawable:28.0.0' } diff --git a/client/Android/Studio/gradle/wrapper/gradle-wrapper.properties b/client/Android/Studio/gradle/wrapper/gradle-wrapper.properties index af72c19..ecf74d7 100644 --- a/client/Android/Studio/gradle/wrapper/gradle-wrapper.properties +++ b/client/Android/Studio/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip diff --git a/cmake/AndroidToolchain.cmake b/cmake/AndroidToolchain.cmake index fcc4739..4cf601b 100644 --- a/cmake/AndroidToolchain.cmake +++ b/cmake/AndroidToolchain.cmake @@ -1133,9 +1133,6 @@ if( APPLE ) mark_as_advanced( CMAKE_INSTALL_NAME_TOOL ) endif() -# Force set compilers because standard identification works badly for us -include( CMakeForceCompiler ) -CMAKE_FORCE_C_COMPILER( "${CMAKE_C_COMPILER}" GNU ) if( ANDROID_COMPILER_IS_CLANG ) set( CMAKE_C_COMPILER_ID Clang ) endif() @@ -1147,7 +1144,6 @@ else() endif() set( CMAKE_C_HAS_ISYSROOT 1 ) set( CMAKE_C_COMPILER_ABI ELF ) -CMAKE_FORCE_CXX_COMPILER( "${CMAKE_CXX_COMPILER}" GNU ) if( ANDROID_COMPILER_IS_CLANG ) set( CMAKE_CXX_COMPILER_ID Clang) endif() diff --git a/scripts/android-build-32.conf b/scripts/android-build-32.conf index d6b1577..ea5a9de 100644 --- a/scripts/android-build-32.conf +++ b/scripts/android-build-32.conf @@ -26,4 +26,4 @@ BUILD_SRC=$SRC_DIR/build CMAKE_BUILD_TYPE=Release -BUILD_ARCH="armeabi armeabi-v7a x86 mips" +BUILD_ARCH="armeabi-v7a x86" diff --git a/scripts/android-build-64.conf b/scripts/android-build-64.conf index 507c4c5..afad485 100644 --- a/scripts/android-build-64.conf +++ b/scripts/android-build-64.conf @@ -26,4 +26,4 @@ BUILD_SRC=$SRC_DIR/build CMAKE_BUILD_TYPE=Release -BUILD_ARCH="arm64-v8a x86_64 mips64" +BUILD_ARCH="arm64-v8a x86_64" diff --git a/scripts/android-build-common.sh b/scripts/android-build-common.sh index b1f074e..9ca85a4 100644 --- a/scripts/android-build-common.sh +++ b/scripts/android-build-common.sh @@ -4,7 +4,7 @@ SCRIPT_PATH=$(dirname "${BASH_SOURCE[0]}") SCRIPT_PATH=$(realpath "$SCRIPT_PATH") if [ -z $BUILD_ARCH ]; then - BUILD_ARCH="armeabi armeabi-v7a mips mips64 x86 x86_64 arm64-v8a" + BUILD_ARCH="armeabi-v7a x86 x86_64 arm64-v8a" fi if [ -z $NDK_TARGET ]; then @@ -204,22 +204,31 @@ function common_update { echo "Invalid arguments to update function $@" exit 1 fi + SCM_URL=$1 + SCM_TAG=$2 + BUILD_SRC=$3 echo "Preparing checkout..." BASE=$(pwd) - if [[ ! -d $3 ]]; + CACHE=$SCRIPT_PATH/../cache + common_run mkdir -p $CACHE + TARFILE="$CACHE/$SCM_TAG.tar.gz" + + + if [[ ! -f "$TARFILE" ]]; then - common_run mkdir -p $3 - common_run cd $3 - common_run git clone $1 $3 + common_run wget -O "$TARFILE" "$SCM_URL/archive/$SCM_TAG.tar.gz" fi + if [[ -d $BUILD_SRC ]]; + then + common_run rm -rf $BUILD_SRC + fi + common_run mkdir -p $BUILD_SRC + common_run cd $BUILD_SRC + common_run tar zxf "$TARFILE" --strip 1 common_run cd $BASE - common_run cd $3 - common_run git fetch - common_run git reset --hard HEAD - common_run git checkout $2 - common_run cd $BASE + } function common_clean { diff --git a/scripts/android-build-freerdp.sh b/scripts/android-build-freerdp.sh index bf13a7c..c3ad1ca 100755 --- a/scripts/android-build-freerdp.sh +++ b/scripts/android-build-freerdp.sh @@ -83,7 +83,8 @@ CMAKE_CMD_ARGS="-DANDROID_NDK=$ANDROID_NDK \ -DANDROID_NATIVE_API_LEVEL=android-${NDK_TARGET} \ -DCMAKE_TOOLCHAIN_FILE=$SRC_DIR/cmake/AndroidToolchain.cmake \ -DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE \ - -DFREERDP_EXTERNAL_PATH=$BUILD_DST" + -DFREERDP_EXTERNAL_PATH=$BUILD_DST \ + -DCMAKE_MAKE_PROGRAM=make" BASE=$(pwd) for ARCH in $BUILD_ARCH @@ -97,7 +98,7 @@ do --src $BUILD_SRC/jpeg --dst $BUILD_DST \ --ndk $ANDROID_NDK \ --arch $ARCH \ - --target $NDK_TARGET \ + --target $NDK_TARGET \ --tag $JPEG_TAG fi CMAKE_CMD_ARGS="$CMAKE_CMD_ARGS -DWITH_JPEG=ON" @@ -112,7 +113,7 @@ do --src $BUILD_SRC/openh264 --dst $BUILD_DST \ --ndk $ANDROID_NDK \ --arch $ARCH \ - --target $NDK_TARGET \ + --target $NDK_TARGET \ --tag $OPENH264_TAG fi CMAKE_CMD_ARGS="$CMAKE_CMD_ARGS -DWITH_OPENH264=ON" diff --git a/scripts/android-build-jpeg.sh b/scripts/android-build-jpeg.sh index 7b06adf..dafcf89 100755 --- a/scripts/android-build-jpeg.sh +++ b/scripts/android-build-jpeg.sh @@ -1,5 +1,5 @@ #!/bin/bash -SCM_URL=https://github.com/akallabeth/jpeg8d.git +SCM_URL=https://github.com/akallabeth/jpeg8d SCM_TAG=master source $(dirname "${BASH_SOURCE[0]}")/android-build-common.sh @@ -25,8 +25,8 @@ function build { echo "Building architectures $BUILD_ARCH..." BASE=$(pwd) common_run cd $BUILD_SRC - common_run $NDK_BUILD V=1 APP_ABI="${BUILD_ARCH}" -j clean - common_run $NDK_BUILD V=1 APP_ABI="${BUILD_ARCH}" -j + common_run $NDK_BUILD V=1 APP_ABI="${BUILD_ARCH}" NDK_TOOLCHAIN_VERSION=4.9 -j clean + common_run $NDK_BUILD V=1 APP_ABI="${BUILD_ARCH}" NDK_TOOLCHAIN_VERSION=4.9 -j common_run cd $BASE } @@ -34,7 +34,6 @@ function build { common_parse_arguments $@ common_check_requirements common_update $SCM_URL $SCM_TAG $BUILD_SRC -common_clean $BUILD_DST build diff --git a/scripts/android-build-openh264.sh b/scripts/android-build-openh264.sh index f90d9e3..41b3e36 100755 --- a/scripts/android-build-openh264.sh +++ b/scripts/android-build-openh264.sh @@ -10,7 +10,7 @@ function build { common_run cd $BUILD_SRC PATH=$ANDROID_NDK:$PATH MAKE="make PATH=$PATH ENABLEPIC=Yes OS=android NDKROOT=$ANDROID_NDK TARGET=android-$2 NDKLEVEL=$2 ARCH=$1 -j libraries" - common_run git clean -xdf + common_run export QUIET_AR="$CCACHE " common_run export QUIET_ASM="$CCACHE " common_run export QUIET_CC="$CCACHE " @@ -27,7 +27,7 @@ function build { common_parse_arguments $@ common_check_requirements common_update $SCM_URL $SCM_TAG $BUILD_SRC -common_clean $BUILD_DST + for ARCH in $BUILD_ARCH do diff --git a/scripts/android-build-openssl.sh b/scripts/android-build-openssl.sh index cb9db8f..76068d9 100755 --- a/scripts/android-build-openssl.sh +++ b/scripts/android-build-openssl.sh @@ -45,10 +45,9 @@ function build { BASE=$(pwd) DST_DIR=$BUILD_DST/$DST_PREFIX common_run cd $BUILD_SRC - common_run git clean -xdf common_run ./Configure --config=$SCRIPT_PATH/openssl-mips64.conf --openssldir=$DST_DIR $CONFIG no-shared - common_run make CALC_VERSIONS="SHLIB_COMPAT=; SHLIB_SOVER=" depend - common_run make CALC_VERSIONS="SHLIB_COMPAT=; SHLIB_SOVER=" build_libs + common_run make CALC_VERSIONS="SHLIB_COMPAT=; SHLIB_SOVER=" -j depend + common_run make CALC_VERSIONS="SHLIB_COMPAT=; SHLIB_SOVER=" -j build_libs if [ ! -d $DST_DIR ]; then @@ -64,7 +63,6 @@ function build { common_parse_arguments $@ common_check_requirements common_update $SCM_URL $SCM_TAG $BUILD_SRC -common_clean $BUILD_DST ORG_PATH=$PATH for ARCH in $BUILD_ARCH diff --git a/scripts/android-build.conf b/scripts/android-build.conf index 288893f..8fc2fb9 100644 --- a/scripts/android-build.conf +++ b/scripts/android-build.conf @@ -14,7 +14,7 @@ WITH_OPENH264=0 WITH_OPENSSL=1 BUILD_DEPS=1 DEPS_ONLY=0 -NDK_TARGET=21 +NDK_TARGET=26 JPEG_TAG=master OPENH264_TAG=v1.7.0 @@ -26,4 +26,4 @@ BUILD_SRC=$SRC_DIR/build CMAKE_BUILD_TYPE=Debug -BUILD_ARCH="armeabi armeabi-v7a x86 mips arm64-v8a x86_64 mips64" +BUILD_ARCH="armeabi-v7a x86 arm64-v8a x86_64" -- 2.7.4