From 46de5ffae3b644eb654bd6a336dc2888a5a7954a Mon Sep 17 00:00:00 2001 From: Roger Light Date: Sat, 24 Apr 2021 22:52:55 +0100 Subject: [PATCH] Report on what compile time options are available. Closes #2193. Thanks to Lucy2003. --- ChangeLog.txt | 1 + src/mosquitto.c | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index f9cbc67c..21acaa9f 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -15,6 +15,7 @@ Broker: supported. Closes #2122. - Add kqueue support. - Enforce receive maximum on MQTT v5. +- Report on what compile time options are available. Closes #2193. Client library: - Add MOSQ_OPT_DISABLE_SOCKETPAIR to allow the disabling of the socketpair diff --git a/src/mosquitto.c b/src/mosquitto.c index ccf3ac53..a2a9a50e 100644 --- a/src/mosquitto.c +++ b/src/mosquitto.c @@ -211,6 +211,36 @@ int pid__write(void) } +void report_features(void) +{ +#ifdef WITH_BRIDGE + log__printf(NULL, MOSQ_LOG_INFO, "Bridge support available."); +#else + log__printf(NULL, MOSQ_LOG_INFO, "Bridge support NOT available."); +#endif +#ifdef WITH_PERSISTENCE + log__printf(NULL, MOSQ_LOG_INFO, "Persistence support available."); +#else + log__printf(NULL, MOSQ_LOG_INFO, "Persistence support NOT available."); +#endif +#ifdef WITH_TLS + log__printf(NULL, MOSQ_LOG_INFO, "TLS support available."); +#else + log__printf(NULL, MOSQ_LOG_INFO, "TLS support NOT available."); +#endif +#ifdef FINAL_WITH_TLS_PSK + log__printf(NULL, MOSQ_LOG_INFO, "TLS-PSK support available."); +#else + log__printf(NULL, MOSQ_LOG_INFO, "TLS-PSK support NOT available."); +#endif +#ifdef WITH_WEBSOCKETS + log__printf(NULL, MOSQ_LOG_INFO, "Websockets support available."); +#else + log__printf(NULL, MOSQ_LOG_INFO, "Websockets support NOT available."); +#endif +} + + int main(int argc, char *argv[]) { struct mosquitto__config config; @@ -301,6 +331,7 @@ int main(int argc, char *argv[]) }else{ log__printf(NULL, MOSQ_LOG_INFO, "Using default config."); } + report_features(); rc = mosquitto_security_module_init(); if(rc) return rc;