Skip to content

Commit

Permalink
Added CLIENT_STATIC_LDADD to makefile builds
Browse files Browse the repository at this point in the history
This allow more libraries to be linked when compiling the clients with a
static libmosquitto, as required for e.g. openssl on some systems.

Closes #1371. Thanks to Fabrice Fontaine.
  • Loading branch information
ralight committed Nov 6, 2019
1 parent 678131e commit 6bde209
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
5 changes: 5 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ Clients:
- Fix duplicate cfg definition in rr_client. Closes #1453.
- Fix `mosquitto_pub -l` hang when stdin stream ends. Closes #1448.

Build:
- Added `CLIENT_STATIC_LDADD` to makefile builds to allow more libraries to be
linked when compiling the clients with a static libmosquitto, as required
for e.g. openssl on some systems.

Installer:
- Fix mosquitto_rr.exe not being included in Windows installers. Closes #1463.

Expand Down
6 changes: 3 additions & 3 deletions client/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ static : static_pub static_sub static_rr
# libmosquitto only.

static_pub : pub_client.o pub_shared.o client_props.o client_shared.o ../lib/libmosquitto.a
${CROSS_COMPILE}${CC} $^ -o mosquitto_pub ${CLIENT_LDFLAGS} ${STATIC_LIB_DEPS}
${CROSS_COMPILE}${CC} $^ -o mosquitto_pub ${CLIENT_LDFLAGS} ${STATIC_LIB_DEPS} ${CLIENT_STATIC_LDADD}

static_sub : sub_client.o sub_client_output.o client_props.o client_shared.o ../lib/libmosquitto.a
${CROSS_COMPILE}${CC} $^ -o mosquitto_sub ${CLIENT_LDFLAGS} ${STATIC_LIB_DEPS}
${CROSS_COMPILE}${CC} $^ -o mosquitto_sub ${CLIENT_LDFLAGS} ${STATIC_LIB_DEPS} ${CLIENT_STATIC_LDADD}

static_rr : rr_client.o client_props.o client_shared.o pub_shared.o sub_client_output.o ../lib/libmosquitto.a
${CROSS_COMPILE}${CC} $^ -o mosquitto_rr ${CLIENT_LDFLAGS} ${STATIC_LIB_DEPS}
${CROSS_COMPILE}${CC} $^ -o mosquitto_rr ${CLIENT_LDFLAGS} ${STATIC_LIB_DEPS} ${CLIENT_STATIC_LDADD}

mosquitto_pub : pub_client.o pub_shared.o client_shared.o client_props.o
${CROSS_COMPILE}${CC} $(CLIENT_LDFLAGS) $^ -o $@ $(CLIENT_LDADD)
Expand Down
5 changes: 5 additions & 0 deletions config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ WITH_STRIP:=no
# Build static libraries
WITH_STATIC_LIBRARIES:=no

# Use this variable to add extra library dependencies when building the clients
# with the static libmosquitto library. This may be required on some systems
# where e.g. -lz or -latomic are needed for openssl.
CLIENT_STATIC_LDADD:=

# Build shared libraries
WITH_SHARED_LIBRARIES:=yes

Expand Down

0 comments on commit 6bde209

Please sign in to comment.