Need to run an Azure IoT SDK C sample on an Axis camera. Using the standard cmake to build the samples does not work, as they are compiled for 64-bit x86_84. Need it to be compiled to MIPS32.
Eugene Sh. suggested making a toolchain file for it. I've written one now, but it fails at 16% with the following error:
[ 16%] /usr/bin/cmake: /usr/local/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
Building C object c-utility/CMakeFiles/aziotsharedutil.dir/adapters/uniqueid_linux.c.o
/demo/azure-iot-sdk-c/c-utility/adapters/uniqueid_linux.c:7:23: fatal error: uuid/uuid.h: No such file or directory
compilation terminated.
make[2]: *** [c-utility/CMakeFiles/aziotsharedutil.dir/adapters/uniqueid_linux.c.o] Error 1
make[1]: *** [c-utility/CMakeFiles/aziotsharedutil.dir/all] Error 2
make: *** [all] Error 2
My toolchain file:
INCLUDE(CMakeForceCompiler)
SET(CMAKE_SYSTEM_NAME Linux) # this one is important
SET(CMAKE_SYSTEM_VERSION 1) # this one not so much
SET(CMAKE_SYSTEM_PROCESSOR mips)
# this is the location of the imps toolchain targeting the M1125
SET(CMAKE_C_COMPILER /usr/local/mipsisa32r2el/r23/bin/mipsisa32r2el-axis-linux-gnu-gcc)
# this is the file system root of the target
#SET(CMAKE_FIND_ROOT_PATH /usr/local/mipsisa32r2el/r23)
# search for programs in the build host directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
And run it using ´./build.sh --toolchain-file toolchain-mips.cmake`.
If I run it as the documentation says, using -cl --sysroot=/usr/local/mipsisa32r2el/r23. I get errors that it cannot find OpenSSL and fails much earlier.