下载编译源文件mosquitto-auth-plug-0.1.3.tar.gz
tar解压,进入目录,修改config.mk文件
内容如下
# Select your backends from this list BACKEND_CDB ?= no BACKEND_MYSQL ?= no BACKEND_SQLITE ?= no BACKEND_REDIS ?= yes BACKEND_POSTGRES ?= no BACKEND_LDAP ?= no BACKEND_HTTP ?= no BACKEND_JWT ?= no BACKEND_MONGO ?= no BACKEND_FILES ?= no BACKEND_MEMCACHED ?= no #CC =aarch64-linux-gnu-gcc #CXX=aarch64-linux-gnu-g++ CC =/home/forlinx/work/edgeOS/build/toolchain/gcc-linaro-11.2.1-2022.02-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc CXX=/home/forlinx/work/edgeOS/build/toolchain/gcc-linaro-11.2.1-2022.02-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-g++ # Specify the path to the Mosquitto sources here # MOSQUITTO_SRC = /usr/local/Cellar/mosquitto/1.4.12 MOSQUITTO_SRC = /home/forlinx/work/tool/mosquitto/mosquitto-1.5.8 # Specify the path the OpenSSL here OPENSSLDIR = /home/forlinx/work/tool/openssl/out # Add support for django hashers algorithm name SUPPORT_DJANGO_HASHERS ?= no # Specify optional/additional linker/compiler flags here # On macOS, add # CFG_LDFLAGS = -undefined dynamic_lookup # as described in https://github.com/eclipse/mosquitto/issues/244 # # CFG_LDFLAGS = -undefined dynamic_lookup -L/usr/local/Cellar/openssl/1.0.2l/lib # CFG_CFLAGS = -I/usr/local/Cellar/openssl/1.0.2l/include -I/usr/local/Cellar/mosquitto/1.4.12/include # CFG_LDFLAGS = -L/home/forlinx/work/tool/openssl/out/lib -L/home/forlinx/work/tool/mosquitto/out/lib -L/home/forlinx/work/tool/hiredis/out/lib CFG_CFLAGS = -I/home/forlinx/work/tool/openssl/out/include -I/home/forlinx/work/tool/mosquitto/out/include -I/home/forlinx/work/tool/hiredis/out/include
修改地方注解:
GCC和G++的路径
CC =/home/forlinx/work/edgeOS/build/toolchain/gcc-linaro-11.2.1-2022.02-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc
CXX=/home/forlinx/work/edgeOS/build/toolchain/gcc-linaro-11.2.1-2022.02-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-g++
交叉编译的mosquitto-1.5.8源码路径
MOSQUITTO_SRC = /home/forlinx/work/tool/mosquitto/mosquitto-1.5.8
交叉编译openssl的输出路径
OPENSSLDIR = /home/forlinx/work/tool/openssl/out
openssl、mosquitto、hiredis的交叉编译的lib和includ路径
CFG_LDFLAGS = -L/home/forlinx/work/tool/openssl/out/lib -L/home/forlinx/work/tool/mosquitto/out/lib -L/home/forlinx/work/tool/hiredis/out/lib
CFG_CFLAGS = -I/home/forlinx/work/tool/openssl/out/include -I/home/forlinx/work/tool/mosquitto/out/include -I/home/forlinx/work/tool/hiredis/out/include
最后make,生成auth-plug.so



