I'm trying to compile openssl-1.1.0 on Android by cygwin follow by this guidance:
Compiling the latest OpenSSL for Android
But it's failed, this is the error :
crypto/aes/aes_ecb.c:10:20: fatal error: assert.h: No such file or directory
#include <assert.h>
I'm using Android-ndk-r12b, Win10, cygwin 64 bit.
This is my pre-config before compiling:
export NDK=~/android-ndk-r12b
$NDK/build/tools/make-standalone-toolchain.sh --platform=android-21 --toolchain=arm-linux-androideabi-4.9 --install-dir=`pwd`/android-toolchain-arm
export TOOLCHAIN_PATH=`pwd`/android-toolchain-arm/bin
export TOOL=arm-linux-androideabi
export NDK_TOOLCHAIN_BASENAME=${TOOLCHAIN_PATH}/${TOOL}
export CC=$NDK_TOOLCHAIN_BASENAME-gcc
export CXX=$NDK_TOOLCHAIN_BASENAME-g++
export LINK=${CXX}
export LD=$NDK_TOOLCHAIN_BASENAME-ld
export AR=$NDK_TOOLCHAIN_BASENAME-ar
export RANLIB=$NDK_TOOLCHAIN_BASENAME-ranlib
export STRIP=$NDK_TOOLCHAIN_BASENAME-strip
export ARCH_FLAGS="-mthumb"
export ARCH_LINK=
export CPPFLAGS=" ${ARCH_FLAGS} -fpic -ffunction-sections -funwind-tables -fstack-protector -fno-strict-aliasing -finline-limit=64 "
export CXXFLAGS=" ${ARCH_FLAGS} -fpic -ffunction-sections -funwind-tables -fstack-protector -fno-strict-aliasing -finline-limit=64 -frtti -fexceptions "
export CFLAGS=" ${ARCH_FLAGS} -fpic -ffunction-sections -funwind-tables -fstack-protector -fno-strict-aliasing -finline-limit=64 "
export LDFLAGS=" ${ARCH_LINK} "
./Configure android
PATH=$TOOLCHAIN_PATH:$PATH make
Please help to tell me where I'm wrong
EDIT:
Follow by jww's suggestion, I try with https://wiki.openssl.org/index.php/Android
I changed some config in setenv-android.sh into:
-_ANDROID_NDK="android-ndk-r12b"
-_ANDROID_EABI="arm-linux-androideabi-4.9"
-_ANDROID_API="android-21"
To generate valid toolchains, I add "windows-x86_64" into for host in "linux-x86_64" "linux-x86" "darwin-x86_64" "darwin-x86" Now it's:
for host in "linux-x86_64" "linux-x86" "darwin-x86_64" "darwin-x86" "windows-x86_64"
do
....
done
+Build openssl-1.1.0:
Error:
$ perl -pi -e 's/install: all install_docs install_sw/install: install_docs install_sw/g' Makefile.org
Can't open Makefile.org: No such file or directory.
EDIT 2:
I follow the wiki update by jww and it runs smoothly until this command:
arm-linux-androideabi-gcc -I /usr/local/ssl/include my_prog.c -o my_prog.exe -L /usr/local/ssl/lib -lssl -lcrypto
If I use $ANDROID_TOOCHAIN/arm-linux-androideabi-gcc -I /usr/local/ssl/include my_prog.c -o my_prog.exe -L /usr/local/ssl/lib -lssl -lcrypto
, it doesn't understand -I
and my_prog.c
I want to build openssl-1.1.0 for android but I don't know how to fix it. Please help