Skip to content
This repository has been archived by the owner on Jan 10, 2021. It is now read-only.

Commit

Permalink
Build OpenSSL, cross-compiled for android.
Browse files Browse the repository at this point in the history
  • Loading branch information
renpytom committed Jul 7, 2018
1 parent adfaed7 commit 0141351
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .pydevproject
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?eclipse-pydev version="1.0"?><pydev_project>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.7</pydev_property>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Ren'Py</pydev_property>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python interpreter</pydev_property>
<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">
<path>/${PROJECT_DIR_NAME}/buildlib</path>
</pydev_pathproperty>
Expand Down
15 changes: 11 additions & 4 deletions native/build.sh
Expand Up @@ -3,9 +3,8 @@
export NATIVE="$(dirname $(readlink -f $0))"
export ANDROID="$(dirname $NATIVE)"
export SOURCE="$NATIVE/source"
export NDK="$NATIVE/android-ndk"
export SDK="$NATIVE/../android-sdk"
export ANDROID_PLATFORM=android-9
export SDK="${ANDROID_HOME:-/home/tom/Android/Sdk}"
export NDK="${ANDROID_NDK:-$SDK/ndk-bundle}"

export PYGAME_SDL2_ROOT="${PYGAME_SDL2_ROOT:-/home/tom/ab/pygame_sdl2}"
export RENPY_ROOT="${RENPY_ROOT:-/home/tom/ab/renpy}"
Expand All @@ -20,6 +19,7 @@ build_host() {

# Build for host.
export PLATFORM=host

export CC="ccache gcc"
export LD="ccache gcc"

Expand All @@ -37,6 +37,8 @@ build_platform () {
run_once openssl unpack
run_once openssl build

exit

# Use the toolchain to build python.
run_once python unpack
run_once python apply_patches
Expand Down Expand Up @@ -66,21 +68,25 @@ build_platform () {

build_arm () {

export PLATFORM=armeabi
export ANDROID_PLATFORM=android-15
export PLATFORM=armeabi-v7a
export NDK_ARCH=arm
export FFMPEG_ARCH=arm
export GCC_ARCH=arm-linux-androideabi
export OPENSSL_ARCH="android -march=armv7-a"

build_platform
}


build_x86 () {

export ANDROID_PLATFORM=android-15
export PLATFORM=x86
export NDK_ARCH=x86
export FFMPEG_ARCH=x86
export GCC_ARCH=i686-linux-android
export OPENSSL_ARCH="android-x86"

build_platform
}
Expand All @@ -89,6 +95,7 @@ build_ () {
run finish clean

build_host

build_x86
build_arm

Expand Down
1 change: 1 addition & 0 deletions native/scripts/common.sh
Expand Up @@ -57,6 +57,7 @@ activate_toolchain () {
export CXX="ccache $GCC_ARCH-g++"
export LD="ccache $GCC_ARCH-gcc"
export LDXX="ccache $GCC_ARCH-g++"
export RANLIB="$GCC_ARCH-ranlib"

export CFLAGS="-DANDROID"
export LDFLAGS=""
Expand Down
9 changes: 7 additions & 2 deletions native/scripts/openssl.sh
Expand Up @@ -12,9 +12,14 @@ build () {

pushd "openssl-$version"

./Configure --prefix="$INSTALLDIR" -fPIC no-asm no-shared no-comp no-hw no-engine android
export CROSS_SYSROOT="$INSTALLDIR/toolchain/sysroot"

make depend
./Configure --prefix="$INSTALLDIR" \
no-asm no-shared no-comp no-hw no-engine \
$OPENSSL_ARCH -fPIC \
-D__ANDROID_API__=${ANDROID_PLATFORM#android-}

make depend CFLAGS="$CFLAGS"
make
make install

Expand Down

0 comments on commit 0141351

Please sign in to comment.