[Libwebsockets] build for android using latest NDK and openssl 1.1.1

Andy Green andy at warmcat.com
Fri Feb 7 19:37:06 CET 2020



On 2/7/20 5:04 PM, Jack Munns wrote:
> Greetings,
> Firstly, thanks in advance for any help or pointers. I am trying to 
> build libwebsockets from source using openssl 1.1.1 for android.

It's good you sent the CMakeError.txt because anything to do with cmake 
tests failing wrongly needs that to understand what happened.

> /jack at jack-Virtual-Machine:~/Android/LibWebBuild_And64$ cmake 
> /home/jack/Android/libwebsockets/ 
> -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake 
> -DOPENSSL_ROOT_DIR=$OPENSSL_ROOT_DIR 
> -DOPENSSL_INCLUDE_DIR=$OPENSSL_ROOT_DIR/include 
> -DOPENSSL_SSL_LIBRARY=$OPENSSL_ROOT_DIR/lib/android-arm64/lib.so

There is no such "lib.so", right?

CMake is following what you said there to build test apps to determine 
if various apis exist

Performing C SOURCE FILE Test LWS_HAVE_PIPE2 failed with the following 
output:
Change Dir: /home/jack/Android/LibWebBuild_And64/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_8ef29/fast"
/usr/bin/make -f CMakeFiles/cmTC_8ef29.dir/build.make 
CMakeFiles/cmTC_8ef29.dir/build
make[1]: Entering directory 
'/home/jack/Android/LibWebBuild_And64/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_8ef29.dir/src.c.o
/home/jack/Android/android-ndk-r21/toolchains/llvm/prebuilt/linux-x86_64/bin/clang 
--target=aarch64-none-linux-android21 
--gcc-toolchain=/home/jack/Android/android-ndk-r21/toolchains/llvm/prebuilt/linux-x86_64 
--sysroot=/home/jack/Android/android-ndk-r21/toolchains/llvm/prebuilt/linux-x86_64/sysroot 
-DKEYWORD=__inline -I/home/jack/Android/OpenSSL_Android/include  -Wall 
-Wsign-compare -Wuninitialized -Werror -fvisibility=hidden -Wundef 
-Wtype-limits -Wignored-qualifiers -g -DANDROID -fdata-sections 
-ffunction-sections -funwind-tables -fstack-protector-strong 
-no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat 
-Werror=format-security   -Wno-deprecated-declarations -pthread 
-Wno-error=unused-command-line-argument -DLWS_HAVE_PIPE2 -pthread 
-Wno-error=unused-command-line-argument -fPIE   -o 
CMakeFiles/cmTC_8ef29.dir/src.c.o   -c 
/home/jack/Android/LibWebBuild_And64/CMakeFiles/CMakeTmp/src.c
make[1]: *** No rule to make target 
'/home/jack/Android/OpenSSL_Android/lib/android-arm64/lib.so', needed by 
'cmTC_8ef29'. Stop.

But it's garbage in - garbage out with this wrong "lib.so" when you mean 
libssl.so.

-Andy


More information about the Libwebsockets mailing list