OpenSSL 移植Android 交叉编译说明
1、设置环境变量
export NDK=/home/jsa/share/android-ndk-r9
export SYSROOT=$NDK/platforms/android-14/arch-arm
export CC="$NDK/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc --sysroot=$SYSROOT"
export PATH=$NDK/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin:$PATH
2、配置工程
AR="arm-linux-androideabi-ar" RANLIB=arm-linux-androideabi-ranlib CC=arm-linux-androideabi-gcc ./config no-asm shared os/compiler:arm-linux-androideabi-gcc
3、编译测试代码Makefile文件
AEStest:
$(CC) -o $@ dec3test.c -I/home/jsa/share/OpenSSL/openssl/openssl-1.0.0 -I/home/jsa/share/OpenSSL/openssl/openssl-1.0.0/include -I/home/jsa/share/OpenSSL/openssl/openssl-1.0.0/include/openssl -I/home/jsa/share/android-ndk-r9/platforms/android-14/arch-arm/usr/include -L/home/jsa/share/android-ndk-r9/platforms/android-14/arch-arm/usr/lib -L/home/jsa/share/OpenSSL/openssl/openssl-1.0.0 -lcrypto -ldl
clean:
rm -rf AEStest *.c~ Makefile~
基于openssl的AES加解密 android
最新推荐文章于 2024-09-13 21:49:22 发布