[Libwebsockets] build from repo fails

Andy Green andy at warmcat.com
Sun Jun 6 17:58:41 CEST 2021



On June 6, 2021 2:26:15 PM GMT+01:00, Felipe Gasper <felipe at felipegasper.com> wrote:
>Hello,
>
>	I’m trying to build from the upstream git, but I see this:
>
>-----
>Scanning dependencies of target websockets_shared
>[  1%] Building C object
>lib/CMakeFiles/websockets_shared.dir/plat/unix/unix-caps.c.o
>In file included from
>/Users/felipe/code/libwebsockets/lib/plat/unix/unix-caps.c:28:
>In file included from
>/Users/felipe/code/libwebsockets/lib/core/./private-lib-core.h:140:
>In file included from
>/Users/felipe/code/libwebsockets/include/libwebsockets.h:643:
>/Users/felipe/code/libwebsockets/include/libwebsockets/lws-genhash.h:85:18:
>error:
>      field has incomplete type 'HMAC_CTX' (aka 'struct hmac_ctx_st')
>        HMAC_CTX ctx;
>                 ^
>/opt/local/include/openssl/ossl_typ.h:102:16: note: forward declaration
>of
>      'struct hmac_ctx_st'
>typedef struct hmac_ctx_st HMAC_CTX;
>               ^
>1 error generated.
>make[2]: ***
>[lib/CMakeFiles/websockets_shared.dir/plat/unix/unix-caps.c.o] Error 1
>make[1]: *** [lib/CMakeFiles/websockets_shared.dir/all] Error 2
>make: *** [all] Error 2
>-----
>
>My OpenSSL is OpenSSL 1.1.1k  (25 Mar 2021), and I’m on macOS Mojave.

That's not related to lws but cmake checking what's in your openssl apis.  Have a look at the second part of this

https://libwebsockets.org/git/libwebsockets/tree/READMEs/README.cmake.md

Lws is built in CI on M1 and intel macs every push, eg

https://libwebsockets.org/sai/index.html?task=62057d13492745f360c7e035ea8ff3ae74951508a5fdcbfeb7caba0d7ce58f52

You can see how it configured cmake... you need something similar

cmake .. -DCMAKE_MAKE_PROGRAM=/usr/bin/make -DLWS_OPENSSL_INCLUDE_DIRS=/usr/local/opt/openssl at 1.1/include '-DLWS_OPENSSL_LIBRARIES=/usr/local/opt/openssl/lib/libssl.dylib;/usr/local/opt/openssl/lib/libcrypto.dylib'

-Andy

>	Is this something I could fix?
>
>cheers,
>-Felipe
>_______________________________________________
>Libwebsockets mailing list
>Libwebsockets at ml.libwebsockets.org
>https://libwebsockets.org/mailman/listinfo/libwebsockets


More information about the Libwebsockets mailing list