Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
mobile Datovka
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
12
Issues
12
List
Boards
Labels
Service Desk
Milestones
Merge Requests
3
Merge Requests
3
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Datovka projects
mobile Datovka
Commits
c24cb8eb
Commit
c24cb8eb
authored
Sep 11, 2017
by
Martin Straka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated Android openssl build
parent
5a1d4252
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
387 additions
and
39 deletions
+387
-39
android/android.pri
android/android.pri
+39
-39
android/openssl/build-all-arch-linux.sh
android/openssl/build-all-arch-linux.sh
+92
-0
android/openssl/build-windows.bat
android/openssl/build-windows.bat
+0
-0
android/openssl/readme-build-linux.txt
android/openssl/readme-build-linux.txt
+15
-0
android/openssl/setenv-android-mod.sh
android/openssl/setenv-android-mod.sh
+241
-0
No files found.
android/android.pri
View file @
c24cb8eb
INCLUDEPATH += \
$$PWD \
src \
android/openssl/
include/
equals(ANDROID_TARGET_ARCH, armeabi-v7a) {
LIBS = \
$${_PRO_FILE_PWD_}/android/openssl/
armv7a/lib/libcrypto.a \
$${_PRO_FILE_PWD_}/android/openssl/
armv7a/lib/libssl.a
}
equals(ANDROID_TARGET_ARCH, armeabi) {
LIBS = \
$${_PRO_FILE_PWD_}/android/openssl/
arm/lib/libcrypto.a \
$${_PRO_FILE_PWD_}/android/openssl/
arm/lib/libssl.a
}
equals(ANDROID_TARGET_ARCH, x86) {
LIBS = \
$${_PRO_FILE_PWD_}/android/openssl/
x86/lib/libcrypto.a \
$${_PRO_FILE_PWD_}/android/openssl/
x86/lib/libssl.a
}
DISTFILES += \
$${_PRO_FILE_PWD_}/android/AndroidManifest.xml
contains(ANDROID_TARGET_ARCH,armeabi-v7a) {
ANDROID_EXTRA_LIBS = \
$${_PRO_FILE_PWD_}/android/openssl/
armv7a/lib/libcrypto.so \
$${_PRO_FILE_PWD_}/android/openssl/
armv7a/lib/libssl.so
}
contains(ANDROID_TARGET_ARCH,armeabi) {
ANDROID_EXTRA_LIBS = \
$${_PRO_FILE_PWD_}/android/openssl/
arm/lib/libcrypto.so \
$${_PRO_FILE_PWD_}/android/openssl/
arm/lib/libssl.so
}
contains(ANDROID_TARGET_ARCH,x86) {
ANDROID_EXTRA_LIBS = \
$${_PRO_FILE_PWD_}/android/openssl/
x86/lib/libcrypto.so \
$${_PRO_FILE_PWD_}/android/openssl/
x86/lib/libssl.so
}
INCLUDEPATH += \
$$PWD \
src \
android/openssl/
libs/include/
equals(ANDROID_TARGET_ARCH, armeabi-v7a) {
LIBS = \
$${_PRO_FILE_PWD_}/android/openssl/
libs/armeabi-v7a/libcrypto.so \
$${_PRO_FILE_PWD_}/android/openssl/
libs/armeabi-v7a/libssl.so
}
equals(ANDROID_TARGET_ARCH, armeabi) {
LIBS = \
$${_PRO_FILE_PWD_}/android/openssl/
libs/armeabi/libcrypto.so \
$${_PRO_FILE_PWD_}/android/openssl/
libs/armeabi/libssl.so
}
equals(ANDROID_TARGET_ARCH, x86) {
LIBS = \
$${_PRO_FILE_PWD_}/android/openssl/
libs/x86/libcrypto.so \
$${_PRO_FILE_PWD_}/android/openssl/
libs/x86/libssl.so
}
DISTFILES += \
$${_PRO_FILE_PWD_}/android/AndroidManifest.xml
contains(ANDROID_TARGET_ARCH,armeabi-v7a) {
ANDROID_EXTRA_LIBS = \
$${_PRO_FILE_PWD_}/android/openssl/
libs/armeabi-v7a/libcrypto.so \
$${_PRO_FILE_PWD_}/android/openssl/
libs/armeabi-v7a/libssl.so
}
contains(ANDROID_TARGET_ARCH,armeabi) {
ANDROID_EXTRA_LIBS = \
$${_PRO_FILE_PWD_}/android/openssl/
libs/armeabi/libcrypto.so \
$${_PRO_FILE_PWD_}/android/openssl/
libs/armeabi/libssl.so
}
contains(ANDROID_TARGET_ARCH,x86) {
ANDROID_EXTRA_LIBS = \
$${_PRO_FILE_PWD_}/android/openssl/
libs/x86/libcrypto.so \
$${_PRO_FILE_PWD_}/android/openssl/
libs/x86/libssl.so
}
android/openssl/build-all-arch-linux.sh
0 → 100755
View file @
c24cb8eb
#!/bin/bash
#
# http://wiki.openssl.org/index.php/Android
#
set
-e
rm
-rf
libs
mkdir
libs
# OPENSSL_VERSION="openssl-1.0.2j"
curl
-O
"https://www.openssl.org/source/
${
OPENSSL_VERSION
}
.tar.gz"
tar
xfz
"
${
OPENSSL_VERSION
}
.tar.gz"
archs
=(
armeabi-v7a x86
)
for
arch
in
${
archs
[@]
}
;
do
xLIB
=
"/lib"
case
${
arch
}
in
"armeabi-v7a"
)
_ANDROID_TARGET_SELECT
=
arch-arm
_ANDROID_ARCH
=
arch-arm
_ANDROID_EABI
=
arm-linux-androideabi-4.9
configure_platform
=
"android-armv7"
;;
"arm64-v8a"
)
_ANDROID_TARGET_SELECT
=
arch-arm64-v8a
_ANDROID_ARCH
=
arch-arm64
_ANDROID_EABI
=
aarch64-linux-android-4.9
#no xLIB="/lib64"
configure_platform
=
"linux-generic64 -DB_ENDIAN"
;;
"mips"
)
_ANDROID_TARGET_SELECT
=
arch-mips
_ANDROID_ARCH
=
arch-mips
_ANDROID_EABI
=
mipsel-linux-android-4.9
configure_platform
=
"android -DB_ENDIAN"
;;
"mips64"
)
_ANDROID_TARGET_SELECT
=
arch-mips64
_ANDROID_ARCH
=
arch-mips64
_ANDROID_EABI
=
mips64el-linux-android-4.9
xLIB
=
"/lib64"
configure_platform
=
"linux-generic64 -DB_ENDIAN"
;;
"x86"
)
_ANDROID_TARGET_SELECT
=
arch-x86
_ANDROID_ARCH
=
arch-x86
_ANDROID_EABI
=
x86-4.9
configure_platform
=
"android-x86"
;;
"x86_64"
)
_ANDROID_TARGET_SELECT
=
arch-x86_64
_ANDROID_ARCH
=
arch-x86_64
_ANDROID_EABI
=
x86_64-4.9
xLIB
=
"/lib64"
configure_platform
=
"linux-generic64"
;;
*
)
configure_platform
=
"linux-elf"
;;
esac
mkdir
libs/
${
arch
}
.
./setenv-android-mod.sh
echo
"CROSS COMPILE ENV :
$CROSS_COMPILE
"
cd
"
${
OPENSSL_VERSION
}
"
xCFLAGS
=
"-DSHARED_EXTENSION=.so -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -DDSO_DLFCN -DHAVE_DLFCN_H -mandroid -I
$ANDROID_DEV
/include -B
$ANDROID_DEV
/
$xLIB
-O3 -fomit-frame-pointer -Wall"
perl
-pi
-e
's/install: all install_docs install_sw/install: install_docs install_sw/g'
Makefile.org
./Configure shared threads no-asm no-zlib no-ssl2 no-ssl3 no-comp no-hw no-engine
--openssldir
=
/usr/local/ssl/android-21/
$configure_platform
$xCFLAGS
# patch SONAME
perl
-pi
-e
's/SHLIB_EXT=\.so\.\$\(SHLIB_MAJOR\)\.\$\(SHLIB_MINOR\)/SHLIB_EXT=\.so/g'
Makefile
perl
-pi
-e
's/SHARED_LIBS_LINK_EXTS=\.so\.\$\(SHLIB_MAJOR\) \.so//g'
Makefile
# quote injection for proper SONAME, fuck...
perl
-pi
-e
's/SHLIB_MAJOR=1/SHLIB_MAJOR=`/g'
Makefile
perl
-pi
-e
's/SHLIB_MINOR=0.0/SHLIB_MINOR=`/g'
Makefile
make clean
make depend
-j4
make build_libs
-j4
file libcrypto.so
file libssl.so
cp
libcrypto.so ../libs/
${
arch
}
/libcrypto.so
cp
libssl.so ../libs/
${
arch
}
/libssl.so
cd
..
done
cp
-r
-L
${
OPENSSL_VERSION
}
/include/ libs/include
rm
-rf
"
${
OPENSSL_VERSION
}
"
rm
"
${
OPENSSL_VERSION
}
.tar.gz"
exit
0
android/openssl/
android-build-libssl
.bat
→
android/openssl/
build-windows
.bat
View file @
c24cb8eb
File moved
android/openssl/readme-build-linux.txt
0 → 100644
View file @
c24cb8eb
# Android openssl build script for Linux - all android architectures
# ----------------------------------------------------------------------------
# 1. Download Android NDK r15c for Linux from website
# https://developer.android.com/ndk/downloads/index.html
# 2. Install NDK to /home/{User}/{Repository}/mobile-datovka/android/openssl/android-ndk-r15c
# 3. Set build variables below, privilegies for scripts and run build script.
# Do next commands:
# ----------------------------------------------------------------------------
cd /home/{User}/{Repository}/mobile-datovka/android/openssl
chmod 755 ./build-all-arch.sh
chmod 755 ./setenv-android-mod.sh
export ANDROID_NDK_ROOT=/home/{User}/{Repository}/mobile-datovka/android/openssl/android-ndk-r15c
# Example: export ANDROID_NDK_ROOT=/home/martin/Git/mobile-datovka/android/openssl/android-ndk-r15c
export OPENSSL_VERSION="openssl-1.0.2l"
./build-all-arch-linux.sh
android/openssl/setenv-android-mod.sh
0 → 100755
View file @
c24cb8eb
#!/bin/bash
# Cross-compile environment for Android on ARMv7 and x86
#
# Contents licensed under the terms of the OpenSSL license
# http://www.openssl.org/source/license.html
#
# See http://wiki.openssl.org/index.php/FIPS_Library_and_Android
# and http://wiki.openssl.org/index.php/Android
#####################################################################
# Set ANDROID_NDK_ROOT to you NDK location. For example,
# /opt/android-ndk-r8e or /opt/android-ndk-r9. This can be done in a
# login script. If ANDROID_NDK_ROOT is not specified, the script will
# try to pick it up with the value of _ANDROID_NDK_ROOT below. If
# ANDROID_NDK_ROOT is set, then the value is ignored.
# _ANDROID_NDK="android-ndk-r8e"
_ANDROID_NDK
=
"android-ndk-r13"
# _ANDROID_NDK="android-ndk-r10"
# Set _ANDROID_EABI to the EABI you want to use. You can find the
# list in $ANDROID_NDK_ROOT/toolchains. This value is always used.
# _ANDROID_EABI="x86-4.6"
# _ANDROID_EABI="arm-linux-androideabi-4.6"
#_ANDROID_EABI="arm-linux-androideabi-4.9"
# Set _ANDROID_ARCH to the architecture you are building for.
# This value is always used.
# _ANDROID_ARCH=arch-x86
#_ANDROID_ARCH=arch-arm
# Set _ANDROID_API to the API you want to use. You should set it
# to one of: android-14, android-9, android-8, android-14, android-5
# android-4, or android-3. You can't set it to the latest (for
# example, API-17) because the NDK does not supply the platform. At
# Android 5.0, there will likely be another platform added (android-22?).
# This value is always used.
# _ANDROID_API="android-14"
# _ANDROID_API="android-18"
_ANDROID_API
=
"android-21"
#####################################################################
# Error checking
# ANDROID_NDK_ROOT should always be set by the user (even when not running this script)
# http://groups.google.com/group/android-ndk/browse_thread/thread/a998e139aca71d77
if
[
-z
"
$ANDROID_NDK_ROOT
"
]
||
[
!
-d
"
$ANDROID_NDK_ROOT
"
]
;
then
echo
"Error: ANDROID_NDK_ROOT is not a valid path. Please edit this script."
echo
"
$ANDROID_NDK_ROOT
"
exit
1
fi
# Error checking
if
[
!
-d
"
$ANDROID_NDK_ROOT
/toolchains"
]
;
then
echo
"Error: ANDROID_NDK_ROOT/toolchains is not a valid path. Please edit this script."
echo
"
$ANDROID_NDK_ROOT
/toolchains"
exit
1
fi
# Error checking
if
[
!
-d
"
$ANDROID_NDK_ROOT
/toolchains/
$_ANDROID_EABI
"
]
;
then
echo
"Error: ANDROID_EABI is not a valid path. Please edit this script."
echo
"
$ANDROID_NDK_ROOT
/toolchains/
$_ANDROID_EABI
"
exit
1
fi
#####################################################################
# Based on ANDROID_NDK_ROOT, try and pick up the required toolchain. We expect something like:
# /opt/android-ndk-r83/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86_64/bin
# Once we locate the toolchain, we add it to the PATH. Note: this is the 'hard way' of
# doing things according to the NDK documentation for Ice Cream Sandwich.
# https://android.googlesource.com/platform/ndk/+/ics-mr0/docs/STANDALONE-TOOLCHAIN.html
ANDROID_TOOLCHAIN
=
""
for
host
in
"linux-x86_64"
"linux-x86"
"darwin-x86_64"
"darwin-x86"
do
if
[
-d
"
$ANDROID_NDK_ROOT
/toolchains/
$_ANDROID_EABI
/prebuilt/
$host
/bin"
]
;
then
ANDROID_TOOLCHAIN
=
"
$ANDROID_NDK_ROOT
/toolchains/
$_ANDROID_EABI
/prebuilt/
$host
/bin"
break
fi
done
# Error checking
if
[
-z
"
$ANDROID_TOOLCHAIN
"
]
||
[
!
-d
"
$ANDROID_TOOLCHAIN
"
]
;
then
echo
"Error: ANDROID_TOOLCHAIN is not valid. Please edit this script."
echo
"
$ANDROID_TOOLCHAIN
"
exit
1
fi
case
$_ANDROID_TARGET_SELECT
in
arch-arm
)
ANDROID_TOOLS
=
"arm-linux-androideabi-gcc arm-linux-androideabi-ranlib arm-linux-androideabi-ld"
;;
arch-arm64-v8a
)
ANDROID_TOOLS
=
"aarch64-linux-android-gcc aarch64-linux-android-randlib aarch64-linux-android-ld"
;;
arch-x86
)
ANDROID_TOOLS
=
"i686-linux-android-gcc i686-linux-android-ranlib i686-linux-android-ld"
;;
arch-x86_64
)
ANDROID_TOOLS
=
"x86_64-linux-android-gcc x86_64-linux-android-ranlib x86_64-linux-android-ld"
;;
arch-mips
)
ANDROID_TOOLS
=
"mipsel-linux-android-gcc mipsel-linux-android-ranlib mipsel-linux-android-ld"
;;
arch-mips64
)
ANDROID_TOOLS
=
"mips64el-linux-android-gcc mips64el-linux-android-ranlib mips64el-linux-android-ld"
;;
*
)
echo
"ERROR ERROR ERROR"
exit
1
;;
esac
for
tool
in
$ANDROID_TOOLS
do
# Error checking
if
[
!
-e
"
$ANDROID_TOOLCHAIN
/
$tool
"
]
;
then
echo
"Error: Failed to find
$tool
. Please edit this script."
echo
"
$ANDROID_TOOLCHAIN
/
$tool
"
exit
1
fi
done
# Only modify/export PATH if ANDROID_TOOLCHAIN good
if
[
!
-z
"
$ANDROID_TOOLCHAIN
"
]
;
then
export
ANDROID_TOOLCHAIN
=
"
$ANDROID_TOOLCHAIN
"
export
PATH
=
"
$ANDROID_TOOLCHAIN
"
:
"
$PATH
"
fi
#####################################################################
# For the Android SYSROOT. Can be used on the command line with --sysroot
# https://android.googlesource.com/platform/ndk/+/ics-mr0/docs/STANDALONE-TOOLCHAIN.html
export
ANDROID_SYSROOT
=
"
$ANDROID_NDK_ROOT
/platforms/
$_ANDROID_API
/
$_ANDROID_ARCH
"
export
SYSROOT
=
"
$ANDROID_SYSROOT
"
export
NDK_SYSROOT
=
"
$ANDROID_SYSROOT
"
# Error checking
if
[
-z
"
$ANDROID_SYSROOT
"
]
||
[
!
-d
"
$ANDROID_SYSROOT
"
]
;
then
echo
"Error: ANDROID_SYSROOT is not valid. Please edit this script."
echo
"
$ANDROID_SYSROOT
"
exit
1
fi
#####################################################################
# If the user did not specify the FIPS_SIG location, try and pick it up
# If the user specified a bad location, then try and pick it up too.
if
[
-z
"
$FIPS_SIG
"
]
||
[
!
-e
"
$FIPS_SIG
"
]
;
then
# Try and locate it
_FIPS_SIG
=
""
if
[
-d
"/usr/local/ssl/
$_ANDROID_API
"
]
;
then
_FIPS_SIG
=
`
find
"/usr/local/ssl/
$_ANDROID_API
"
-name
incore
`
fi
if
[
!
-e
"
$_FIPS_SIG
"
]
;
then
_FIPS_SIG
=
`
find
$PWD
-name
incore
`
fi
# If a path was set, then export it
if
[
!
-z
"
$_FIPS_SIG
"
]
&&
[
-e
"
$_FIPS_SIG
"
]
;
then
export
FIPS_SIG
=
"
$_FIPS_SIG
"
fi
fi
# Error checking. Its OK to ignore this if you are *not* building for FIPS
if
[
-z
"
$FIPS_SIG
"
]
||
[
!
-e
"
$FIPS_SIG
"
]
;
then
echo
"Error: FIPS_SIG does not specify incore module. Please edit this script."
# echo "$FIPS_SIG"
# exit 1
fi
#####################################################################
# Most of these should be OK (MACHINE, SYSTEM, ARCH). RELEASE is ignored.
export
MACHINE
=
armv7
export
RELEASE
=
2.6.37
export
SYSTEM
=
android
export
ARCH
=
arm
export
CROSS_COMPILE
=
"arm-linux-androideabi-"
if
[
"
$_ANDROID_TARGET_SELECT
"
==
"arch-arm64-v8a"
]
;
then
export
MACHINE
=
armv7
export
ARCH
=
arm64
export
CROSS_COMPILE
=
"aarch64-linux-android-"
fi
if
[
"
$_ANDROID_TARGET_SELECT
"
==
"arch-x86"
]
;
then
export
MACHINE
=
i686
export
ARCH
=
x86
export
CROSS_COMPILE
=
"i686-linux-android-"
fi
if
[
"
$_ANDROID_TARGET_SELECT
"
==
"arch-x86_64"
]
;
then
export
MACHINE
=
i686
export
ARCH
=
x86_64
export
CROSS_COMPILE
=
"x86_64-linux-android-"
fi
if
[
"
$_ANDROID_TARGET_SELECT
"
==
"arch-mips"
]
;
then
export
MACHINE
=
i686
export
ARCH
=
mips
export
CROSS_COMPILE
=
"mipsel-linux-android-"
fi
if
[
"
$_ANDROID_TARGET_SELECT
"
==
"arch-mips64"
]
;
then
export
MACHINE
=
i686
export
ARCH
=
mips64
export
CROSS_COMPILE
=
"mips64el-linux-android-"
fi
echo
"CHECK_CROSS_COMPILER =
$CROSS_COMPILE
"
# For the Android toolchain
# https://android.googlesource.com/platform/ndk/+/ics-mr0/docs/STANDALONE-TOOLCHAIN.html
export
ANDROID_SYSROOT
=
"
$ANDROID_NDK_ROOT
/platforms/
$_ANDROID_API
/
$_ANDROID_ARCH
"
export
SYSROOT
=
"
$ANDROID_SYSROOT
"
export
NDK_SYSROOT
=
"
$ANDROID_SYSROOT
"
export
ANDROID_NDK_SYSROOT
=
"
$ANDROID_SYSROOT
"
export
ANDROID_API
=
"
$_ANDROID_API
"
# CROSS_COMPILE and ANDROID_DEV are DFW (Don't Fiddle With). Its used by OpenSSL build system.
# export CROSS_COMPILE="arm-linux-androideabi-"
export
ANDROID_DEV
=
"
$ANDROID_NDK_ROOT
/platforms/
$_ANDROID_API
/
$_ANDROID_ARCH
/usr"
export
HOSTCC
=
gcc
VERBOSE
=
1
if
[
!
-z
"
$VERBOSE
"
]
&&
[
"
$VERBOSE
"
!=
"0"
]
;
then
echo
"ANDROID_NDK_ROOT:
$ANDROID_NDK_ROOT
"
echo
"ANDROID_ARCH:
$_ANDROID_ARCH
"
echo
"ANDROID_EABI:
$_ANDROID_EABI
"
echo
"ANDROID_API:
$ANDROID_API
"
echo
"ANDROID_SYSROOT:
$ANDROID_SYSROOT
"
echo
"ANDROID_TOOLCHAIN:
$ANDROID_TOOLCHAIN
"
echo
"FIPS_SIG:
$FIPS_SIG
"
echo
"CROSS_COMPILE:
$CROSS_COMPILE
"
echo
"ANDROID_DEV:
$ANDROID_DEV
"
fi
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment