* [Buildroot] [PATCH 2/2] package/mosquitto: bump to version 2.1.2
2026-02-10 16:16 [Buildroot] [PATCH 0/2] [RFC] package/mosquitto: bump version yann.morin
2026-02-10 16:16 ` [Buildroot] [PATCH 1/2] package/cjson: add host variant yann.morin
@ 2026-02-10 16:16 ` yann.morin
1 sibling, 0 replies; 3+ messages in thread
From: yann.morin @ 2026-02-10 16:16 UTC (permalink / raw)
To: buildroot; +Cc: yann.morin, Titouan Christophe
From: "Yann E. MORIN" <yann.morin@orange.com>
Version 2.1.x has introduced a cmake-based build, and upstream strongly
recomends using it over the legacy Makefiles, which will ultimately be
retired.
So we do the switch, which cause quite some noise in the .mk file, but
at the same time allows for a bit of cleanup in the build process, as we
can now use the cmake-package infra.
Mosquitto now wants to peek into the malloc() internals for memory
tracking, and that only works on systems with an MMU (uClibc-ng does not
expose it for noMMU builds, as it's part of its malloc-standard
implementation).
Static-pnly builds are broken, even when only building the library. This
seems beyond a simple repair, so just require shared libs now (since
we're requiring an MMU as well, requiring shared libs is not too much of
an additional burden).
cJSON is now a required dependency, used in common parts of the code
(not just for the plugins.
There are a few options that we forcibly disable; they'll get addressed
in followup patches.
There are stil la few build failures that are difficult to account for
(exceprt):
$ printf 'BR2_PACKAGE_MOSQUITTO=y\n' >mosq.cfg
$ ./utils/docker-run ./utils/test-pkg -d $(pwd)/run-tests -c mosq.cfg -p mosquitto
br-arm-full-static [5/6]: FAILED
=> old uClibc-ng, would need __GNU_SOURCE (with dunder) to define
getrandom(); no longer needed since uClibc-ng 1.0.50; would need
openssl otherwise
bootlin-aarch64-glibc-old [6/6]: FAILED
=> really old glibc, missing getrandom(); would need openssl
Drop our existing patches, they've either been applied upstream, or are
no longer needed. Add new patches to fix various build issues
(submission upstream pending the signature of the CLA..,).
Thanks a lot to Titouan for providing his initial work on the update!
Some of his findings ended up in this patch. 👍
Note: by lack of a trusted path back to the PGP key that signed the
archive, the comment was dropped, as checking a signature without a
trust-chain does not make much sense...
Co-developped-by: Titouan Christophe <titouan.christophe@mind.be>
Signed-off-by: Yann E. MORIN <yann.morin@orange.com>
Cc: Titouan Christophe <titouan.christophe@mind.be>
Cc: Peter Korsgaard <peter@korsgaard.com>
---
---
...-only-require-C-when-actually-needed.patch | 44 +++++
...1-Fix-CMake-builds-with-WITH_TLS-OFF.patch | 50 -----
...02-Add-configure-time-check-for-lanl.patch | 47 -----
...ker-properly-check-for-getaddrinfo_a.patch | 38 ++++
.../0003-libcommon-check-for-getrandom.patch | 83 +++++++++
package/mosquitto/Config.in | 15 +-
package/mosquitto/mosquitto.hash | 7 +-
package/mosquitto/mosquitto.mk | 173 +++++++++---------
8 files changed, 261 insertions(+), 196 deletions(-)
create mode 100644 package/mosquitto/0001-CMakeList-only-require-C-when-actually-needed.patch
delete mode 100644 package/mosquitto/0001-Fix-CMake-builds-with-WITH_TLS-OFF.patch
delete mode 100644 package/mosquitto/0002-Add-configure-time-check-for-lanl.patch
create mode 100644 package/mosquitto/0002-broker-properly-check-for-getaddrinfo_a.patch
create mode 100644 package/mosquitto/0003-libcommon-check-for-getrandom.patch
diff --git a/package/mosquitto/0001-CMakeList-only-require-C-when-actually-needed.patch b/package/mosquitto/0001-CMakeList-only-require-C-when-actually-needed.patch
new file mode 100644
index 0000000000..0029466c32
--- /dev/null
+++ b/package/mosquitto/0001-CMakeList-only-require-C-when-actually-needed.patch
@@ -0,0 +1,44 @@
+From 0e28d6c4a53a62ad9fa3f7d1fd97349d1084b054 Mon Sep 17 00:00:00 2001
+Message-Id: <0e28d6c4a53a62ad9fa3f7d1fd97349d1084b054.1770735837.git.yann.morin@orange.com>
+From: "Yann E. MORIN" <yann.morin@orange.com>
+Date: Tue, 10 Feb 2026 07:13:01 +0100
+Subject: [PATCH] CMakeList: only require C++ when actually needed
+
+So far, C++ is unconditionally required, efven when not
+building the C++ wrapper library.
+
+Only require C++ when said library is actually enabled.
+
+Signed-off-by: Yann E. MORIN <yann.morin@orange.com>
+Upstream: CLA under signature...
+---
+ CMakeLists.txt | 2 +-
+ lib/cpp/CMakeLists.txt | 2 ++
+ 2 files changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 6c68bb9c..a4dbfdf6 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -10,7 +10,7 @@ set (VERSION 2.1.2)
+ project(mosquitto
+ VERSION ${VERSION}
+ DESCRIPTION "Eclipse Mosquitto"
+- LANGUAGES C CXX
++ LANGUAGES C
+ )
+
+ set(CMAKE_C_STANDARD 99)
+diff --git a/lib/cpp/CMakeLists.txt b/lib/cpp/CMakeLists.txt
+index 2007f7a6..6bbd92bf 100644
+--- a/lib/cpp/CMakeLists.txt
++++ b/lib/cpp/CMakeLists.txt
+@@ -1,3 +1,5 @@
++ENABLE_LANGUAGE(CXX)
++
+ set(CPP_SRC mosquittopp.cpp ../../include/mosquitto/libmosquittopp.h)
+
+ add_library(mosquittopp SHARED
+--
+2.34.1
+
diff --git a/package/mosquitto/0001-Fix-CMake-builds-with-WITH_TLS-OFF.patch b/package/mosquitto/0001-Fix-CMake-builds-with-WITH_TLS-OFF.patch
deleted file mode 100644
index 9445148f44..0000000000
--- a/package/mosquitto/0001-Fix-CMake-builds-with-WITH_TLS-OFF.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-From 1ecc94d7b4ff495afd7f32c42072cdf4ea5407aa Mon Sep 17 00:00:00 2001
-From: Ben Marsh <ben.marsh555@googlemail.com>
-Date: Mon, 21 Jul 2025 17:46:16 +0100
-Subject: [PATCH] Fix CMake builds with WITH_TLS=OFF
-
-Recent CMake changes caused CMake builds with the WITH_TLS option set to OFF to fail. The OpenSSL package is only found (find_package()) if WITH_TLS is ON, but linking to OpenSSL for the broker and library is not guarded by WITH_TLS. The build therefore fails.
-
-Guard linking to OpenSSL, only linking if WITH_TLS is set.
-
-Upstream: https://github.com/eclipse-mosquitto/mosquitto/pull/3321
-Signed-off-by: Scott Fan <fancp2007@gmail.com>
----
- lib/CMakeLists.txt | 4 +++-
- src/CMakeLists.txt | 5 ++++-
- 2 files changed, 7 insertions(+), 2 deletions(-)
-
-diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
-index 21b61497..e6b8235b 100644
---- a/lib/CMakeLists.txt
-+++ b/lib/CMakeLists.txt
-@@ -60,7 +60,9 @@ set(C_SRC
- util_mosq.c util_topic.c util_mosq.h
- will_mosq.c will_mosq.h)
-
--set (LIBRARIES OpenSSL::SSL)
-+if (WITH_TLS)
-+ set (LIBRARIES OpenSSL::SSL)
-+endif()
-
- if (UNIX AND NOT APPLE AND NOT ANDROID)
- find_library(LIBRT rt)
-diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
-index d4bae7cd..6fd0ee53 100644
---- a/src/CMakeLists.txt
-+++ b/src/CMakeLists.txt
-@@ -163,7 +163,10 @@ if (WITH_DLT)
- set (MOSQ_LIBS ${MOSQ_LIBS} ${DLT_LIBRARIES})
- endif (WITH_DLT)
-
--set (MOSQ_LIBS ${MOSQ_LIBS} OpenSSL::SSL)
-+if (WITH_TLS)
-+ set (MOSQ_LIBS ${MOSQ_LIBS} OpenSSL::SSL)
-+endif()
-+
- # Check for getaddrinfo_a
- include(CheckLibraryExists)
- check_library_exists(anl getaddrinfo_a "" HAVE_GETADDRINFO_A)
---
-2.43.0
-
diff --git a/package/mosquitto/0002-Add-configure-time-check-for-lanl.patch b/package/mosquitto/0002-Add-configure-time-check-for-lanl.patch
deleted file mode 100644
index b67164123a..0000000000
--- a/package/mosquitto/0002-Add-configure-time-check-for-lanl.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From 447a6aa8df882a67ca3df6f5e95be42e1463eaf0 Mon Sep 17 00:00:00 2001
-From: Titouan Christophe <titouan.christophe@mind.be>
-Date: Fri, 29 Aug 2025 19:47:34 +0200
-Subject: [PATCH] Add configure-time check for -lanl
-
-Since glibc 2.34, libanl features have been integrated directly into libc [1].
-For backward compatibility, some toolchains still provide a shim for
-libanl as a separate .so, but new toolchains (for example for new archs
-like loongarch) do not provide it anymore.
-
-In such a case, building mosquitto fails at link time with (see [2])
- > cannot find -lanl: No such file or directory
-
-To fix this problem while maintaining compatibility with older toolchains,
-check if a simple program that uses libanl can be compiled without -lanl,
-and only add the linker flag otherwise.
-
-[1] https://sourceware.org/pipermail/libc-alpha/2021-August/129718.html
-[2] https://autobuild.buildroot.org/results/16223cd838876abc9b6f941f7dc20d23afa32c3b/build-end.log
-
-Upstream: https://github.com/eclipse-mosquitto/mosquitto/pull/3358
-
-Signed-off-by: Titouan Christophe <titouan.christophe@mind.be>
----
- config.mk | 5 ++++-
- 1 file changed, 4 insertions(+), 1 deletion(-)
-
-diff --git a/config.mk b/config.mk
-index 34d5163f..cc7987c4 100644
---- a/config.mk
-+++ b/config.mk
-@@ -318,8 +318,11 @@ ifeq ($(WITH_EC),yes)
- endif
-
- ifeq ($(WITH_ADNS),yes)
-- BROKER_LDADD:=$(BROKER_LDADD) -lanl
- BROKER_CPPFLAGS:=$(BROKER_CPPFLAGS) -DWITH_ADNS
-+ NEED_LIBANL := $(shell printf '#include <stdlib.h>\n#include <netdb.h>\nint main(){return getaddrinfo_a(0, NULL, 0, NULL);}'| $(CC) -D_GNU_SOURCE -o /dev/null -x c - 2>/dev/null || echo YES)
-+ ifeq ($(NEED_LIBANL),YES)
-+ BROKER_LDADD:=$(BROKER_LDADD) -lanl
-+ endif
- endif
-
- ifeq ($(WITH_CONTROL),yes)
---
-2.50.1
-
diff --git a/package/mosquitto/0002-broker-properly-check-for-getaddrinfo_a.patch b/package/mosquitto/0002-broker-properly-check-for-getaddrinfo_a.patch
new file mode 100644
index 0000000000..4aef8c5ba7
--- /dev/null
+++ b/package/mosquitto/0002-broker-properly-check-for-getaddrinfo_a.patch
@@ -0,0 +1,38 @@
+From 876e2b791d2db118b0b0d36d315fa3480d7b8d8c Mon Sep 17 00:00:00 2001
+Message-Id: <876e2b791d2db118b0b0d36d315fa3480d7b8d8c.1770735837.git.yann.morin@orange.com>
+In-Reply-To: <0e28d6c4a53a62ad9fa3f7d1fd97349d1084b054.1770735837.git.yann.morin@orange.com>
+References: <0e28d6c4a53a62ad9fa3f7d1fd97349d1084b054.1770735837.git.yann.morin@orange.com>
+From: "Yann E. MORIN" <yann.morin@orange.com>
+Date: Tue, 10 Feb 2026 09:21:11 +0100
+Subject: [PATCH] broker: properly check for getaddrinfo_a()
+
+getaddrinfo_a( is protected by _GNU_SOURCE.
+
+This is proerly accounted for in the source doe, in lib/net_mosq.c, but
+the check in the CmakeList is missing that define, which causes the
+check to actually fail.
+
+Add that define when checking; this fixes builds on various C libraries,
+like uClibc-ng, musl, or newer/older glibc.
+
+Signed-off-by: Yann E. MORIN <yann.morin@orange.com>
+Upstream: CLA under signature...
+---
+ src/CMakeLists.txt | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index 8ac47d87..8576fea9 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -184,6 +184,7 @@ endif()
+ if(WITH_ADNS)
+ cmake_push_check_state()
+ set(ANL_CODE "
++ #define _GNU_SOURCE
+ #include <stdlib.h>
+ #include <netdb.h>
+ int main(){
+--
+2.34.1
+
diff --git a/package/mosquitto/0003-libcommon-check-for-getrandom.patch b/package/mosquitto/0003-libcommon-check-for-getrandom.patch
new file mode 100644
index 0000000000..e228f44585
--- /dev/null
+++ b/package/mosquitto/0003-libcommon-check-for-getrandom.patch
@@ -0,0 +1,83 @@
+From bfdbb6190a3ae2499ed4dd06d359b80c9a9997ea Mon Sep 17 00:00:00 2001
+Message-Id: <bfdbb6190a3ae2499ed4dd06d359b80c9a9997ea.1770735837.git.yann.morin@orange.com>
+In-Reply-To: <0e28d6c4a53a62ad9fa3f7d1fd97349d1084b054.1770735837.git.yann.morin@orange.com>
+References: <0e28d6c4a53a62ad9fa3f7d1fd97349d1084b054.1770735837.git.yann.morin@orange.com>
+From: "Yann E. MORIN" <yann.morin@orange.com>
+Date: Tue, 10 Feb 2026 12:01:32 +0100
+Subject: [PATCH] libcommon: check for getrandom()
+
+Not all C libraries are glibc, or impersonating it; for example, musl
+does not pretend to be any version of glibc. Thus, building on musl
+fails when openssl is disabled, because no random-providing function is
+detected, although musl does provide getrandom().
+
+uClibc-ng on the other hand, can impersonate glibc, but availability of
+getrandom() is not guatranteed there: getrandom() can be compiled out of
+uClinbc-ng, or uClibc-ng can be too old to have it.
+
+Add a configure-time check that getrandom() is available, as a fallback
+when TLS is not enabled (and thus openssl is not used), and when not on
+Win32 (where getting random numbers is always possible, at least from a
+build perspective).
+
+Signed-off-by: Yann E. MORIN <yann.morin@orange.com>
+Upstream: CLA under signature...
+---
+ libcommon/CMakeLists.txt | 8 ++++++++
+ libcommon/random_common.c | 11 ++---------
+ 2 files changed, 10 insertions(+), 9 deletions(-)
+
+diff --git a/libcommon/CMakeLists.txt b/libcommon/CMakeLists.txt
+index 8f3474a0..7b9118bc 100644
+--- a/libcommon/CMakeLists.txt
++++ b/libcommon/CMakeLists.txt
+@@ -57,6 +57,14 @@ if (WITH_TLS)
+ PUBLIC
+ OpenSSL::SSL
+ )
++elseif(NOT WIN32)
++ include(CheckSymbolExists)
++ check_symbol_exists(getrandom "sys/random.h" GETRANDOM_FOUND)
++ if(GETRANDOM_FOUND)
++ add_definitions("-DHAVE_GETRANDOM")
++ else()
++ message(FATAL_ERROR "C library does not provide getrandom(); enable WITH_TLS instead")
++ endif()
+ endif()
+
+ if(INC_MEMTRACK)
+diff --git a/libcommon/random_common.c b/libcommon/random_common.c
+index 555bd801..2edf5471 100644
+--- a/libcommon/random_common.c
++++ b/libcommon/random_common.c
+@@ -26,16 +26,11 @@ Contributors:
+ # include <lmcons.h>
+ #endif
+
+-#if !defined(WITH_TLS) && defined(__linux__) && defined(__GLIBC__)
+-# if __GLIBC_PREREQ(2, 25)
+-# include <sys/random.h>
+-# define HAVE_GETRANDOM 1
+-# endif
+-#endif
+-
+ #ifdef WITH_TLS
+ # include <openssl/bn.h>
+ # include <openssl/rand.h>
++#elif defined(HAVE_GETRANDOM)
++# include <sys/random.h>
+ #endif
+
+ #include "mosquitto.h"
+@@ -65,8 +60,6 @@ int mosquitto_getrandom(void *bytes, int count)
+ }
+
+ CryptReleaseContext(provider, 0);
+-#else
+-# error "No suitable random function found."
+ #endif
+ return rc;
+ }
+--
+2.34.1
+
diff --git a/package/mosquitto/Config.in b/package/mosquitto/Config.in
index 339df8fddb..2667b60f57 100644
--- a/package/mosquitto/Config.in
+++ b/package/mosquitto/Config.in
@@ -1,5 +1,8 @@
config BR2_PACKAGE_MOSQUITTO
bool "mosquitto"
+ depends on BR2_USE_MMU # lib peeks in malloc() internals; broker fork()s
+ depends on !BR2_STATIC_LIBS
+ select BR2_PACKAGE_CJSON
help
Eclipse Mosquitto is an open source (EPL/EDL licensed) message
broker that implements the MQTT protocol versions 5.0, 3.1.1
@@ -19,12 +22,11 @@ config BR2_PACKAGE_MOSQUITTO
https://mosquitto.org/
+if BR2_PACKAGE_MOSQUITTO
+
config BR2_PACKAGE_MOSQUITTO_BROKER
bool "install the mosquitto broker"
default y
- depends on BR2_USE_MMU # fork()
- depends on !BR2_STATIC_LIBS # include <dlfcn.h>
- depends on BR2_PACKAGE_MOSQUITTO
select BR2_PACKAGE_LIBWEBSOCKETS_EXT_POLL if BR2_PACKAGE_LIBWEBSOCKETS
help
Build and install the mosquitto broker onto target.
@@ -32,13 +34,16 @@ config BR2_PACKAGE_MOSQUITTO_BROKER
config BR2_PACKAGE_MOSQUITTO_BROKER_DYNAMIC_SECURITY_PLUGIN
bool "dynamic security plugin"
depends on BR2_PACKAGE_MOSQUITTO_BROKER
- select BR2_PACKAGE_CJSON
select BR2_PACKAGE_OPENSSL
help
Build and install the dynamic security plugin for
mosquitto broker onto target.
comment "mosquitto broker needs a toolchain w/ dynamic library"
+ depends on BR2_STATIC_LIBS
+
+endif
+
+comment "mosquitto needs a toolchain w/ dynamic library"
depends on BR2_USE_MMU
depends on BR2_STATIC_LIBS
- depends on BR2_PACKAGE_MOSQUITTO
diff --git a/package/mosquitto/mosquitto.hash b/package/mosquitto/mosquitto.hash
index cf031f91e5..c0306161c7 100644
--- a/package/mosquitto/mosquitto.hash
+++ b/package/mosquitto/mosquitto.hash
@@ -1,8 +1,7 @@
-# Locally calculated after checking gpg signature
-# from https://mosquitto.org/files/source/mosquitto-2.0.22.tar.gz.asc
-sha256 2f752589ef7db40260b633fbdb536e9a04b446a315138d64a7ff3c14e2de6b68 mosquitto-2.0.22.tar.gz
+# Locally calculated
+sha256 fd905380691ac65ea5a93779e8214941829e3d6e038d5edff9eac5fd74cbed02 mosquitto-2.1.2.tar.gz
# License files
-sha256 d3c4ccace4e5d3cc89d34cf2a0bc85b8596bfc0a32b815d0d77f9b7c41b5350c LICENSE.txt
+sha256 33d1851e40fddba7eff95bcc01d1a178a87340a1126893012892913d5e6fdfa6 LICENSE.txt
sha256 8c349f80764d0648e645f41ef23772a70c995a0924b5235f735f4a3d09df127c epl-v20
sha256 86fc4a3f97cb769c04e8da557036c1066eb8bb22b2d0a5dd31464990fe84047c edl-v10
diff --git a/package/mosquitto/mosquitto.mk b/package/mosquitto/mosquitto.mk
index 8539f28d08..1e4b4d99c4 100644
--- a/package/mosquitto/mosquitto.mk
+++ b/package/mosquitto/mosquitto.mk
@@ -4,119 +4,96 @@
#
################################################################################
-MOSQUITTO_VERSION = 2.0.22
+MOSQUITTO_VERSION = 2.1.2
MOSQUITTO_SITE = https://mosquitto.org/files/source
MOSQUITTO_LICENSE = EPL-2.0 or EDLv1.0
MOSQUITTO_LICENSE_FILES = LICENSE.txt epl-v20 edl-v10
MOSQUITTO_CPE_ID_VENDOR = eclipse
MOSQUITTO_INSTALL_STAGING = YES
-MOSQUITTO_MAKE_OPTS = \
- CLIENT_STATIC_LDADD="$(MOSQUITTO_STATIC_LIBS)" \
- UNAME=Linux \
- STRIP=true \
- prefix=/usr \
- WITH_WRAP=no \
- WITH_DOCS=no
+MOSQUITTO_DEPENDENCIES = cjson
-ifeq ($(BR2_SHARED_LIBS),y)
-MOSQUITTO_MAKE_OPTS += WITH_STATIC_LIBRARIES=no
-else
-MOSQUITTO_MAKE_OPTS += WITH_STATIC_LIBRARIES=yes
-endif
-
-ifeq ($(BR2_STATIC_LIBS),y)
-MOSQUITTO_MAKE_OPTS += WITH_SHARED_LIBRARIES=no
-else
-MOSQUITTO_MAKE_OPTS += WITH_SHARED_LIBRARIES=yes
-endif
-
-ifeq ($(BR2_PACKAGE_SYSTEMD),y)
-MOSQUITTO_MAKE_OPTS += WITH_SYSTEMD=yes
-MOSQUITTO_DEPENDENCIES += systemd
-endif
+MOSQUITTO_CONF_OPTS = \
+ -DUSE_LIBWRAP=OFF \
+ -DWITH_DOCS=OFF \
+ -DWITH_TESTS=OFF \
+ -DWITH_STATIC_LIBRARIES=OFF \
+ -DWITH_BUNDLED_DEPS=ON \
+ -DWITH_WEBSOCKETS_BUILTIN=OFF \
+ -DWITH_CLIENTS=ON \
+ -DWITH_HTTP_API=OFF \
+ -DWITH_CTRL_SHELL=OFF
# adns uses getaddrinfo_a
ifeq ($(BR2_TOOLCHAIN_USES_GLIBC),y)
-MOSQUITTO_MAKE_OPTS += WITH_ADNS=yes
+MOSQUITTO_CONF_OPTS += -DWITH_ADNS=ON
else
-MOSQUITTO_MAKE_OPTS += WITH_ADNS=no
+MOSQUITTO_CONF_OPTS += -DWITH_ADNS=OFF
endif
# threaded API uses pthread_setname_np
ifeq ($(BR2_TOOLCHAIN_HAS_THREADS_NPTL),y)
-MOSQUITTO_MAKE_OPTS += WITH_THREADING=yes
+MOSQUITTO_CONF_OPTS += -DWITH_THREADING=ON
else
-MOSQUITTO_MAKE_OPTS += WITH_THREADING=no
+MOSQUITTO_CONF_OPTS += -DWITH_THREADING=OFF
endif
ifeq ($(BR2_PACKAGE_OPENSSL),y)
MOSQUITTO_DEPENDENCIES += host-pkgconf openssl
-MOSQUITTO_MAKE_OPTS += WITH_TLS=yes
-MOSQUITTO_STATIC_LIBS += `$(PKG_CONFIG_HOST_BINARY) --libs openssl`
+MOSQUITTO_CONF_OPTS += \
+ -DWITH_TLS=ON \
+ -DWITH_TLS_PSK=ON
+
+ifeq ($(BR2_PACKAGE_LIBWEBSOCKETS),y)
+MOSQUITTO_DEPENDENCIES += libwebsockets
+MOSQUITTO_CONF_OPTS += -DWITH_WEBSOCKETS=ON
else
-MOSQUITTO_MAKE_OPTS += WITH_TLS=no
+MOSQUITTO_CONF_OPTS += -DWITH_WEBSOCKETS=OFF
endif
-ifeq ($(BR2_PACKAGE_CJSON),y)
-MOSQUITTO_DEPENDENCIES += cjson
-MOSQUITTO_MAKE_OPTS += WITH_CJSON=yes
-MOSQUITTO_STATIC_LIBS += -lcjson
-else
-MOSQUITTO_MAKE_OPTS += WITH_CJSON=no
+else # !OPENSSL
+MOSQUITTO_CONF_OPTS += \
+ -DWITH_TLS=OFF \
+ -DWITH_TLS_PSK=OFF \
+ -DWITH_WEBSOCKETS=OFF
endif
ifeq ($(BR2_PACKAGE_C_ARES),y)
MOSQUITTO_DEPENDENCIES += c-ares
-MOSQUITTO_MAKE_OPTS += WITH_SRV=yes
+MOSQUITTO_CONF_OPTS += -DWITH_SRV=ON
else
-MOSQUITTO_MAKE_OPTS += WITH_SRV=no
+MOSQUITTO_CONF_OPTS += -DWITH_SRV=OFF
endif
-ifeq ($(BR2_PACKAGE_LIBWEBSOCKETS),y)
-MOSQUITTO_DEPENDENCIES += libwebsockets
-MOSQUITTO_MAKE_OPTS += WITH_WEBSOCKETS=yes
+ifeq ($(BR2_INSTALL_LIBSTDCPP),y)
+MOSQUITTO_CONF_OPTS += -DWITH_LIB_CPP=ON
else
-MOSQUITTO_MAKE_OPTS += WITH_WEBSOCKETS=no
+MOSQUITTO_CONF_OPTS += -DWITH_LIB_CPP=OFF
endif
-# C++ support is only used to create a wrapper library
-ifneq ($(BR2_INSTALL_LIBSTDCPP),y)
-define MOSQUITTO_DISABLE_CPP
- $(SED) '/-C cpp/d' $(@D)/lib/Makefile
-endef
-
-MOSQUITTO_POST_PATCH_HOOKS += MOSQUITTO_DISABLE_CPP
-endif
-
-MOSQUITTO_MAKE_DIRS = lib client
ifeq ($(BR2_PACKAGE_MOSQUITTO_BROKER),y)
-MOSQUITTO_MAKE_DIRS += src apps/mosquitto_ctrl apps/mosquitto_passwd
-endif
+
+MOSQUITTO_CONF_OPTS += \
+ -DWITH_BROKER=ON \
+ -DWITH_APPS=ON \
+ -DWITH_PLUGINS=ON \
+ -DWITH_PLUGIN_ACL_FILE=ON \
+ -DWITH_PLUGIN_PASSWORD_FILE=ON \
+ -DWITH_PLUGIN_EXAMPLES=OFF \
+ -DWITH_PLUGIN_PERSIST_SQLITE=OFF \
+ -DWITH_PLUGIN_SPARKPLUG_AWARE=OFF
ifeq ($(BR2_PACKAGE_MOSQUITTO_BROKER_DYNAMIC_SECURITY_PLUGIN),y)
-MOSQUITTO_MAKE_DIRS += plugins/dynamic-security
+MOSQUITTO_CONF_OPTS += -DWITH_PLUGIN_DYNAMIC_SECURITY=ON
+else
+MOSQUITTO_CONF_OPTS += -DWITH_PLUGIN_DYNAMIC_SECURITY=OFF
endif
-define MOSQUITTO_BUILD_CMDS
- $(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) DIRS="$(MOSQUITTO_MAKE_DIRS)" \
- $(MOSQUITTO_MAKE_OPTS)
-endef
+ifeq ($(BR2_PACKAGE_SYSTEMD),y)
+MOSQUITTO_CONF_OPTS += -DWITH_SYSTEMD=ON
+MOSQUITTO_DEPENDENCIES += systemd
+endif
-define MOSQUITTO_INSTALL_STAGING_CMDS
- $(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) DIRS="$(MOSQUITTO_MAKE_DIRS)" \
- $(MOSQUITTO_MAKE_OPTS) DESTDIR=$(STAGING_DIR) install
-endef
-
-define MOSQUITTO_INSTALL_TARGET_CMDS
- $(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) DIRS="$(MOSQUITTO_MAKE_DIRS)" \
- $(MOSQUITTO_MAKE_OPTS) DESTDIR=$(TARGET_DIR) install
- rm -f $(TARGET_DIR)/etc/mosquitto/*.example
- $(INSTALL) -D -m 0644 $(@D)/mosquitto.conf \
- $(TARGET_DIR)/etc/mosquitto/mosquitto.conf
-endef
-
-ifeq ($(BR2_PACKAGE_MOSQUITTO_BROKER),y)
define MOSQUITTO_INSTALL_INIT_SYSV
$(INSTALL) -D -m 0755 package/mosquitto/S50mosquitto \
$(TARGET_DIR)/etc/init.d/S50mosquitto
@@ -130,26 +107,42 @@ endef
define MOSQUITTO_USERS
mosquitto -1 mosquitto -1 * - - - Mosquitto user
endef
+
+define MOSQUITTO_INSTALL_TARGET_CONF
+ rm -f $(TARGET_DIR)/etc/mosquitto/*.example
+ $(INSTALL) -D -m 0644 $(@D)/mosquitto.conf \
+ $(TARGET_DIR)/etc/mosquitto/mosquitto.conf
+endef
+MOSQUITTO_POST_INSTALL_TARGET_HOOKS += MOSQUITTO_INSTALL_TARGET_CONF
+
+else # !BR2_PACKAGE_MOSQUITTO_BROKER
+MOSQUITTO_CONF_OPTS += \
+ -DWITH_BROKER=OFF \
+ -DWITH_APPS=OFF \
+ -DWITH_PLUGINS=OFF
endif
-HOST_MOSQUITTO_DEPENDENCIES = host-pkgconf host-openssl
+HOST_MOSQUITTO_DEPENDENCIES = \
+ host-cjson \
+ host-openssl \
+ host-pkgconf
-HOST_MOSQUITTO_MAKE_OPTS = \
- $(HOST_CONFIGURE_OPTS) \
- UNAME=Linux \
- STRIP=true \
- prefix=$(HOST_DIR) \
- WITH_WRAP=no \
- WITH_DOCS=no \
- WITH_TLS=yes
-
-define HOST_MOSQUITTO_BUILD_CMDS
- $(MAKE) -C $(@D)/apps/mosquitto_passwd $(HOST_MOSQUITTO_MAKE_OPTS)
-endef
+HOST_MOSQUITTO_CONF_OPTS = \
+ -DWITH_DOCS=OFF \
+ -DWITH_BUNDLED_DEPS=ON \
+ -DWITH_CLIENTS=OFF \
+ -DWITH_BROKER=OFF \
+ -DWITH_PLUGINS=OFF \
+ -DWITH_TESTS=OFF \
+ -DWITH_APPS=ON \
+ -DWITH_TLS=ON
+# Manually install just the one tool we need
define HOST_MOSQUITTO_INSTALL_CMDS
- $(MAKE) -C $(@D)/apps/mosquitto_passwd $(HOST_MOSQUITTO_MAKE_OPTS) install
+ $(INSTALL) -D -m 0755 \
+ $(@D)/apps/mosquitto_passwd/mosquitto_passwd \
+ $(HOST_DIR)/bin/mosquitto_passwd
endef
-$(eval $(generic-package))
-$(eval $(host-generic-package))
+$(eval $(cmake-package))
+$(eval $(host-cmake-package))
--
2.34.1
____________________________________________________________________________________________________________
Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.
This message and its attachments may contain confidential or privileged information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message and its attachments.
As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified.
Thank you.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 3+ messages in thread