diff --git a/apps/mosquitto_passwd/Makefile b/apps/mosquitto_passwd/Makefile index 73de1465..122d0aa8 100644 --- a/apps/mosquitto_passwd/Makefile +++ b/apps/mosquitto_passwd/Makefile @@ -7,6 +7,12 @@ OBJS= mosquitto_passwd.o \ misc_mosq.o \ password_mosq.o +ifeq ($(WITH_TLS),yes) +all: mosquitto_passwd +else +all: +endif + mosquitto_passwd : ${OBJS} ${CROSS_COMPILE}${CC} ${APP_LDFLAGS} $^ -o $@ $(PASSWD_LDADD) diff --git a/buildtest.py b/buildtest.py index f8e751a3..6e6cf87a 100755 --- a/buildtest.py +++ b/buildtest.py @@ -3,6 +3,7 @@ build_variants = [ 'WITH_ADNS', 'WITH_BRIDGE', + 'WITH_CJSON', 'WITH_DOCS', 'WITH_EC', 'WITH_EPOLL', diff --git a/config.mk b/config.mk index 506fab1b..4f7d4e77 100644 --- a/config.mk +++ b/config.mk @@ -217,12 +217,13 @@ ifeq ($(WITH_WRAP),yes) endif ifeq ($(WITH_TLS),yes) - BROKER_LDADD:=$(BROKER_LDADD) -lssl -lcrypto - LIB_LIBADD:=$(LIB_LIBADD) -lssl -lcrypto + APP_CPPFLAGS:=$(APP_CPPFLAGS) -DWITH_TLS BROKER_CPPFLAGS:=$(BROKER_CPPFLAGS) -DWITH_TLS - LIB_CPPFLAGS:=$(LIB_CPPFLAGS) -DWITH_TLS - PASSWD_LDADD:=$(PASSWD_LDADD) -lcrypto + BROKER_LDADD:=$(BROKER_LDADD) -lssl -lcrypto CLIENT_CPPFLAGS:=$(CLIENT_CPPFLAGS) -DWITH_TLS + LIB_CPPFLAGS:=$(LIB_CPPFLAGS) -DWITH_TLS + LIB_LIBADD:=$(LIB_LIBADD) -lssl -lcrypto + PASSWD_LDADD:=$(PASSWD_LDADD) -lcrypto STATIC_LIB_DEPS:=$(STATIC_LIB_DEPS) -lssl -lcrypto ifeq ($(WITH_TLS_PSK),yes) @@ -347,6 +348,7 @@ endif ifeq ($(WITH_CJSON),yes) CLIENT_CFLAGS:=$(CLIENT_CFLAGS) -DWITH_CJSON -I/usr/include/cjson -I/usr/local/include/cjson CLIENT_LDADD:=$(CLIENT_LDADD) -lcjson + CLIENT_STATIC_LDADD:=$(CLIENT_STATIC_LDADD) -lcjson endif BROKER_LDADD:=${BROKER_LDADD} ${LDADD} diff --git a/src/password_mosq.c b/src/password_mosq.c index 69bee550..0123bbe0 100644 --- a/src/password_mosq.c +++ b/src/password_mosq.c @@ -57,6 +57,7 @@ Contributors: #include "misc_mosq.h" +#ifdef WITH_TLS int base64_encode(unsigned char *in, unsigned int in_len, char **encoded) { BIO *bmem, *b64; @@ -178,6 +179,7 @@ int pw__hash(const char *password, struct mosquitto_pw *pw, bool new_salt) return MOSQ_ERR_SUCCESS; } +#endif int pw__memcmp_const(const void *a, const void *b, size_t len) {