Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add android build script #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lo1ol
Copy link

@lo1ol lo1ol commented Jun 22, 2021

Hi!

I noticed some problems of using my pkcs11 engine with stunnel on android. I'm sure that problem is in -D__ANDROID_API__=14 flag, which you pass to build openssl.

You can't pass ANDROID_API flag lower then ndk least support. New version of SDK uses ANDROID_API=16

I think you should add a public script, which you use to build your android version of openssl and stunnel.

@mtrojnar
Copy link
Owner

mtrojnar commented Feb 5, 2024

I currently (as of stunnel 5.72) use NDK r24c and:

    API=16
    test -d "$ANDROID_NDK_ROOT" || ANDROID_NDK_ROOT=/usr/lib/android-ndk
    export ANDROID_NDK_ROOT
    TOOLCHAIN=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64
    export TARGET=armv7a-linux-androideabi
    export AR=$TOOLCHAIN/bin/llvm-ar
    export CC=$TOOLCHAIN/bin/$TARGET$API-clang
    export AS=$CC
    export CXX=$TOOLCHAIN/bin/$TARGET$API-clang++
    export LD=$TOOLCHAIN/bin/ld
    export RANLIB=$TOOLCHAIN/bin/llvm-ranlib
    export STRIP=$TOOLCHAIN/bin/llvm-strip
    test -f Makefile && make distclean
    mkdir -p bin/android
    cd bin/android
    ../../configure \
        --with-ssl=$DST \
        --prefix=/data/local/tmp \
        --host=armv7a-linux-androideabi
    make

According to my investigation, NDK r23c is the last version to support API 16.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants