Merge pull request #3705 from akallabeth/android_openssl_1_1

Android openssl 1 1
This commit is contained in:
Bernhard Miklautz 2017-01-19 12:05:26 +01:00 committed by GitHub
commit 14d076735e
14 changed files with 101 additions and 45 deletions

View File

@ -48,5 +48,7 @@ set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr freerdp freerdp-client)
set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} dl)
set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} jnigraphics)
set_target_properties(${MODULE_NAME} PROPERTIES OUTPUT_NAME ${MODULE_NAME}${FREERDP_API_VERSION})
target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})
install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries EXPORT AndroidTargets)

View File

@ -2,7 +2,7 @@ apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.1"
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.freerdp.afreerdp"

View File

@ -4,7 +4,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
classpath 'com.android.tools.build:gradle:2.2.3'
}
}

View File

@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
android {
compileSdkVersion 25
buildToolsVersion "25.0.1"
buildToolsVersion "25.0.2"
defaultConfig {
minSdkVersion 14
@ -22,5 +22,5 @@ android {
}
dependencies {
compile 'com.android.support:appcompat-v7:25.0.1'
compile 'com.android.support:appcompat-v7:25.1.0'
}

View File

@ -28,8 +28,8 @@ public class LibFreeRDP {
static {
final String[] libraries = {
"openh264", "crypto", "ssl", "jpeg", "winpr",
"freerdp", "freerdp-client", "freerdp-android"};
"openh264", "freerdp-openssl", "jpeg", "winpr2",
"freerdp2", "freerdp-client2", "freerdp-android2"};
final String LD_PATH = System.getProperty("java.library.path");
for (String lib : libraries) {

View File

@ -24,10 +24,10 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
if (UNIX)
if (UNIX AND NOT ANDROID)
find_package(PkgConfig QUIET)
pkg_check_modules(_OPENSSL QUIET openssl)
endif (UNIX)
endif (UNIX AND NOT ANDROID)
# http://www.slproweb.com/products/Win32OpenSSL.html
SET(_OPENSSL_ROOT_HINTS
@ -71,7 +71,15 @@ IF(WIN32)
endif()
ENDIF(WIN32)
IF(WIN32 AND NOT CYGWIN)
IF(ANDROID)
FIND_LIBRARY(OPENSSL_LIBRARIES
NAMES
"freerdp-openssl"
${_OPENSSL_ROOT_HINTS_AND_PATHS}
PATH_SUFFIXES
"lib"
)
ELSEIF(WIN32 AND NOT CYGWIN)
# MINGW should go here too
IF(MSVC)
# /MD and /MDd are the standard values - if someone wants to use
@ -230,7 +238,7 @@ ELSE(WIN32 AND NOT CYGWIN)
SET(OPENSSL_LIBRARIES ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY})
ENDIF(WIN32 AND NOT CYGWIN)
ENDIF(ANDROID)
function(from_hex HEX DEC)
string(TOUPPER "${HEX}" HEX)

View File

@ -45,6 +45,15 @@ Currently the default script builds for:
When the script is finished the libraries are ready for android studio to
be picked up in client/Android/Studio/freeRDPCore/src/main/jniLibs
The default configuration build configuration can be found in
./scripts/android-build.conf and is configured to provide debug builds.
They are limited to API level 21 and above.
If release binaries (and old android API support) are required, build 32 bit architectures with
./scripts/android-build-freerdp.sh --ndk <ANDROID_NDK> --sdk <ANDROID_SDK> --conf ./scripts/android-build-32.conf
and 64 bit architectures with
./scripts/android-build-freerdp.sh --ndk <ANDROID_NDK> --sdk <ANDROID_SDK> --conf ./scripts/android-build-32.conf
Building the APK (Android Studio)
================

View File

@ -1,26 +0,0 @@
From 6e9a00d9ac02c3b3adc0613798678eadb0c4dae5 Mon Sep 17 00:00:00 2001
From: Armin Novak <armin.novak@thincast.com>
Date: Thu, 2 Jun 2016 13:55:27 +0200
Subject: [PATCH] 64bit architecture support.
---
Configure | 3 +++
1 file changed, 3 insertions(+)
diff --git a/Configure b/Configure
index c98107a..fa20eca 100755
--- a/Configure
+++ b/Configure
@@ -473,6 +473,9 @@ my %table=(
"android-x86","gcc:-mandroid -I\$(ANDROID_DEV)/include -B\$(ANDROID_DEV)/lib -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:".eval{my $asm=${x86_elf_asm};$asm=~s/:elf/:android/;$asm}.":dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"android-armv7","gcc:-march=armv7-a -mandroid -I\$(ANDROID_DEV)/include -B\$(ANDROID_DEV)/lib -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${armv4_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"android-mips","gcc:-mandroid -I\$(ANDROID_DEV)/include -B\$(ANDROID_DEV)/lib -O3 -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${mips32_asm}:o32:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"android64", "gcc:-mandroid -I\$(ANDROID_DEV)/include -B\$(ANDROID_DEV)/lib64 -m64 -DL_ENDIAN -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:android:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
+"android64-aarch64","gcc:-march=armv8-a -mandroid -I\$(ANDROID_DEV)/include -B\$(ANDROID_DEV)/lib -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${aarch64_asm}:linux64:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"android64-mips64","gcc:-mandroid -I\$(ANDROID_DEV)/include -B\$(ANDROID_DEV)/lib64 -mabi=64 -O3 -Wall -DBN_DIV3W::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC:-mabi=64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
#### *BSD [do see comment about ${BSDthreads} above!]
"BSD-generic32","gcc:-O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
--
2.1.4

View File

@ -0,0 +1,29 @@
#!/bin/bash
#
# Android build confguration
#
# Note: This is a simple configuration to build all
# architectures in one rush.
# Since android 64 bit support was introduced with NDK API 21
# this is the minimal common denominator.
# If you require support for older NDK API levels,
# create seperate configurations for each NDK API level
# and architecture you want to support.
WITH_JPEG=0
WITH_OPENH264=0
WITH_OPENSSL=1
BUILD_DEPS=1
DEPS_ONLY=0
NDK_TARGET=14
JPEG_TAG=master
OPENH264_TAG=v1.6.0
OPENSSL_TAG=OpenSSL_1_1_0c
SRC_DIR=$SCRIPT_PATH/..
BUILD_DST=$SCRIPT_PATH/../client/Android/Studio/freeRDPCore/src/main/jniLibs
BUILD_SRC=$SRC_DIR/build
CMAKE_BUILD_TYPE=Release
BUILD_ARCH="armeabi armeabi-v7a x86 mips"

View File

@ -0,0 +1,29 @@
#!/bin/bash
#
# Android build confguration
#
# Note: This is a simple configuration to build all
# architectures in one rush.
# Since android 64 bit support was introduced with NDK API 21
# this is the minimal common denominator.
# If you require support for older NDK API levels,
# create seperate configurations for each NDK API level
# and architecture you want to support.
WITH_JPEG=0
WITH_OPENH264=0
WITH_OPENSSL=1
BUILD_DEPS=1
DEPS_ONLY=0
NDK_TARGET=21
JPEG_TAG=master
OPENH264_TAG=v1.6.0
OPENSSL_TAG=OpenSSL_1_1_0c
SRC_DIR=$SCRIPT_PATH/..
BUILD_DST=$SCRIPT_PATH/../client/Android/Studio/freeRDPCore/src/main/jniLibs
BUILD_SRC=$SRC_DIR/build
CMAKE_BUILD_TYPE=Release
BUILD_ARCH="arm64-v8a x86_64 mips64"

View File

@ -1,5 +1,8 @@
#!/bin/bash
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"
fi

View File

@ -45,9 +45,8 @@ function build {
BASE=$(pwd)
DST_DIR=$BUILD_DST/$DST_PREFIX
common_run cd $BUILD_SRC
common_run git am $(dirname "${BASH_SOURCE[0]}")/0001-64bit-architecture-support.patch
common_run git clean -xdf
common_run ./Configure --openssldir=$DST_DIR $CONFIG shared
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
@ -56,8 +55,8 @@ function build {
common_run mkdir -p $DST_DIR
fi
common_run cp -L libssl.so $DST_DIR
common_run cp -L libcrypto.so $DST_DIR
SONAME=libfreerdp-openssl.so
common_run ${CROSS_COMPILE}gcc --sysroot=${CROSS_SYSROOT} -shared -fPIC -Wl,-soname,$SONAME -o $DST_DIR/$SONAME -Wl,-whole-archive libcrypto.a libssl.a -Wl,-no-whole-archive
common_run cd $BASE
}
@ -77,7 +76,7 @@ do
$ARCH "arm-linux-androideabi-" "arch-arm"
;;
"armeabi-v7a")
build "android-armv7" "arm-linux-androideabi-" \
build "android-armeabi" "arm-linux-androideabi-" \
$ARCH "arm-linux-androideabi-" "arch-arm"
;;
"mips")

View File

@ -9,9 +9,6 @@
# If you require support for older NDK API levels,
# create seperate configurations for each NDK API level
# and architecture you want to support.
SCRIPT_PATH=$(dirname "${BASH_SOURCE[0]}")
SCRIPT_PATH=$(realpath "$SCRIPT_PATH")
WITH_JPEG=0
WITH_OPENH264=0
WITH_OPENSSL=1
@ -21,7 +18,7 @@ NDK_TARGET=21
JPEG_TAG=master
OPENH264_TAG=v1.6.0
OPENSSL_TAG=OpenSSL_1_0_2h
OPENSSL_TAG=OpenSSL_1_1_0c
SRC_DIR=$SCRIPT_PATH/..
BUILD_DST=$SCRIPT_PATH/../client/Android/Studio/freeRDPCore/src/main/jniLibs

View File

@ -0,0 +1,6 @@
%targets = (
"android64-mips64" => {
inherit_from => [ "android64" ],
},
);