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

Jack Munns kaspermunns at gmail.com
Fri Feb 7 18:04:40 CET 2020


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.

I followed this to build the openssl libraries:
https://proandroiddev.com/tutorial-compile-openssl-to-1-1-1-for-android-application-87137968fee
Then I have tried to run build libwebsockets using cmake then make with no
success.  I have attempted with various different parameters for cmake, and
this is the closest to working:
*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
-DOPENSSL_CRYPTO_LIBRARY=$OPENSSL_ROOT_DIR/lib/android-arm64/lib/libcrypto.so
-DANDROID_ABI=arm64-v8a*
It looks like the correct version of openssl is found:



*Compiling with SSL support-- Found OpenSSL:
/home/jack/Android/OpenSSL_Android/lib/android-arm64/lib/libcrypto.so
(found version "1.1.1e") OpenSSL include dir:
/home/jack/Android/OpenSSL_Android/includeOpenSSL libraries:
/home/jack/Android/OpenSSL_Android/lib/android-arm64/lib.so;/home/jack/Android/OpenSSL_Android/lib/android-arm64/lib/libcrypto.so*
however, clearly lots of things are "not found" (see attached for full
list) and when I try to make I get the following error:

*/home/jack/Android/libwebsockets/include/libwebsockets/lws-genhash.h:79:18:
error: field has incomplete type 'HMAC_CTX' (aka 'struct hmac_ctx_st')
  HMAC_CTX ctx;*
I have also tried to use the android make scrip in contrib, using the older
ndk, without much luck.  So its likely I am missing some crucial step.  I
have been working both on mac and a linux mint virtual machine.  I note
that the more recent versions of the android ndk no longer require the
"make toolchain" step. I have also seen this error in various bug reports,
but couldn't work out a fix from that.

I am aware that guides and scripts for android are contributed, but would
be very grateful for any assistance.
kind regards,
Jack
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://libwebsockets.org/pipermail/libwebsockets/attachments/20200207/6d7868ad/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: build_outputtxtfiles.tar.gz
Type: application/gzip
Size: 12945 bytes
Desc: not available
URL: <https://libwebsockets.org/pipermail/libwebsockets/attachments/20200207/6d7868ad/attachment.gz>


More information about the Libwebsockets mailing list