1】下载源码:wget https://mosquitto.org/files/source/mosquitto-1.6.9.tar.gz
2】tar zxfv mosquitto-1.6.9.tar.gz
3】cd mosquitto-1.6.9
4】gedit CMakeLists.txt
在set (VERSION 1.6.9)下一行增加以下部分:
#add ---start
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR arm)
SET(CMAKE_C_COMPILER /home/a/Downloads/neoway-arm-oe-linux/sysroots/x86_64-oesdk-linux/usr/bin/arm-oe-linux-gnueabi/arm-oe-linux-gnueabi-gcc)
SET(CMAKE_CXX_COMPILER /home/a/Downloads/neoway-arm-oe-linux/sysroots/x86_64-oesdk-linux/usr/bin/arm-oe-linux-gnueabi/arm-oe-linux-gnueabi-g++)
set(CMAKE_SYSROOT /home/a/Downloads/neoway-arm-oe-linux/sysroots/armv7a-vfp-neon-oe-linux-gnueabi)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
include_directories(/home/a/mosquitto/mosquitto/src/deps/)
#add ---end
5】source ~/Downloads/neoway-arm-oe-linux/neoway-env-init.sh
mkdir output
cd output
cmake ..
make
6】查看生成的库:
ls lib
将三个.so文件推到板子的/usr/lib即可,
1】下载源码:wget https://mosquitto.org/files/source/mosquitto-1.6.9.tar.gz
2】tar zxfv mosquitto-1.6.9.tar.gz
3】cd mosquitto-1.6.9
4】gedit CMakeLists.txt
在set (VERSION 1.6.9)下一行增加以下部分:
#add ---start
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR arm)
SET(CMAKE_C_COMPILER /home/a/Downloads/neoway-arm-oe-linux/sysroots/x86_64-oesdk-linux/usr/bin/arm-oe-linux-gnueabi/arm-oe-linux-gnueabi-gcc)
SET(CMAKE_CXX_COMPILER /home/a/Downloads/neoway-arm-oe-linux/sysroots/x86_64-oesdk-linux/usr/bin/arm-oe-linux-gnueabi/arm-oe-linux-gnueabi-g++)
set(CMAKE_SYSROOT /home/a/Downloads/neoway-arm-oe-linux/sysroots/armv7a-vfp-neon-oe-linux-gnueabi)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
include_directories(/home/a/mosquitto/mosquitto/src/deps/)
#add ---end
5】source ~/Downloads/neoway-arm-oe-linux/neoway-env-init.sh
mkdir output
cd output
cmake ..
make
6】查看生成的库:
ls lib
将三个.so文件推到板子的/usr/lib即可,