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

"Andy Green (林安廸)" andy at warmcat.com
Sat Oct 12 02:12:38 CEST 2013


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
> http://ml.libwebsockets.org/mailman/listinfo/libwebsockets
>




More information about the Libwebsockets mailing list