[Libwebsockets] CMAKE error with while doing MIPS cross-compilation on x86 with OPENSSL support

Dinesh Guleria din.gulu.er at gmail.com
Tue Oct 15 08:28:57 CEST 2013


Your  -DOPENSSL_ROOT_DIR  &  -DOPENSSL_INCLUDE_DIR seems to be correct.

I was able to compile libwebsocket previously in scratch box environment
sometime before
If i clearly remember libssl also requires libcrypto.so, to work correctly.

@andy
Just want to confirm :--
Does CMAKE also like .configure script looks into the host environment to
find development headers & binaries ?
Or these *variables (as * -DOPENSSL_ROOT_DIR *) *can guide cmake to get
information about correct binary & development headers ?


On Tue, Oct 15, 2013 at 4:46 AM, "Andy Green (林安廸)" <andy at warmcat.com>wrote:

> On 12/10/13 08:29, the mail apparently from Hemant Kumar included:
>
>  Hi Andy
>>
>> Thanks for reverting back.
>>
>> I did checked the soft link does point to valid openssl lib .
>>
>>
>> bash-4.1$ ls -ltr /home/hkumar/adu/build/**hkumar6.4/Default/nebbiolo/**
>> openssl-regular/openssl-1.0.**1c/nebbiolo_obj/
>> total 8244
>> -rwxr-xr-x 1 hkumar sg-hw 5683606 Oct  9 11:22 libcrypto.so.1.0.0
>> lrwxrwxrwx 1 hkumar sg-hw      18 Oct  9 11:22 libcrypto.so.0 ->
>> libcrypto.so.1.0.0
>> lrwxrwxrwx 1 hkumar sg-hw      18 Oct  9 11:22 libcrypto.so ->
>> libcrypto.so.1.0.0
>> -rwxr-xr-x 1 hkumar sg-hw 1523416 Oct  9 11:22 libssl.so.1.0.0
>> lrwxrwxrwx 1 hkumar sg-hw      15 Oct  9 11:22 libssl.so.0 ->
>> libssl.so.1.0.0
>> lrwxrwxrwx 1 hkumar sg-hw      15 Oct  9 11:22 libssl.so ->
>> libssl.so.1.0.0
>> -rwxr-xr-x 1 hkumar sg-hw 1229985 Oct  9 11:22 openssl
>>
>> Also , I executed following command:
>> bash-4.1$ cmake ..  -DZLIB_LIBRARY="/home/hkumar/**
>> adu/views/hkumar6.4/utils/**zlib/nebbiolo_obj/libz.a"
>> -DZLIB_INCLUDE_DIR="/home/**hkumar/adu/views/hkumar6.4/**utils/zlib/"
>> -DOPENSSL_ROOT_DIR="/home/**hkumar/adu/views/hkumar6.4/**
>> openssl-regular/openssl-1.0.**1c/ssl" -DOPENSSL_LIBRARIES="/home/**
>> hkumar/adu/build/hkumar6.4/**Default/nebbiolo/openssl-**
>> regular/openssl-1.0.1c/**nebbiolo_obj/ libssl.so "
>> -DOPENSSL_INCLUDE_DIR="/home/**hkumar/adu/views/hkumar6.4/**
>> openssl-regular/openssl-1.0.**1c/include/"  -DWITH_SSL=1
>> -DCMAKE_TOOLCHAIN_FILE=../**cross-mips-linux-gnueabihf.**cmake
>>
>> Still I get the same error, any other suggestion.
>>
>
> If it was happening to me I would be tempted to comment the requirement to
> find OpenSSL in the CMakeLists.txt, and see if I get a more informative
> error when I proceeded to build.
>
> Either that or strace the cmake and look at what it was trying to find
> before it blew the error.
>
> -Andy
>
>
>  Thanks a ton
>> Hemant
>>
>> -----Original Message-----
>> From: Andy Green [mailto:extracats at googlemail.**com<extracats at googlemail.com>]
>> On Behalf Of "Andy Green (???)"
>> Sent: Friday, October 11, 2013 5:13 PM
>> To: Hemant Kumar
>> Cc: libwebsockets at ml.**libwebsockets.org<libwebsockets at ml.libwebsockets.org>
>> Subject: Re: [Libwebsockets] CMAKE error with while doing MIPS
>> cross-compilation on x86 with OPENSSL support
>>
>> On 12/10/13 01:37, the mail apparently from Hemant Kumar included:
>>
>>> Hi
>>>
>>> I am getting following error when I try to cross-compile libwebsockets
>>> with cmake.
>>>
>>> I have created cross-compilation file with following content:
>>>
>>> # Name of C compiler.
>>> set(CMAKE_C_COMPILER "${CROSS_PATH}/bin/mipsisa32-**xlr-linux-gcc")
>>> set(CMAKE_CXX_COMPILER "${CROSS_PATH}/bin/mipsisa32-**xlr-linux-g++")
>>>
>>>
>>> -- Looking for zlib.h
>>> -- Looking for zlib.h - not found
>>> -- Looking for 4 include files stdlib.h, ..., float.h
>>> -- Looking for 4 include files stdlib.h, ..., float.h - found
>>> -- Found ZLIB:
>>> /home/hkumar/adu/views/**hkumar6.4/utils/zlib/nebbiolo_**obj/libz.a
>>> (found
>>> version "1.1.4") ZLib include dirs:
>>> /home/hkumar/adu/views/**hkumar6.4/utils/zlib
>>> ZLib libraries:
>>> /home/hkumar/adu/views/**hkumar6.4/utils/zlib/nebbiolo_**obj/libz.a
>>> Compiling with SSL support
>>> CMake Error at
>>> /usr/local/share/cmake-2.8/**Modules/**FindPackageHandleStandardArgs.**
>>> cmake
>>> :108
>>> (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.0.0")
>>> Call Stack (most recent call first*):
>>>
>>> /usr/local/share/cmake-2.8/**Modules/**FindPackageHandleStandardArgs.**
>>> cmake
>>> :315
>>> (_FPHSA_FAILURE_MESSAGE)
>>>     /usr/local/share/cmake-2.8/**Modules/FindOpenSSL.cmake:303
>>> (find_package_handle_standard_**args)
>>>     CMakeLists.txt:442 (find_package)
>>>
>>> Using following command:
>>>
>>> I am providing the .so location for mips Netlogic XLR platform
>>> cross-compiled for OPENSSL library and also header files. It detect
>>> the header files and as we can see above says 1.0.0 as version, but
>>> fails to acknowledge the ssl library and room directory.
>>>
>>> bash-4.1$ cmake ..
>>> -DZLIB_LIBRARY="/home/hkumar/**hkumar6.4/utils/zlib/nebbiolo_**
>>> obj/libz.a"
>>> -DZLIB_INCLUDE_DIR="/home/**hkumar/hkumar6.4/utils/zlib/"
>>> -DOPENSSL_ROOT_DIR="/home/**hkumar/hkumar6.4/openssl-**
>>> regular/openssl-1.0.1c/"
>>>
>>
>> Just some guesses...
>>
>> Is your OpenSSL also static?  That's not supported in our CMake at the
>> moment
>>
>>           else()
>>                   # TODO: Add support for STATIC also.
>>                   find_package(OpenSSL REQUIRED)
>>
>>                   message("OpenSSL include dir: ${OPENSSL_INCLUDE_DIR}")
>>                   message("OpenSSL libraries: ${OPENSSL_LIBRARIES}")
>>
>>
>>                 include_directories(${OPENSSL_**INCLUDE_DIR})
>>                   list(APPEND LIB_LIST${OPENSSL_LIBRARIES})
>>           endif()
>>
>>  -DOPENSSL_LIBRARIES="/home/**hkumar/hkumar6.4/Default/**
>>> nebbiolo/openssl-regular/**openssl-1.0.1c/libssl.so"
>>>
>>
>> This path definitely exists... if libssl.so is a symlink, does what it
>> points to exist?
>>
>>  -DOPENSSL_INCLUDE_DIR="/home/**hkumar/hkumar6.4/openssl-**
>>> regular/openssl-1.0.1c/**include/openssl"
>>>
>>
>> Also this path the references to OpenSSL headers in the source are like
>> #include <openssl/ssl.h>.  So you may not want to give the final /openssl
>> in the path.
>>
>> -Andy
>>
>>  -DWITH_SSL=1
>>> -DCMAKE_TOOLCHAIN_FILE=../**cross-mips-linux-gnueabihf.**cmake
>>>
>>> Please help me resolve this issue.
>>>
>>> Thanks
>>>
>>>
>>>
>>> ______________________________**_________________
>>> Libwebsockets mailing list
>>> Libwebsockets at ml.**libwebsockets.org<Libwebsockets at ml.libwebsockets.org>
>>> http://ml.libwebsockets.org/**mailman/listinfo/libwebsockets<http://ml.libwebsockets.org/mailman/listinfo/libwebsockets>
>>>
>>>
>>
> ______________________________**_________________
> Libwebsockets mailing list
> Libwebsockets at ml.**libwebsockets.org <Libwebsockets at ml.libwebsockets.org>
> http://ml.libwebsockets.org/**mailman/listinfo/libwebsockets<http://ml.libwebsockets.org/mailman/listinfo/libwebsockets>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://libwebsockets.org/pipermail/libwebsockets/attachments/20131015/791ef86d/attachment-0001.html>


More information about the Libwebsockets mailing list