[Libwebsockets] Cross compiling cmake error due to SSL library

Thomas Spitz thomas.spitz at hestia-france.com
Wed Nov 20 19:02:39 CET 2013


Hello everybody,

I have compiled libwebsockets for my ubuntu PC with success using
http://git.libwebsockets.org/cgi-bin/cgit/libwebsockets/tree/README.build
 tutorial.

Here below a trace of the SSL phase compilation:

-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.3.4")
ZLib include dirs: /usr/include
ZLib libraries: /usr/lib/x86_64-linux-gnu/libz.so
Compiling with SSL support
-- checking for module 'openssl'
--   found openssl, version 1.0.1
-- Found OpenSSL:
/usr/lib/x86_64-linux-gnu/libssl.so;/usr/lib/x86_64-linux-gnu/libcrypto.so
(found version "1..1")
OpenSSL include dir: /usr/include
OpenSSL libraries:
/usr/lib/x86_64-linux-gnu/libssl.so;/usr/lib/x86_64-linux-gnu/libcrypto.so
Searching for OpenSSL executable and dlls
OpenSSL executable: /usr/bin/openssl
Generating SSL Certificates for the test-server...

Now I am trying to cross compile libwebsockets for an ARM9 with SSL support
as it is required for my project.

I had first some errors for finding Zlib and manage to go throught thanks
to the following options:
cmake . -DCMAKE_INSTALL_PREFIX:PATH=./
-DCMAKE_TOOLCHAIN_FILE=./cross-arm-linux-apf28.cmake
-DZLIB_LIBRARY=/home/thomas/Armadeus/armadeus-git/armadeus/buildroot/output/build/zlib-1.2.7/libz.so
-DZLIB_INCLUDE_DIR=/home/thomas/Armadeus/armadeus-git/armadeus/buildroot/output/staging/usr/include/

Now I have fot the following errors due to openssl library:

ZLib include dirs:
/home/thomas/Armadeus/armadeus-git/armadeus/buildroot/output/staging/usr/include
ZLib libraries:
/home/thomas/Armadeus/armadeus-git/armadeus/buildroot/output/build/zlib-1.2.7/libz.so
Compiling with SSL support
CMake Error at
/usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:91
(MESSAGE):
  Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the
  system variable OPENSSL_ROOT_DIR (missing: OPENSSL_LIBRARIES) (found
  version "1..1")
Call Stack (most recent call first):
  /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:252
(_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-2.8/Modules/FindOpenSSL.cmake:234
(find_package_handle_standard_args)
  CMakeLists.txt:443 (find_package)

At first it didn't manage to find openssl version. I had to
had -DOPENSSL_INCLUDE_DIR=/home/thomas/Armadeus/armadeus-git/armadeus/buildroot/output/build/openssl-1.0.1e/include/
option.

I spent hours trying to find the correct options to make it work. Here is
one of my last tests:
cmake . -DCMAKE_INSTALL_PREFIX:PATH=./
-DCMAKE_TOOLCHAIN_FILE=./cross-arm-linux-apf28.cmake
-DZLIB_LIBRARY=/home/thomas/Armadeus/armadeus-git/armadeus/buildroot/output/build/zlib-1.2.7/libz.so
-DZLIB_INCLUDE_DIR=/home/thomas/Armadeus/armadeus-git/armadeus/buildroot/output/staging/usr/include/
-DOPENSSL_ROOT_DIR=/home/thomas/Armadeus/armadeus-git/armadeus/buildroot/
-DOPENSSL_INCLUDE_DIR=/home/thomas/Armadeus/armadeus-git/armadeus/buildroot/output/build/openssl-1.0.1e/include/
-DOPENSSL_LIBRARIES=/home/thomas/Armadeus/armadeus-git/armadeus/buildroot/output/staging/usr/lib

I compared this cross compilation trace with my PC and search for
/usr/lib/x86_64-linux-gnu/libssl.so;/usr/lib/x86_64-linux-gnu/libcrypto.so.

libcrypto.so and libssl.o are both located at
/home/thomas/Armadeus/armadeus-git/armadeus/buildroot/output/staging/usr/lib

Should I had them manually (not indicating the folder but the two files...
but I don't kow how)? Any suggestion?

I have seen that some of you already had this kind of problem (
http://ml.libwebsockets.org/pipermail/libwebsockets/2013-April/000459.html
 and
http://stackoverflow.com/questions/16248775/cmake-not-able-to-find-openssl)
but I didn't managed to find a solution through the reading. By the way, on
my PC, there is no ssl folder with library in (no */usr/local/include/ssl/)*

Hope you could help me.

Thanks in advance
Best regards,
Thomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://libwebsockets.org/pipermail/libwebsockets/attachments/20131120/5a0aa502/attachment.html>


More information about the Libwebsockets mailing list