android openssl 编译环境,android-openssl-build

Android build environment for OpenSSL

Supports build for multiple architectures - ARM, ARMv7, X86

Uses OpenSSL source codes

Integrated with Android.mk build

Output directories for libcrypto and libssl are set in Android.mk

arch-armeabi/lib/

arch-armeabi-v7a/lib/

arch-x86/lib/

Advice: Do NOT use OpenSSL binaries you find laying about the Internet.

How to compile

cdjni/openssl

./build.sh

Optionally, set variables on the beginning of the build.sh according to your Android NDK.

In the global JNI Android.mk you can then simply include Android.mk from openssl directory so the

static or dynamic libraries are linked to the rest of your project.

include jni/openssl/Android.mk

Include paths for header files are not set, headers will be after compilation present at

jni/openssl/sources/include

Notes

Advice: Do not use pre-built OpenSSL libs you find laying around the Internet

macOS Using Android NDK r10e

On macOS, building OpenSSL fails when using NDK 11 or greater.

Work-around is to download and use Android NDK r10e to build OpenSSL.

Please download Android NDK r10e and update ANDROID_NDK

Copy the extracted downloaded ndk folder to your $ANDROID_HOME SDK folder and rename to ndk-r10e

Set ANDROID_HOME and ANDROID_NDK environment variable in $HOME/.profile:

export ANDROID_HOME=$HOME/Library/Android/sdk

export ANDROID_NDK=$ANDROID_HOME/ndk-r10e

Ubuntu 18.04

I could never get OpenSSL to build with this script even after reverting to NDK r10e?

Ubuntu build error "i686-linux-android-gcc: Command not found"

i686-linux-android-gcc -I. -I.. -I../include -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -mandroid -I/home/edward3/Android/Sdk/ndk-r10e/platforms/android-14/arch-x86/usr/include -B/home/edward3/Android/Sdk/ndk-r10e/platforms/android-14/arch-x86/usr/lib -O3 -fomit-frame-pointer -Wall -DOPENSSL_BN_ASM_PART_WORDS -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DRC4_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DRMD160_ASM -DAES_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -c -o cryptlib.o cryptlib.c

make[1]: i686-linux-android-gcc: Command not found

: recipe for target 'cryptlib.o' failed

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值